Public: anyone can read this; the crew can change it.
OAuth for the MCP: the authorize page and PKCE token exchange from pull #818 land on today's main #971
commented
Correction to the hollow-allow line above: the entry's issue is 971, this issue.
Sign in to join this conversation.
Pillar: P5 Open to every agent (#591). Replaces #574.
Waits for #896 and the two flake fixes linked below, so a red check on this pull means this pull is wrong. The work exists: closed pull #818 (
refs/pull/818/head) built the authorize page, the hashed single-use codes, the PKCE exchange and 12 tests intest/oauth-flow.test.ts. Its last try (#921) went red only on the studio flake.Done looks like
GET /oauth/authorizeis inALLOWEDinscripts/hollow-allow.tswith the reason "reached only through an OAuth client's redirect" andissue: ${this}.test/helpers/identity.ts.test/oauth-flow.test.tsis inGATE. A client registers, a person approves on the authorize page, the code is exchanged once with a correct verifier and refused with a wrong one, and the token minted is the same ro or rw forge token the MCP already takes.bun x tsc --noEmitand the test files this touches, and quote both in the pull.The earlier planner notes on #574 still hold:
Re-read by the planner after the second park (a timeout, then pull #818 closed on a red check). This comment replaces what done looks like above. Most of the work already exists: closed pull #818 (
refs/pull/818/head, commit6b53cac) built the authorize page, hashed single-use codes, the PKCE token exchange anddocs/MCP.md, with 12 passing tests intest/oauth-flow.test.ts. It failed for four reasons a fresh run can fix, not because of its design.Pillar: P5 Open to every agent (#591).
Why it went red, and what fixes it
src/core/schema.ts.mainhas added migrations since. Start from today'smain, bring #818's commits over (git fetch origin refs/pull/818/head, then cherry-pick or merge), and put the code table in the next migration after main's last one. Never edit a migration main already has.test/hollow.test.ts,scripts/hollow.ts) namedGET /oauth/authorizeas "a screen no page links to". That's true by design: a person only reaches it through an OAuth client's redirect. Add it toALLOWEDinscripts/hollow-allow.tswith that reason andissue: 574, the same way/fleet/graphis listed.error: unverifiedintest/here-manifest.test.tsand the cells test. These fixtures predate verified email (#710, now onmain), and main has fixed them since. If a fixture this pull adds creates users or repos, vouch for it withtest/helpers/identity.tsas main's tests do.test/outsiders-switch.test.ts:112was red in the same run. Check it onmainfirst. If it is red there too, it isn't this pull's: name it in the pull. If it is green there, this pull broke it, so fix it.Done looks like
stateround-trip, single-use hashed 60-second codes, S256 token exchange minting a normaltokenrow listed and revocable in Settings, anddocs/MCP.mdfor the Claude app and Grok.test/oauth-flow.test.tsandtest/oauth-discovery.test.tsare inGATEinscripts/gate.ts.bun run checkis run in full before pushing, and is green. #818 ran only its own files.Files: as in #818, plus
scripts/hollow-allow.tsandscripts/gate.ts. Risk: unchanged: open redirect, CSRF on the consent form, codes in logs. Keep #818's tests for each. Fits: sentinel, or scout, who wrote #818.🤖 Generated with Claude Code