fix(auth): identify workspace sessions by account - #214
Draft
AmanVarshney01 wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
commit: |
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
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.
What this PR does
Makes local workspace sessions clearly identifiable when multiple Prisma accounts have authorized workspaces on the same machine.
The observed failure mode was:
auth workspace listshowed only two entries, including a stalePersonal workspace.Product behavior
auth loginresolves the authorizing account through/v1/meand stores only safe user metadata: id, email, and name.auth workspace listdisplays Workspace, User, Id, and Status.auth workspace useselection labels include the account identity.items[].userandcontext.scope = "local-sessions".auth loginas the next action so users can authorize another workspace.sessions()reads remain local-only.Safety and compatibility
packages/cli; the published@prisma/cli-engine@0.2.0contract is unchanged, so Composer and ORM keep resolving one compatible engine.Important scope boundary
This command lists workspace sessions authorized on this machine. It is not a list of every workspace membership visible in Console.
This PR does not fix the separate
auth.prisma.iobrowser-session/account-switching problem. The OAuth authorization page can still open under a different browser account thanconsole.prisma.ioand currently has no clear account indicator or switch action; that needs a control-plane/auth UI follow-up.After this lands, create-prisma should consume
items[].userwhen rendering its own workspace deployment picker. The structured field added here is the supported input for that follow-up.Verification
node scripts/check-engine-version.mjs origin/main: engine version0.2.0is consistentpnpm lintpnpm typecheckpnpm check:grammarpnpm check:conformance: 5 subjects checked, nothing to reportpnpm --filter @prisma/cli test: 985 passed, 1 skippedvarshney@prisma.io; an expired legacy session remained safely unidentified rather than being mislabeled or deleted