sign-in S1: the door verifies a presented credential in Go against the community's own witnessed ledger #1523

Closed
opened 2026-09-16 03:14:48 +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/).

Stories 20–24 of the spec. 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

A community decides who may come in by reading its own witnessed ledger, not a list the gateway keeps.
When a member's app presents a credential, the door checks six things in order and fails closed on any of
them: the challenge is live, the signature was made over this door's address by the presenting identity,
the received bytes really are the credential they claim to be, the community's ledger says it was issued
and not revoked, the credential kind is one this community trusts, and the holder is the signer. Nothing
about the presentation is kept. Prototype #1301 proved this at about 150 ms warm; lift its verifier rather
than write a second one.

Acceptance criteria

  • The verifier moves from the spike into the KERI-auth package: stream framing by version string, SAID
    recompute (Blake3-256 with d blanked), the witnessed-ledger fetch with the /query → /oobi
    fallback, the seal walk over the anchoring events, the six checks with typed refusals, per-leg
    timing in the log
  • The bound message carries the door's own sign-in address, so a signature made over any other address
    is refused and no session is created
  • Both accepted presentation shapes verify — the trimmed two-message stream and the full stream —
    requiring exactly one credential and one issuance event
  • A credential whose ledger carries a revocation seal is refused, even when the presenting app's own
    copy still reads issued
  • An unreadable witness or unfetchable ledger is records-unreachable: refused, nothing cached, no
    session created
  • The trust list is configuration seeded at gateway seeding with the community identity's issuer (its
    OOBI preferred over a witness URL, so witness rotation needs no edit) and the two credential kinds
    this gateway issues; any other issuer or kind is refused as untrusted
  • The verdict records only the credential's SAID, kind, issuer and the claims the rule needs; the
    presented bytes are not stored and verdicts are never cached
  • The bridge's existing verifier port is kept, so today's sign-in path runs through the new verifier
  • Proven at the bridge seam with the spike's golden vectors and a test witness serving both an issued
    and a revoked ledger — no identity agent, container or network needed

Blocked by

Tracker: #1512

  • pairing T3 (the served 1.1 descriptor)

Task manifest

task: go-verifier-at-the-door
implements_flow: wallet-signin
seam: the bridge's OIDC-over-HTTP smoke tests + verifier unit tests over golden vectors
depends_on: [pairing:descriptor-1-1-served]
out_of_scope: [checking witness receipts in Go, multisig issuers, a cached-verdict grace window (ADR 0236 rejected it)]
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/`). Stories 20–24 of the spec. **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 A community decides who may come in by reading its **own** witnessed ledger, not a list the gateway keeps. When a member's app presents a credential, the door checks six things in order and fails closed on any of them: the challenge is live, the signature was made over *this* door's address by the presenting identity, the received bytes really are the credential they claim to be, the community's ledger says it was issued and not revoked, the credential kind is one this community trusts, and the holder is the signer. Nothing about the presentation is kept. Prototype #1301 proved this at about 150 ms warm; lift its verifier rather than write a second one. ## Acceptance criteria - [ ] The verifier moves from the spike into the KERI-auth package: stream framing by version string, SAID recompute (Blake3-256 with `d` blanked), the witnessed-ledger fetch with the `/query` → `/oobi` fallback, the seal walk over the anchoring events, the six checks with **typed refusals**, per-leg timing in the log - [ ] The bound message carries the door's own sign-in address, so a signature made over any other address is refused and no session is created - [ ] Both accepted presentation shapes verify — the trimmed two-message stream and the full stream — requiring exactly one credential and one issuance event - [ ] A credential whose ledger carries a revocation seal is refused, even when the presenting app's own copy still reads issued - [ ] An unreadable witness or unfetchable ledger is **records-unreachable**: refused, nothing cached, no session created - [ ] The trust list is configuration seeded at gateway seeding with the community identity's issuer (its OOBI preferred over a witness URL, so witness rotation needs no edit) and the two credential kinds this gateway issues; any other issuer or kind is refused as untrusted - [ ] The verdict records only the credential's SAID, kind, issuer and the claims the rule needs; the presented bytes are not stored and verdicts are never cached - [ ] The bridge's existing verifier port is kept, so today's sign-in path runs through the new verifier - [ ] Proven at the bridge seam with the spike's golden vectors and a test witness serving both an issued and a revoked ledger — no identity agent, container or network needed ## Blocked by Tracker: #1512 - pairing T3 (the served 1.1 descriptor) ## Task manifest ```yaml task: go-verifier-at-the-door implements_flow: wallet-signin seam: the bridge's OIDC-over-HTTP smoke tests + verifier unit tests over golden vectors depends_on: [pairing:descriptor-1-1-served] out_of_scope: [checking witness receipts in Go, multisig issuers, a cached-verdict grace window (ADR 0236 rejected it)] needs_human_decision: [] ```

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

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

