demo-claim-code
Problem. POST /api/demo/apps returned claimToken (the update bearer) and a claimUrl whose fragment was that same token, so an agent handing the person their claim link had to read the update secret into its transcript.
Change. Create mints a second secret, the claim code, and stores only its SHA-256 (demo_apps.claim_code_hash, claim_code_minted).
claimUrlis now<console>/demo/claim#<claim code>.claimTokenis unchanged: the update bearer.- Claim start (
POST /api/demo/claims) takes the claim code asclaimCode, or under the old field nameclaimToken(exactly one). Browser claim (/demo/claim/intent) takes it from the fragment as before. - The update endpoint refuses the claim code; both claim entry points refuse the update bearer.
- Back-compat: a demo created before this release has
claim_code_minted=0; only such a row accepts its bearer at the claim doors, until it expires (24 h). - The code is spent with the bearer at claim commit, expiry and takedown, and a code is only accepted while its bearer is live.
demo_spent_tokens.kind(token/update/code) keeps each door's refusal reasons to its own credential. - Migration adds three columns and one partial unique index; nothing dropped or rewritten.
Tests. demo_claim_code_test.go (doors both ways, legacy links, minted-flag gate, code dies with bearer, migration, nothing logged); demo_spent_token_test.go covers spent reasons for both credentials and cross-door refusals after spending.
Not in this branch. Release/roll (Paul's GO). Website contract repin after release.
Demo claim links carry their own one-time claim code; the update bearer never has to be shown.
Discussions 1 open
Tasks 7/7 done
Activity
- paul@keymail.dev pushed 26f61887d Merge main into demo-claim-code
- paul@keymail.dev pushed 98e0f9896 demo: claim-code migration passes a context to its statements
- claude agent, operated by paul@keymail.dev replied to Astra review of demo-claim-code
- claude agent, operated by paul@keymail.dev opened Astra review of demo-claim-code
- paul@keymail.dev pushed 156490db5 demo: admission wiring test reads the claim code from claimUrl
- claude agent, operated by paul@keymail.dev opened Merge on green CI
- claude agent, operated by paul@keymail.dev opened Tests
- claude agent, operated by paul@keymail.dev opened Astra review
- claude agent, operated by paul@keymail.dev opened Spend code with bearer on claim, expiry, takedown
- claude agent, operated by paul@keymail.dev opened Back-compat for pre-release demos
- claude agent, operated by paul@keymail.dev opened Claim doors accept code, refuse bearer; update refuses code
- claude agent, operated by paul@keymail.dev opened Mint claim code at create, store hash only
- paul@keymail.dev pushed 12c7942c2 demo: claim links carry their own claim code, not the update bearer