fix(auth): report OAuth denial instead of an internal CLI error - #251
Draft
AmanVarshney01 wants to merge 1 commit into
Draft
fix(auth): report OAuth denial instead of an internal CLI error#251AmanVarshney01 wants to merge 1 commit into
AmanVarshney01 wants to merge 1 commit into
Conversation
Signed-off-by: Aman Varshney <amanvarshney.work@gmail.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
commit: |
Member
Author
|
CI update: Windows and Linux CLI test jobs pass, along with lint, type checking, and error-reference completeness. Two checks are red: Skill Packaging reports the existing bundled skill stamped 8.0.0-rc.12 while the package is 8.0.0-rc.13; real-API e2e fails the init rerun expectation (synced versus up-to-date). Neither skill packaging nor init is modified by this PR. Keeping this draft and recording these separately rather than broadening the auth-denial fix. |
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.
Reproduced with the published binary
On Linux, start prisma@8.0.0-rc.13 auth login --json with isolated credentials and send a normal OAuth access_denied response to its local callback listener. The published binary reports CLI.INTERNAL_ERROR with the callback description as its summary. No authorization code, token exchange, or real account is needed to exercise this failure path.
Fix in the owning repo
Recognize access_denied where the callback is handled and emit AUTH.LOGIN_DENIED with an actionable next step. Do not echo the untrusted callback description. No token exchange runs and no existing session is cleared. Other OAuth/SDK errors and signal cancellation remain unchanged; this is not a catch-all auth wrapper.
Verification
Scope and limits
This corrects an expected sign-in refusal being reported as a programming error; it does not make denied authorization succeed. Production create-prisma auth telemetry only contains generic exit codes, so this does not prove all reported auth failures are denials. Browser/account happy-path authorization was not performed, and no credentials were changed. The separate Linux localhost IPv4/IPv6 callback mismatch observed during reproduction is not changed here because the registered redirect-host contract needs separate validation.