sign-in S3: the door's three routes — mint a challenge, take the app's presentation, tell the page what happened #1525

Closed
opened 2026-09-16 03:15:00 +00:00 by ben · 2 comments
Owner

Parent

Spec #1492 (wallet sign-in — the app door by device, the approve card, sign-in sites, refusals, ledger-walked sessions, and the App-only switch). Program map #1293. Design contract: DDR 0246, flow docs/ux/flows/wallet-signin.mermaid, wireframes docs/ux/wireframes/wallet-signin/. Mechanics: ADR 0236 (the bridge verifies in Go), proven end to end by prototype #1301 (spikes/1301-wallet-signin/).

The route half of stories 1–7 (the page is S4). Sequencing. Ben ruled the pairing spec (#1495) lands first: this ticket sits behind the served 1.1 descriptor, so signin{url} and the community's real doors exist before the door is built against them.

What to build

The machinery behind the app door: one route that mints a challenge and describes the ask, one that takes
the app's answer and returns a verdict, and one the page watches. The page's whole job is to show what
these three say.

Acceptance criteria

  • The challenge route returns the challenge id, its expiry, the door's own sign-in address, the
    credential kind(s) asked for, the service's name (from the client that started the hop) and the
    community's name, and builds the deep link from exactly that payload
  • The same payload sits behind the scannable code and the button; the code is served by its own route
    keyed on the challenge id
  • The present route accepts the app's answer cross-origin (the app is not a browser page, but its web
    build is) and returns the verdict through the verifier
  • The status route, keyed on the challenge id, reports waiting, verified, refused-with-kind or expired;
    on verified it completes the authorization request so the page can redirect
  • A challenge expires after two minutes; a fresh one can be minted on the same authorization request
    without restarting the hop
  • Challenges are single-use: a consumed or expired challenge is refused
  • Proven at the bridge seam: present → token, and each refusal kind surfaced on the status route

Blocked by

Tracker: #1523

  • S1 (the verifier)

Task manifest

task: app-door-routes
implements_flow: wallet-signin
implements_edge: "WS-S1 → WS-A2 → verdict"
seam: the bridge's OIDC-over-HTTP smoke tests
depends_on: [wallet-signin:go-verifier-at-the-door]
out_of_scope: [the page itself, the refusal copy, push to the wallet]
needs_human_decision: []
## Parent Spec **#1492** (wallet sign-in — the app door by device, the approve card, sign-in sites, refusals, ledger-walked sessions, and the App-only switch). Program map **#1293**. Design contract: **DDR 0246**, flow `docs/ux/flows/wallet-signin.mermaid`, wireframes `docs/ux/wireframes/wallet-signin/`. Mechanics: **ADR 0236** (the bridge verifies in Go), proven end to end by prototype **#1301** (`spikes/1301-wallet-signin/`). The route half of stories 1–7 (the page is S4). **Sequencing.** Ben ruled the pairing spec (#1495) lands first: this ticket sits behind the served 1.1 descriptor, so `signin{url}` and the community's real doors exist before the door is built against them. ## What to build The machinery behind the app door: one route that mints a challenge and describes the ask, one that takes the app's answer and returns a verdict, and one the page watches. The page's whole job is to show what these three say. ## Acceptance criteria - [ ] The challenge route returns the challenge id, its expiry, the door's **own** sign-in address, the credential kind(s) asked for, the service's name (from the client that started the hop) and the community's name, and builds the deep link from exactly that payload - [ ] The same payload sits behind the scannable code and the button; the code is served by its own route keyed on the challenge id - [ ] The present route accepts the app's answer cross-origin (the app is not a browser page, but its web build is) and returns the verdict through the verifier - [ ] The status route, keyed on the challenge id, reports waiting, verified, refused-with-kind or expired; on verified it **completes the authorization request** so the page can redirect - [ ] A challenge expires after two minutes; a fresh one can be minted on the same authorization request without restarting the hop - [ ] Challenges are single-use: a consumed or expired challenge is refused - [ ] Proven at the bridge seam: present → token, and each refusal kind surfaced on the status route ## Blocked by Tracker: #1523 - S1 (the verifier) ## Task manifest ```yaml task: app-door-routes implements_flow: wallet-signin implements_edge: "WS-S1 → WS-A2 → verdict" seam: the bridge's OIDC-over-HTTP smoke tests depends_on: [wallet-signin:go-verifier-at-the-door] out_of_scope: [the page itself, the refusal copy, push to the wallet] needs_human_decision: [] ```

