pairing T11b: the space-ID door takes a steward's presented credential — the wallet's fallback post needs no browser session (ADR 0226, 2026-09-18 ruling) #1608

Closed
opened 2026-09-18 21:21:52 +00:00 by ben · 5 comments
Owner

Parent

Spec #1495 (community app pairing). Program map #1293 (the community wallet). Design contract: ADR 0226 — the spaces amendment (2026-09-15) and its new section "How the fallback's wallet proves it is a steward" (2026-09-18, Ben's ruling); ADR 0236 (the door verifies a presented credential in Go).

Follows #1520 (the space-ID door) and reuses #1523 (the Go verifier, internal/keriauth.DoorVerifier). Unblocks matou-app #534 (the first-steward fallback).

Why

#1520 gated POST /api/v1/idip/spaces on the community SSO session — the idss_session cookie a browser holds after signing in at the front door. The caller this door exists for is a wallet app, which has no browser session and no way to get one. ADR 0226 said the wallet posts "over its existing steward authentication"; none existed. Ben ruled (2026-09-18): the wallet presents its steward credential with the post — the founder has held a Membership credential with role: operator since founding, it reaches the app when they bring their identity in with their twelve words (DDR 0230 §4), and the gateway already has the verifier.

What to build

The space-ID door accepts a second proof beside the browser session: a presented credential, verified on the spot, nothing remembered.

  1. A challenge route on the door. GET <api_url>/spaces/challenge mints a single-use, two-minute challenge (the app door's rule, DDR 0246 §6) and answers the challenge id, its expiry and the door address the wallet must sign over — <api_url>/spaces, so a signature made for the sign-in site is worthless here and one made here is worthless there (ADR 0236 §5's binding, a separate DoorURL).
  2. The post carries the proof. POST <api_url>/spaces takes the three IDs (unchanged snake_case keys) plus an optional proof object — {aid, challenge_id, response, presentation}, exactly the four fields the app door's present route takes (internal/idp/appdoor.go), presentation being the bare credential CESR stream. When proof is present the door runs keriauth.DoorVerifier.Verify over it, requires the verified claims to carry role: operator, and then asks the same roster check every steward route asks (OperatorCheck.IsOperator on the verified AID) — so a suspended or removed steward is refused the moment the roster says so, not when a ledger read next notices.
  3. The browser session still works. A request with no proof is gated exactly as today (#1520's tests stand unchanged). Neither proof → 401.
  4. Nothing is remembered. No session is minted, no cookie set, no copy of the credential kept (ADR 0236 §6). The log names the AID and the credential SAID, never the presentation bytes.
  5. Fail closed. Ledger unreachable → the post is refused with the verifier's own sentence (the community's records can't be reached right now — try again shortly) and nothing is recorded.
  6. A golden fixture matou-app copies. The challenge response, the post body with proof, the 204, the 409 (#1520's body, unchanged) and each refusal are pinned in one golden file under internal/controlapi/testdata/, the same way the descriptor goldens are shared — matou-app #534 tests against a copy, so neither side guesses.

Acceptance criteria

  • GET <api_url>/spaces/challenge answers a fresh single-use challenge naming the door address to sign over; a challenge older than two minutes, or already spent (verified or refused), is refused
  • A post whose proof verifies, whose credential carries role: operator, and whose AID the roster holds as a live operator records the three IDs — 204, and the descriptor writer names them in anysync on its next reconcile (#1520's path, unchanged)
  • A verified member credential (role: member) is refused 403 and records nothing
  • A verified operator credential whose AID the roster no longer holds as a live operator is refused 403 and records nothing
  • A signature made over any other door address (the sign-in site's included) is refused; a revoked, tampered, untrusted-issuer or somebody-else's credential is refused with the verifier's own refusal, and records nothing
  • Ledger unreachable → refused, nothing recorded, no verdict cached
  • A request with a browser session and no proof behaves exactly as #1520 built it; a request with neither is 401
  • First write wins is unchanged: a second whole set is answered #1520's 409 naming the recorded set, whichever proof the caller used
  • No session, cookie or credential copy outlives the request; no token of any kind appears in a response or a log line
  • The door answers the cross-origin preflight for the post and the challenge the way the app door's present route does, so an app that posts from its web view is not refused by the browser layer
  • The golden fixture exists, the door's tests read it, and the OpenAPI document carries the challenge route and the proof object

Blocked by

Nothing open — #1520 and #1523 have landed.

Task manifest

task: space-id-door-presented-credential
depends_on: [idss:space-id-door, idss:signin-go-verifier]
out_of_scope: [minting a session for the wallet, a general signed-request scheme for the steward API, binding the three IDs into the signed bytes, the wallet's half (matou-app #534)]
needs_human_decision: []
## Parent Spec **#1495** (community app pairing). Program map **#1293** (the community wallet). Design contract: **ADR 0226** — the spaces amendment (2026-09-15) and its new section **"How the fallback's wallet proves it is a steward" (2026-09-18, Ben's ruling)**; **ADR 0236** (the door verifies a presented credential in Go). Follows **#1520** (the space-ID door) and reuses **#1523** (the Go verifier, `internal/keriauth.DoorVerifier`). Unblocks matou-app **#534** (the first-steward fallback). ## Why #1520 gated `POST /api/v1/idip/spaces` on the community SSO session — the `idss_session` cookie a browser holds after signing in at the front door. The caller this door exists for is a **wallet app**, which has no browser session and no way to get one. ADR 0226 said the wallet posts "over its existing steward authentication"; none existed. Ben ruled (2026-09-18): the wallet **presents its steward credential with the post** — the founder has held a Membership credential with `role: operator` since founding, it reaches the app when they bring their identity in with their twelve words (DDR 0230 §4), and the gateway already has the verifier. ## What to build The space-ID door accepts a second proof beside the browser session: a presented credential, verified on the spot, nothing remembered. 1. **A challenge route on the door.** `GET <api_url>/spaces/challenge` mints a single-use, two-minute challenge (the app door's rule, DDR 0246 §6) and answers the challenge id, its expiry and **the door address the wallet must sign over** — `<api_url>/spaces`, so a signature made for the sign-in site is worthless here and one made here is worthless there (ADR 0236 §5's binding, a separate `DoorURL`). 2. **The post carries the proof.** `POST <api_url>/spaces` takes the three IDs (unchanged snake_case keys) plus an optional `proof` object — `{aid, challenge_id, response, presentation}`, exactly the four fields the app door's present route takes (`internal/idp/appdoor.go`), `presentation` being the bare credential CESR stream. When `proof` is present the door runs `keriauth.DoorVerifier.Verify` over it, requires the verified claims to carry **`role: operator`**, and then asks the **same roster check** every steward route asks (`OperatorCheck.IsOperator` on the verified AID) — so a suspended or removed steward is refused the moment the roster says so, not when a ledger read next notices. 3. **The browser session still works.** A request with no `proof` is gated exactly as today (#1520's tests stand unchanged). Neither proof → 401. 4. **Nothing is remembered.** No session is minted, no cookie set, no copy of the credential kept (ADR 0236 §6). The log names the AID and the credential SAID, never the presentation bytes. 5. **Fail closed.** Ledger unreachable → the post is refused with the verifier's own sentence (*the community's records can't be reached right now — try again shortly*) and nothing is recorded. 6. **A golden fixture matou-app copies.** The challenge response, the post body with `proof`, the 204, the 409 (#1520's body, unchanged) and each refusal are pinned in one golden file under `internal/controlapi/testdata/`, the same way the descriptor goldens are shared — matou-app #534 tests against a copy, so neither side guesses. ## Acceptance criteria - [ ] `GET <api_url>/spaces/challenge` answers a fresh single-use challenge naming the door address to sign over; a challenge older than two minutes, or already spent (verified **or** refused), is refused - [ ] A post whose `proof` verifies, whose credential carries `role: operator`, and whose AID the roster holds as a live operator records the three IDs — 204, and the descriptor writer names them in `anysync` on its next reconcile (#1520's path, unchanged) - [ ] A verified **member** credential (`role: member`) is refused 403 and records nothing - [ ] A verified operator credential whose AID the roster no longer holds as a live operator is refused 403 and records nothing - [ ] A signature made over any other door address (the sign-in site's included) is refused; a revoked, tampered, untrusted-issuer or somebody-else's credential is refused with the verifier's own refusal, and records nothing - [ ] Ledger unreachable → refused, nothing recorded, no verdict cached - [ ] A request with a browser session and no `proof` behaves exactly as #1520 built it; a request with neither is 401 - [ ] First write wins is unchanged: a second whole set is answered #1520's 409 naming the recorded set, whichever proof the caller used - [ ] No session, cookie or credential copy outlives the request; no token of any kind appears in a response or a log line - [ ] The door answers the cross-origin preflight for the post and the challenge the way the app door's present route does, so an app that posts from its web view is not refused by the browser layer - [ ] The golden fixture exists, the door's tests read it, and the OpenAPI document carries the challenge route and the `proof` object ## Blocked by Nothing open — #1520 and #1523 have landed. ## Task manifest ```yaml task: space-id-door-presented-credential depends_on: [idss:space-id-door, idss:signin-go-verifier] out_of_scope: [minting a session for the wallet, a general signed-request scheme for the steward API, binding the three IDs into the signed bytes, the wallet's half (matou-app #534)] needs_human_decision: [] ```

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

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

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

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

swarm-claim host=elitebook-distributed-server-03 run=26693
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=26693 (automated multi-host claim — lowest live claim id works this ticket)

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

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

close-report for #1608 — status success

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

envelope
{
  "issue": 1608,
  "status": "success",
  "commits": [
    "64d2fd57c4e9457e0c66d5a35f77669ba21a6440"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "dashboard/src/lib/api/generated.ts",
    "internal/controlapi/spaces.go",
    "internal/controlapi/spaces_golden_test.go",
    "internal/controlapi/spaces_integration_test.go",
    "internal/controlapi/spaces_proof_integration_test.go",
    "internal/controlapi/testdata/spaces-door-golden.json",
    "internal/keriauth/verifier.go",
    "packages/openapi-spec/openapi.yaml"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi/ ./internal/keriauth/ ./internal/idp/ ./internal/spaces/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/controlapi/ ./internal/keriauth/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/controlapi/... ./internal/keriauth/... control-plane/cmd/control-plane/...",
      "exit_code": 0
    },
    {
      "command": "node scripts/generate-client.mjs --check (packages/openapi-spec)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "GET /spaces/challenge answers a fresh single-use challenge naming the door address; older-than-two-minutes or already-spent (verified or refused) refused": "handleChallenge in internal/controlapi/spaces.go mints via keriauth.DoorVerifier.NewChallenge (single-use, DefaultChallengeTTL=2min store) and returns SpacesChallenge{challenge_id, expires_at, door=DoorAddress()}; TestSpacesProof_ChallengeNamesTheDoor + TestSpacesProof_SpentChallengeRefused (spent-verified and expired both 403)",
    "A verified role:operator proof whose AID the roster holds records the three IDs (204) and the descriptor writer names them": "proofAuthed then record() in spaces.go; TestSpacesProof_VerifiedOperatorRecords (204, store holds set, writer names them in anysync)",
    "A verified member (role:member) refused 403, records nothing": "proofAuthed role check → 403 not_operator; TestSpacesProof_VerifiedMemberRefused",
    "A verified operator whose AID the roster no longer holds refused 403, records nothing": "proofAuthed OperatorCheck.IsOperator false → 403 not_operator; TestSpacesProof_OperatorOffRosterRefused",
    "A signature over any other door address, or a revoked/tampered/untrusted-issuer/somebody-else's credential refused with the verifier's own sentence, records nothing": "proofAuthed maps every keriauth refusal → 403 credential_rejected with err.Error(); TestSpacesProof_BadCredentialRefused (ErrChallenge/ErrRevoked/ErrTampered/ErrUntrusted/ErrNotHolder)",
    "Ledger unreachable → refused, nothing recorded, no verdict cached": "proofAuthed maps keriauth.ErrLedgerUnreachable → 503 records_unreachable; TestSpacesProof_LedgerUnreachableFailsClosed",
    "A request with a browser session and no proof behaves exactly as #1520; neither is 401": "handlePost branches to operatorAuthed when no proof; #1520 TestSpacesDoor_* unchanged and green; TestSpacesProof_NoProofNoSessionIsUnauthorized (401)",
    "First write wins unchanged: second whole set answered #1520's 409 naming the recorded set whichever proof": "record() unchanged; TestSpacesProof_FirstWriteWinsWhicheverProof (browser records, proof gets 409)",
    "No session/cookie/credential copy outlives the request; no token in a response or log line": "proof path sets no cookie, mints no session, keeps no copy; log names AID+SAID only; TestSpacesProof_NoTokenInResponsesOrLog (no cookies, presentation bytes absent from door log)",
    "The door answers the cross-origin preflight for the post and the challenge like the app door's present route": "handlePreflight + spacesCORS on both routes; TestSpacesProof_Preflight (OPTIONS 204 + Access-Control-Allow-Origin: * for both paths)",
    "The golden fixture exists, the door's tests read it, and the OpenAPI document carries the challenge route and the proof object": "internal/controlapi/testdata/spaces-door-golden.json + TestSpacesGolden_DoorMatchesTheFixture drives the door to match every pinned shape; openapi.yaml adds /idip/spaces/challenge, /idip/spaces with SpacesRequest.proof, SpacesProof/SpacesChallenge/SpacesConflict schemas (generated client in sync)"
  },
  "summary": "The community space-ID door now takes a first steward's presented steward credential (challenge over its own address + role:operator + roster check, nothing remembered, fail closed) beside #1520's browser session, with a golden fixture matou-app #534 copies and OpenAPI carrying the new surface.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1608 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1608, "status": "success", "commits": [ "64d2fd57c4e9457e0c66d5a35f77669ba21a6440" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "dashboard/src/lib/api/generated.ts", "internal/controlapi/spaces.go", "internal/controlapi/spaces_golden_test.go", "internal/controlapi/spaces_integration_test.go", "internal/controlapi/spaces_proof_integration_test.go", "internal/controlapi/testdata/spaces-door-golden.json", "internal/keriauth/verifier.go", "packages/openapi-spec/openapi.yaml" ], "tests": [ { "command": "go test ./internal/controlapi/ ./internal/keriauth/ ./internal/idp/ ./internal/spaces/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/controlapi/ ./internal/keriauth/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "golangci-lint run ./internal/controlapi/... ./internal/keriauth/... control-plane/cmd/control-plane/...", "exit_code": 0 }, { "command": "node scripts/generate-client.mjs --check (packages/openapi-spec)", "exit_code": 0 } ], "criteria": { "GET /spaces/challenge answers a fresh single-use challenge naming the door address; older-than-two-minutes or already-spent (verified or refused) refused": "handleChallenge in internal/controlapi/spaces.go mints via keriauth.DoorVerifier.NewChallenge (single-use, DefaultChallengeTTL=2min store) and returns SpacesChallenge{challenge_id, expires_at, door=DoorAddress()}; TestSpacesProof_ChallengeNamesTheDoor + TestSpacesProof_SpentChallengeRefused (spent-verified and expired both 403)", "A verified role:operator proof whose AID the roster holds records the three IDs (204) and the descriptor writer names them": "proofAuthed then record() in spaces.go; TestSpacesProof_VerifiedOperatorRecords (204, store holds set, writer names them in anysync)", "A verified member (role:member) refused 403, records nothing": "proofAuthed role check → 403 not_operator; TestSpacesProof_VerifiedMemberRefused", "A verified operator whose AID the roster no longer holds refused 403, records nothing": "proofAuthed OperatorCheck.IsOperator false → 403 not_operator; TestSpacesProof_OperatorOffRosterRefused", "A signature over any other door address, or a revoked/tampered/untrusted-issuer/somebody-else's credential refused with the verifier's own sentence, records nothing": "proofAuthed maps every keriauth refusal → 403 credential_rejected with err.Error(); TestSpacesProof_BadCredentialRefused (ErrChallenge/ErrRevoked/ErrTampered/ErrUntrusted/ErrNotHolder)", "Ledger unreachable → refused, nothing recorded, no verdict cached": "proofAuthed maps keriauth.ErrLedgerUnreachable → 503 records_unreachable; TestSpacesProof_LedgerUnreachableFailsClosed", "A request with a browser session and no proof behaves exactly as #1520; neither is 401": "handlePost branches to operatorAuthed when no proof; #1520 TestSpacesDoor_* unchanged and green; TestSpacesProof_NoProofNoSessionIsUnauthorized (401)", "First write wins unchanged: second whole set answered #1520's 409 naming the recorded set whichever proof": "record() unchanged; TestSpacesProof_FirstWriteWinsWhicheverProof (browser records, proof gets 409)", "No session/cookie/credential copy outlives the request; no token in a response or log line": "proof path sets no cookie, mints no session, keeps no copy; log names AID+SAID only; TestSpacesProof_NoTokenInResponsesOrLog (no cookies, presentation bytes absent from door log)", "The door answers the cross-origin preflight for the post and the challenge like the app door's present route": "handlePreflight + spacesCORS on both routes; TestSpacesProof_Preflight (OPTIONS 204 + Access-Control-Allow-Origin: * for both paths)", "The golden fixture exists, the door's tests read it, and the OpenAPI document carries the challenge route and the proof object": "internal/controlapi/testdata/spaces-door-golden.json + TestSpacesGolden_DoorMatchesTheFixture drives the door to match every pinned shape; openapi.yaml adds /idip/spaces/challenge, /idip/spaces with SpacesRequest.proof, SpacesProof/SpacesChallenge/SpacesConflict schemas (generated client in sync)" }, "summary": "The community space-ID door now takes a first steward's presented steward credential (challenge over its own address + role:operator + roster check, nothing remembered, fail closed) beside #1520's browser session, with a golden fixture matou-app #534 copies and OpenAPI carrying the new surface.", "reason": "", "blockers": [], "no_code_change": "" } ``` </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.

Blocks
You do not have permission to read 1 dependency
Reference
Matou/idss#1608
No description provided.