Repository navigation
Fix OAuth refresh redirects and credential-store races - #1054
Conversation
Keep refresh retries within authenticated configured API origins so a 401 from a redirected download cannot reintroduce API credentials. Preserve legitimate same-origin REST and GraphQL redirects without replacing other authentication identities. Match origins consistently across numeric ports, DNS lookup and HTTP wire authorities. Serialize all refresh credential-store access so concurrent 401s share one token exchange without racing on backend selection.
There was a problem hiding this comment.
No actionable findings from this pass. This changes credential forwarding and OAuth refresh eligibility across redirects (L3), so I’m leaving approval to a human.
Want to dig deeper?
Paste this into your agent to explore the findings from this review's Buildkite build:
Download the buildsworth logs from build 42406, then answer my questions about the findings.
Install the reading-buildsworth-logs skill to run this.
About buildsworth
Model: gpt-6.1-sol with xhigh thinking.
How to request a review: Comment @buildsworth-bk review on the PR, or request buildsworth-bk as a reviewer.
Risk labels (how buildsworth classifies risk) — buildsworth classifies risk itself from the diff. Unless repository policy already allows L2 approval, grant it by mentioning @buildsworth-bk (see approval ceiling and L2 approval grant):
- L1 — Low risk (dep bumps, docs/copy, lockfiles, small presentational fixes). buildsworth may approve by default.
- L2 — Standard risk (new UI, additive API fields, refactors). Approved only when repository policy or a verified grant allows it; otherwise comment-only.
- L3 — High risk (auth, migrations, payments, secrets, perf-critical pipeline paths). Human approval required unless repository policy explicitly allows L3 approval; per-PR grants cannot allow it.
Keep both direct dependency declarations and factory test imports. Preserve refresh safety checks alongside debug and streaming updates.
There was a problem hiding this comment.
No actionable findings from this pass. This changes API-token forwarding across redirects and OAuth refresh eligibility (L3), so human approval is required.
Want to dig deeper?
Paste this into your agent to explore the findings from this review's Buildkite build:
Download the buildsworth logs from build 43588, then answer my questions about the findings.
Install the reading-buildsworth-logs skill to run this.
Description
A 401 from a redirected download can cause the CLI to retry with its API token after Go stripped authorization. Concurrent refreshes also read mutable credential-store state outside the refresh lock.
Changes
This does not change the SDK's existing redirect-header forwarding.
Testing
go test ./..., with inherited credentials removed).mise run format).mise run lint).-race; the concurrent-refresh case passes 20 repetitions.