swarm-claim host=bens-mac-04 run=26676
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=26676 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1525 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1525,
  "status": "success",
  "commits": [
    "37d86f62de8189e499aa3f22d060d5850c24cd0c"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/idp/appdoor.go",
    "internal/idp/appdoor_seam_test.go",
    "internal/idp/config.go",
    "internal/idp/fake_verifier_test.go",
    "internal/idp/provider.go",
    "internal/idp/signin.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/idp/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/idp/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/idp/ ./internal/clan/ ./internal/wireconvention/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The challenge route returns the challenge id, its expiry, the door's own sign-in address, the credential kind(s) asked for, the service's name (from the client that started the hop) and the community's name, and builds the deep link from exactly that payload": "internal/idp/appdoor.go handleChallenge + appChallengeDescriptor + buildAppDeepLink; proven by TestSeam_AppDoor_ChallengeDescribesTheAsk (parses the deep link back and matches every field door/c/s/svc/name; service = serviceDisplayName(client id), community = brand-kit name)",
    "The same payload sits behind the scannable code and the button; the code is served by its own route keyed on the challenge id": "internal/idp/appdoor.go handleCode (GET /login/app/code?c=<challengeID> re-serves the exact deep link); proven by TestSeam_AppDoor_CodeServesSamePayload (body == challenge deepLink; unknown id -> 404)",
    "The present route accepts the app's answer cross-origin (the app is not a browser page, but its web build is) and returns the verdict through the verifier": "internal/idp/appdoor.go handlePresent (JSON body -> keriVerify through the shared Verifier) + appDoorCORS + handlePresentPreflight; proven by TestSeam_AppDoor_PresentThenStatusVerified_MintsToken (verdict verified, Access-Control-Allow-Origin present) and TestSeam_AppDoor_PresentPreflightAllowsCrossOrigin (OPTIONS 204 + CORS)",
    "The status route, keyed on the challenge id, reports waiting, verified, refused-with-kind or expired; on verified it completes the authorization request so the page can redirect": "internal/idp/appdoor.go handleStatus (completeLogin + setSessionCookie once, returns op callback URL on verified); proven by TestSeam_AppDoor_PresentThenStatusVerified_MintsToken (status verified + redirect -> follow -> code -> token) and TestSeam_AppDoor_RefusalKindsSurfacedOnStatus (refused + kind, no redirect)",
    "A challenge expires after two minutes; a fresh one can be minted on the same authorization request without restarting the hop": "appChallengeTTL = 2*time.Minute; proven by TestSeam_AppDoor_ExpiresAndFreshMintedSameRequest (expiry == mint+2m; after 2m+1s status expired; re-mint on the SAME authRequestID yields a fresh waiting challenge) using the test-only Config.Clock",
    "Challenges are single-use: a consumed or expired challenge is refused": "handlePresent consumed/expiry guards + markVerified/markRefused set consumed; proven by TestSeam_AppDoor_ChallengeIsSingleUse (second present refused) and TestSeam_AppDoor_ExpiredChallengeRefusesPresent (expired present not verified)",
    "Proven at the bridge seam: present -> token, and each refusal kind surfaced on the status route": "TestSeam_AppDoor_PresentThenStatusVerified_MintsToken drives present -> status verified -> op callback -> auth code -> token exchange (id_token sub == presenter AID); TestSeam_AppDoor_RefusalKindsSurfacedOnStatus covers no-membership / revoked / records-unreachable / signature on the status route"
  },
  "summary": "Built the wallet sign-in app door's three routes (challenge/present/status) plus the code route in internal/idp, proven present->token and every refusal kind at the existing OIDC-over-HTTP bridge seam.",
  "blockers": []
}
**close-report** for #1525 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1525, "status": "success", "commits": [ "37d86f62de8189e499aa3f22d060d5850c24cd0c" ], "changed_files": [ "STATUS.md", "internal/idp/appdoor.go", "internal/idp/appdoor_seam_test.go", "internal/idp/config.go", "internal/idp/fake_verifier_test.go", "internal/idp/provider.go", "internal/idp/signin.go" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/idp/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/idp/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/idp/ ./internal/clan/ ./internal/wireconvention/", "exit_code": 0 } ], "criteria": { "The challenge route returns the challenge id, its expiry, the door's own sign-in address, the credential kind(s) asked for, the service's name (from the client that started the hop) and the community's name, and builds the deep link from exactly that payload": "internal/idp/appdoor.go handleChallenge + appChallengeDescriptor + buildAppDeepLink; proven by TestSeam_AppDoor_ChallengeDescribesTheAsk (parses the deep link back and matches every field door/c/s/svc/name; service = serviceDisplayName(client id), community = brand-kit name)", "The same payload sits behind the scannable code and the button; the code is served by its own route keyed on the challenge id": "internal/idp/appdoor.go handleCode (GET /login/app/code?c=<challengeID> re-serves the exact deep link); proven by TestSeam_AppDoor_CodeServesSamePayload (body == challenge deepLink; unknown id -> 404)", "The present route accepts the app's answer cross-origin (the app is not a browser page, but its web build is) and returns the verdict through the verifier": "internal/idp/appdoor.go handlePresent (JSON body -> keriVerify through the shared Verifier) + appDoorCORS + handlePresentPreflight; proven by TestSeam_AppDoor_PresentThenStatusVerified_MintsToken (verdict verified, Access-Control-Allow-Origin present) and TestSeam_AppDoor_PresentPreflightAllowsCrossOrigin (OPTIONS 204 + CORS)", "The status route, keyed on the challenge id, reports waiting, verified, refused-with-kind or expired; on verified it completes the authorization request so the page can redirect": "internal/idp/appdoor.go handleStatus (completeLogin + setSessionCookie once, returns op callback URL on verified); proven by TestSeam_AppDoor_PresentThenStatusVerified_MintsToken (status verified + redirect -> follow -> code -> token) and TestSeam_AppDoor_RefusalKindsSurfacedOnStatus (refused + kind, no redirect)", "A challenge expires after two minutes; a fresh one can be minted on the same authorization request without restarting the hop": "appChallengeTTL = 2*time.Minute; proven by TestSeam_AppDoor_ExpiresAndFreshMintedSameRequest (expiry == mint+2m; after 2m+1s status expired; re-mint on the SAME authRequestID yields a fresh waiting challenge) using the test-only Config.Clock", "Challenges are single-use: a consumed or expired challenge is refused": "handlePresent consumed/expiry guards + markVerified/markRefused set consumed; proven by TestSeam_AppDoor_ChallengeIsSingleUse (second present refused) and TestSeam_AppDoor_ExpiredChallengeRefusesPresent (expired present not verified)", "Proven at the bridge seam: present -> token, and each refusal kind surfaced on the status route": "TestSeam_AppDoor_PresentThenStatusVerified_MintsToken drives present -> status verified -> op callback -> auth code -> token exchange (id_token sub == presenter AID); TestSeam_AppDoor_RefusalKindsSurfacedOnStatus covers no-membership / revoked / records-unreachable / signature on the status route" }, "summary": "Built the wallet sign-in app door's three routes (challenge/present/status) plus the code route in internal/idp, proven present->token and every refusal kind at the existing OIDC-over-HTTP bridge seam.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1525
No description provided.