close-report for #1523 — status success

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

envelope
{
  "issue": 1523,
  "status": "success",
  "commits": [
    "30e3ec91"
  ],
  "changed_files": [
    "STATUS.md",
    "go.mod",
    "internal/idp/bind.go",
    "internal/idp/config.go",
    "internal/idp/ledger_verifier.go",
    "internal/idp/ledger_verifier_seam_test.go",
    "internal/idp/signin.go",
    "internal/keriauth/ledger.go",
    "internal/keriauth/said.go",
    "internal/keriauth/stream.go",
    "internal/keriauth/testdata/issuer-oobi.cesr",
    "internal/keriauth/testdata/presentation.cesr",
    "internal/keriauth/testdata/vectors.json",
    "internal/keriauth/verifier.go",
    "internal/keriauth/verifier_golden_test.go",
    "internal/keriauth/verifier_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go build ./... (pre-push gate)",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command golangci-lint run ./... (pre-push gate)",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/keriauth/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/idp/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/... ./control-plane/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "verifier moves into keriauth (framing, SAID recompute, /query->/oobi fetch, seal walk, six checks with typed refusals, per-leg timing logged)": "internal/keriauth/{stream.go,said.go,ledger.go,verifier.go}; DoorVerifier.VerifyChallenge/VerifyPresentation log legs_ms; golden-vector tests in verifier_golden_test.go",
    "bound message carries the door's own sign-in address; a signature over any other address is refused and no session created": "keriauth.BoundSignedMessage + DoorVerifier.VerifyChallenge; TestVerify_SignatureOverAnotherDoorRefused (keriauth); no verdict returned so completeLogin never runs",
    "both presentation shapes verify (trimmed two-message and full), exactly one credential and one issuance event": "splitPresentation in verifier.go; TestVerify_AcceptsBothPresentationShapes asserts equal verdicts for w.trimmed() and w.full()",
    "a credential whose ledger carries a revocation seal is refused even when the app's copy reads issued": "WalkSeals + DoorVerifier standing check; TestVerify_RevokedLedgerIsRefused (app copy unchanged, only witness revokes) + TestSeam_Ledger_RevokedCredentialRefused (403)",
    "unreadable witness/unfetchable ledger is records-unreachable: refused, nothing cached, no session": "ErrLedgerUnreachable -> idp.ErrRecordsUnreachable (503); TestVerify_LedgerUnreachableIsRecordsUnreachable + TestSeam_Ledger_UnreachableRecordsRefused; Presentation returns err so no completeLogin",
    "trust list config-seeded with community issuer (OOBI preferred over witness) and the two credential kinds; other issuer/kind refused untrusted": "Config.TrustRows (config.go) seeds issuer+OOBI/witness + credschema.Membership/Committee SAIDs; TrustRow.ledger() prefers OOBI; TestVerify_UntrustedIssuerRefused + TestVerify_UntrustedSchemaRefused",
    "verdict records only SAID/kind/issuer + needed claims; presented bytes not stored, verdicts never cached": "keriauth.Verdict + identityFromVerdict; TestVerify_AcceptsBothPresentationShapes asserts no raw d/i in claims; no cache field anywhere",
    "the bridge's existing verifier port is kept, so today's sign-in path runs through the new verifier": "idp.LedgerVerifier implements idp.Verifier (compile-time var _ assertion in ledger_verifier.go); BindVerifier binds it; TestSeam_Ledger_IssuedMemberMintsToken drives the real bridge OIDC flow through it",
    "proven at the bridge seam with the spike's golden vectors and a test witness serving both an issued and a revoked ledger; no identity agent/container/network": "keriauth testdata golden vectors + httptest witness in verifier_test.go and ledger_verifier_seam_test.go; all tests offline"
  },
  "summary": "Lifted prototype #1301's Go door verifier into internal/keriauth and bound it behind the bridge's existing idp.Verifier port as LedgerVerifier, so sign-in verifies a presented credential against the community's own witnessed ledger.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1523 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1523, "status": "success", "commits": [ "30e3ec91" ], "changed_files": [ "STATUS.md", "go.mod", "internal/idp/bind.go", "internal/idp/config.go", "internal/idp/ledger_verifier.go", "internal/idp/ledger_verifier_seam_test.go", "internal/idp/signin.go", "internal/keriauth/ledger.go", "internal/keriauth/said.go", "internal/keriauth/stream.go", "internal/keriauth/testdata/issuer-oobi.cesr", "internal/keriauth/testdata/presentation.cesr", "internal/keriauth/testdata/vectors.json", "internal/keriauth/verifier.go", "internal/keriauth/verifier_golden_test.go", "internal/keriauth/verifier_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go build ./... (pre-push gate)", "exit_code": 0 }, { "command": "nix develop .#go-ci --command golangci-lint run ./... (pre-push gate)", "exit_code": 0 }, { "command": "go test ./internal/keriauth/", "exit_code": 0 }, { "command": "go test ./internal/idp/", "exit_code": 0 }, { "command": "go test ./internal/... ./control-plane/...", "exit_code": 0 } ], "criteria": { "verifier moves into keriauth (framing, SAID recompute, /query->/oobi fetch, seal walk, six checks with typed refusals, per-leg timing logged)": "internal/keriauth/{stream.go,said.go,ledger.go,verifier.go}; DoorVerifier.VerifyChallenge/VerifyPresentation log legs_ms; golden-vector tests in verifier_golden_test.go", "bound message carries the door's own sign-in address; a signature over any other address is refused and no session created": "keriauth.BoundSignedMessage + DoorVerifier.VerifyChallenge; TestVerify_SignatureOverAnotherDoorRefused (keriauth); no verdict returned so completeLogin never runs", "both presentation shapes verify (trimmed two-message and full), exactly one credential and one issuance event": "splitPresentation in verifier.go; TestVerify_AcceptsBothPresentationShapes asserts equal verdicts for w.trimmed() and w.full()", "a credential whose ledger carries a revocation seal is refused even when the app's copy reads issued": "WalkSeals + DoorVerifier standing check; TestVerify_RevokedLedgerIsRefused (app copy unchanged, only witness revokes) + TestSeam_Ledger_RevokedCredentialRefused (403)", "unreadable witness/unfetchable ledger is records-unreachable: refused, nothing cached, no session": "ErrLedgerUnreachable -> idp.ErrRecordsUnreachable (503); TestVerify_LedgerUnreachableIsRecordsUnreachable + TestSeam_Ledger_UnreachableRecordsRefused; Presentation returns err so no completeLogin", "trust list config-seeded with community issuer (OOBI preferred over witness) and the two credential kinds; other issuer/kind refused untrusted": "Config.TrustRows (config.go) seeds issuer+OOBI/witness + credschema.Membership/Committee SAIDs; TrustRow.ledger() prefers OOBI; TestVerify_UntrustedIssuerRefused + TestVerify_UntrustedSchemaRefused", "verdict records only SAID/kind/issuer + needed claims; presented bytes not stored, verdicts never cached": "keriauth.Verdict + identityFromVerdict; TestVerify_AcceptsBothPresentationShapes asserts no raw d/i in claims; no cache field anywhere", "the bridge's existing verifier port is kept, so today's sign-in path runs through the new verifier": "idp.LedgerVerifier implements idp.Verifier (compile-time var _ assertion in ledger_verifier.go); BindVerifier binds it; TestSeam_Ledger_IssuedMemberMintsToken drives the real bridge OIDC flow through it", "proven at the bridge seam with the spike's golden vectors and a test witness serving both an issued and a revoked ledger; no identity agent/container/network": "keriauth testdata golden vectors + httptest witness in verifier_test.go and ledger_verifier_seam_test.go; all tests offline" }, "summary": "Lifted prototype #1301's Go door verifier into internal/keriauth and bound it behind the bridge's existing idp.Verifier port as LedgerVerifier, so sign-in verifies a presented credential against the community's own witnessed ledger.", "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.

Reference
Matou/idss#1523
No description provided.