feat: anonymous public registration sessions#73
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds anonymous-public registration-session publishing for
roar register --publicandroar put --public.When GLaaS advertises support,
roarnow uses staged registration sessions for anonymous public publishes instead of the legacy one-shot/api/v1/sessionspath. Finalize is server-authoritative:roarstages jobs/artifacts, sends lightweight staged-count expectations, and trusts the hash returned by GLaaS.Falls back to legacy anonymous session registration when the server does not advertise the required capabilities.
Flow
flowchart TD A[roar register --public / roar put --public] --> B[GET /api/v1/health] B --> C{Server supports anonymous_public + server-authoritative finalize?} C -- No --> L[Legacy anonymous publish] L --> L1[POST /api/v1/sessions] L1 --> L2[Return session hash/url] C -- Yes --> D{Bearer auth present?} D -- Yes --> E[Authenticated registration session] D -- No --> F{SSH credentials available?} F -- No --> H[Anonymous-public registration session] F -- Yes --> G[Probe SSH auth] G -- SSH accepted --> E G -- SSH rejected --> H G -- Inconclusive --> E E --> E1[POST /api/v1/registration-sessions] E1 --> E2[Stage jobs/artifacts with authenticated auth] E2 --> E3[Finalize authenticated/scoped session] H --> H1[POST /api/v1/registration-sessions mode=anonymous_public] H1 --> H2[Receive registration_session_token] H2 --> H3[Stage jobs/artifacts with RegistrationSession token] H3 --> H4[POST finalize with expected staged counts] H4 --> H5[Use server-returned authoritative hash]Anonymous-public staged finalize
sequenceDiagram participant R as roar participant A as GLaaS API participant DB as Staged lineage DB R->>A: GET /api/v1/health A-->>R: anonymous_public=true<br/>finalize_server_authoritative_hash=true R->>A: POST /api/v1/registration-sessions<br/>{ mode: "anonymous_public" } A-->>R: registration_session_id<br/>registration_session_token R->>A: POST /registration-sessions/:id/jobs/batch<br/>Authorization: RegistrationSession token A->>DB: Persist staged jobs R->>A: POST /registration-sessions/:id/jobs/:uid/inputs|outputs<br/>Authorization: RegistrationSession token A->>DB: Persist staged artifact links R->>A: POST /registration-sessions/:id/finalize<br/>{ expected: { jobs, inputs, outputs } } A->>DB: Read persisted staged lineage A->>A: Validate staged counts A->>A: Compute canonical hash server-side A-->>R: { hash, canonical_version, staged_counts }Auth decision model
flowchart LR A[Publish request] --> B{Public and unscoped?} B -- No --> C[Require authenticated/scoped path] B -- Yes --> D{Bearer token?} D -- Yes --> E[Attributed authenticated publish] D -- No --> F{SSH credentials?} F -- No --> G[Anonymous-public publish] F -- Yes --> H[Probe SSH against GLaaS] H -- Accepted --> I[Attributed SSH publish] H -- Rejected --> G H -- Inconclusive --> INotable behavior
Verification