Repository navigation
Conversation
|
⏳ DRAFT
What to do
Review readiness checklist
✅ 4/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
The Kiro social device poll reports a completed grant as status "authorized", but the poll branch only accepted "approved", so every Google/GitHub device login ended as failed after browser approval and no account was stored. Accept "authorized" and keep "approved" as an alias; all other success checks are unchanged. Assisted-by: Claude Opus 5.5 (Claude Code)
1dc9a66 to
c3bf51d
Compare
|
Carried onto an upstream branch in #7062 (with a Co-authored-by trailer) so the repository CI can run. It is held there for the security review that MAINTAINERS.md requires for authentication changes. Leaving this PR open until that review concludes. |
…top Bad credentials (#7053, #7054) (#7062) * fix(kiro): accept authorized social device grants Carries #7053. Preserve token, profile, principal, and HTTP validation. Co-authored-by: Veritas-7 <234569343+Veritas-7@users.noreply.github.com> * fix(kiro): quarantine exact desktop bad-credentials refusals Carries #7054. Keep AWS SSO and other status/message pairs retryable. Co-authored-by: Veritas-7 <234569343+Veritas-7@users.noreply.github.com> * fix(chatgpt): preserve launcher when app inspection fails Carries #7055. Report unknown inspection state and refuse an unconfirmed restart. Co-authored-by: lcxhh <lcxhh521@gmail.com> * fix(proxy): bound SOCKS5 TLS handshake lifetime Carries #7056. Clear deadline and listeners on every TLS handshake exit while keeping certificate verification. Co-authored-by: lcxhh <lcxhh521@gmail.com> * docs: triage exceeded-retry-limit 429 errors Carries #6925. Align refresh release conditions and the resolved credit rediscovery reference with current dev. Co-authored-by: Howard-Jerry <197214646+Howard-Jerry@users.noreply.github.com> --------- Co-authored-by: JUN <243035832+lidge-jun@users.noreply.github.com> Co-authored-by: Veritas-7 <234569343+Veritas-7@users.noreply.github.com> Co-authored-by: lcxhh <lcxhh521@gmail.com> Co-authored-by: Howard-Jerry <197214646+Howard-Jerry@users.noreply.github.com> Co-authored-by: jun <jun@juns-Mac-Studio.local>
Summary
Native Kiro social device login (
ocx account login kiro --method googleor--method github) always ends infailedafter the user approves the login in the browser, and no account is stored. The poll branch insrc/oauth/kiro-device-login.tstreats any non-approvedstatus as terminal failure, but the social poll endpoint reports a completed grant asstatus: "authorized".Observed replies from
POST https://prod.us-east-1.auth.desktop.kiro.dev/oauth/device/poll(2026-10-13; keys and non-secret values only, token values and the account number withheld):status: "authorization_pending";accessToken,refreshTokenandprofileArnare present asnull.accessToken,identityProvider("Google"),profileArn(arn:aws:codewhisperer:us-east-1:<account>:profile/<id>),refreshToken,status: "authorized". NoexpiresInand noerrorkey.The fix accepts
"authorized"as the social success status and keeps"approved"as an alias, so existing behavior and tests are unchanged. Every other check on the success path still applies: HTTP 200, noerrorkey orx-amzn-errortype, non-empty access and refresh tokens, and aprofileArnmatching the existing pattern. Unknown statuses still fail closed. The Builder ID branch is untouched.Changed files:
src/oauth/kiro-device-login.ts: accept"authorized"in the social poll success check (one condition).tests/providers/kiro/kiro-device-social.test.ts: a regression that replays the observed sequence (authorization_pendingwith null tokens, thenauthorizedwithidentityProvider) and asserts the flow stayspendingand stores nothing, then reachesdoneand persists the refresh token and profile ARN without leaking tokens into the public view.Verification
Base:
devate2886a64a(rebased; the focused results below were re-run on this base: the four device-login files give 21 pass, 0 fail, andbun run typecheckpasses). Earlier figures were measured on60752ec3c. Tests were run with Bun 1.4.2 (the runtime the package ships); CONTRIBUTING pins 1.4.3 for the suite runner, so CI is the authoritative run.bun test ./tests/providers/kiro/kiro-device-social.test.ts: 4 pass, 0 fail.src/change reverted, the same file gives 3 pass, 1 fail. The new case fails withExpected: "done"/Received: "failed", which is the reported symptom.bun test ./tests/providers/kiro/kiro-device-social.test.ts ./tests/providers/kiro/kiro-device-builder.test.ts ./tests/server/server-kiro-device-login.test.ts ./tests/cli/cli-account-kiro-device.test.ts ./tests/ci-workflows/file-size-ratchet.test.ts: 30 pass, 0 fail.bun run typecheck: passed.bun run structure:check: passed.bun run privacy:scan: passed.git diff --check: clean.I did not run the full local suite (
bun run test). The change is a single condition in one module, and the focused files above cover the social, Builder ID, server and CLI device-login paths. Required CI on the PR head still has to pass.Checklist
structure/contract names the poll status value.maintainer-sponsored) per CONTRIBUTING.🤖 Generated with Claude Code
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit