fix(cli): make fresh setup and logout use canonical cloud auth - #441
fix(cli): make fresh setup and logout use canonical cloud auth#441miyaontherelay wants to merge 4 commits into
Conversation
Session-Id: 01a03068-91e3-7a21-9de9-8fed7d680d3e
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
Session-Id: 01a03068-91e3-7a21-9de9-8fed7d680d3e
Session-Id: 01a03068-91e3-7a21-9de9-8fed7d680d3e
|
@coderabbitai review |
|
Relayfile Eval ReviewRun: Passed: 4 | Needs human: 0 | Reviewable: 0 | Missing output: 0 | Failed: 0 | Skipped: 0 Human Review CasesNo reviewable human-review cases captured Relayfile output. |
|
Independent review of exact head Finding[P1] Do not treat a self-hosted catalog row as the hosted Cloud workspace —
This violates the documented hosted-over-self-hosted precedence and makes coexistence fail for a plausible upgrade path (the same project/workspace name in both modes). Hosted setup/create needs to establish identity from the current Cloud session—matching Cloud IDs/bindings, not a name-only local row—and create when no current-Cloud match exists, while leaving the self-hosted row/file intact. The new coexistence test at Other audited constraintsNo further findings in the requested areas:
Validation
I did not approve, merge, or modify the branch. |
|
Accepted as blocking: the current hosted setup path can reuse a name-only row from the shared local catalog, including a legitimate self-hosted row, before establishing identity from the current Cloud session. That violates hosted-over-self-hosted precedence and can reproduce the original workspace-not-found failure. I am adding a must-fire regression that seeds the colliding self-hosted catalog row, asserts the hosted request sequence is create → resolve → mint, and byte-compares the legacy No merge action will be taken. |
|
Red regression captured on exact pre-fix head
fails with: The test seeds both the legacy |
Session-Id: 01a03068-91e3-7a21-9de9-8fed7d680d3e
|
P1 fixed in The setup/create identity decision no longer calls Cloud with a name-only local catalog row:
Must-fire regression:
Additional coverage verifies current-session exact-ID reuse, stale-binding replacement, repeat messaging-only provisioning through the authoritative list, and active hosted selection across duplicate display names. Local validation on the new head:
Exact-head CI is now pending. No merge action was taken. |
|
Final exact-head validation for the P1 fix (
Review-body audit after the final push:
The PR is open, GitHub reports merge state CLEAN, and the local branch is clean and tracks origin. No merge, publish, release, or tag was performed. |
Closes #440.
What changed
POST /api/v1/workspaces→GET /api/v1/workspaces/{cloudId}/resolve→ delegated-token mint against the returnedrelayfileWorkspaceIdworkspace_not_foundinstead of surfacing a raw 404workspace create,workspace list, andworkspace currentuse the canonical hosted session when configured~/.relayfile/credentials.jsoncloud-auth.jsonandcloud-identity.json, then clear Relayfile-local credentialsThe two credential stores remain independent. This change does not migrate, move, or rewrite
credentials.jsoninto the hosted store.Red before green
The new regressions failed on
origin/mainwith the observed behavior:404 workspace_not_foundfrom delegated-token mintworkspace list --names-onlyprinted nothingworkspace createmade zero Cloud requests when a self-hosted file also existedThe self-hosted-only guard passed on main and byte-compares
credentials.jsonbefore/afterworkspace create; it remains green after this change.Verification
go test ./cmd/relayfile-cli -count=1go test ./... -count=1go vet ./...git diff --checkThe focused logout coverage reads the stored auth state after the command, asserts the refresh token was revoked, and verifies both canonical auth and identity state are gone. A separate negative test verifies an unconfirmed revoke leaves the session available for retry and prints no false success result.