idp: a refused sign-in logs why — the bridge is silent on signature, spent and unknown-code refusals #1962

Closed
opened 2026-09-28 14:52:04 +00:00 by ben · 2 comments
Owner

What to build

When the app door refuses a presentation, the bridge logs nothing about why. On whakatohea-demo (2026-09-28 06:00:58 UTC) a steward's sign-in was refused as signature, and the only log line was keriauth: challenge legs. From the server side it was impossible to tell a wrong key from a wrong signed message, an expired code, or a spent one.

Log one line per refused presentation at the app door and the words door: the AID, the challenge id, the refusal kind, and the verifier's own reason (unknown or expired challenge, that challenge was already used, key state unavailable, signature mismatch). For a signature mismatch also log the key-event sequence number the bridge verified against, so a rotation the gateway has not seen is visible. Never log the signature, the presentation, or a sealed passcode.

Acceptance criteria

  • A refused presentation logs one line with AID, challenge id, refusal kind and reason (seam test on the log output)
  • A spent (409) and an unknown (404) challenge log too
  • A signature mismatch names the key-event sequence number verified against
  • No secret material appears in any of these lines (test)

Blocked by

None — can start immediately

## What to build When the app door refuses a presentation, the bridge logs nothing about why. On whakatohea-demo (2026-09-28 06:00:58 UTC) a steward's sign-in was refused as `signature`, and the only log line was `keriauth: challenge legs`. From the server side it was impossible to tell a wrong key from a wrong signed message, an expired code, or a spent one. Log one line per refused presentation at the app door and the words door: the AID, the challenge id, the refusal kind, and the verifier's own reason (`unknown or expired challenge`, `that challenge was already used`, `key state unavailable`, signature mismatch). For a signature mismatch also log the key-event sequence number the bridge verified against, so a rotation the gateway has not seen is visible. Never log the signature, the presentation, or a sealed passcode. ## Acceptance criteria - [ ] A refused presentation logs one line with AID, challenge id, refusal kind and reason (seam test on the log output) - [ ] A spent (`409`) and an unknown (`404`) challenge log too - [ ] A signature mismatch names the key-event sequence number verified against - [ ] No secret material appears in any of these lines (test) ## Blocked by None — can start immediately

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

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

close-report for #1962 — status success

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

⚠️ mirror_waiver: internal/idp/appdoor.go is a mirrors.tsv trigger for internal/idp/testdata/app-door-golden.json, but this change is logging-only: it adds logRefusedSignin() calls in handlePresent's refusal branches and changes no wire/JSON response shape (appVerdict/appStatus/appChallengeDescriptor bytes are untouched), so the golden wire fixture is unchanged.

envelope
{
  "issue": 1962,
  "status": "success",
  "commits": [
    "fe7c308f"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/idp/appdoor.go",
    "internal/idp/fake_verifier_test.go",
    "internal/idp/keri_verifier.go",
    "internal/idp/provider.go",
    "internal/idp/refusallog.go",
    "internal/idp/refusallog_seam_test.go",
    "internal/idp/signin.go",
    "internal/keriauth/kel.go",
    "internal/keriauth/keystate.go",
    "internal/keriauth/verifier.go",
    "internal/keriauth/verifier_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command golangci-lint run ./internal/keriauth/... ./internal/idp/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command gofmt -l internal/keriauth internal/idp",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A refused presentation logs one line with AID, challenge id, refusal kind and reason (seam test on the log output)": "internal/idp/refusallog.go (logRefusedSignin) called from appdoor.go handlePresent and signin.go handleVerify; proven by TestSeam_AppDoor_RefusedPresentationLogsWhy and TestSeam_WordsDoor_RefusedPresentationLogsWhy in internal/idp/refusallog_seam_test.go (asserts door/aid/challenge_id/refusal/reason on the captured slog line)",
    "A spent (409) and an unknown (404) challenge log too": "appdoor.go handlePresent logs the 404 unknown and 409 spent pre-verifier guards; proven by TestSeam_AppDoor_SpentAndUnknownChallengeLog",
    "A signature mismatch names the key-event sequence number verified against": "keriauth DoorVerifier.VerifyChallenge (verifier.go) and idp KeriVerifier (keri_verifier.go) name the seq via keriauth.SeqOf / KeySeqResolver (keystate.go, KeyState.Seq in kel.go); proven by keriauth TestVerify_SignatureRefusalNamesKeyEventSeq and the seq assertion in TestSeam_AppDoor_RefusedPresentationLogsWhy",
    "No secret material appears in any of these lines (test)": "logRefusedSignin logs only aid/challenge_id/refusal/reason — never the signature/response, presented bytes or sealed passcode; TestSeam_AppDoor_RefusedPresentationLogsWhy asserts the secret response and presentation strings never appear in the log buffer"
  },
  "mirror_waiver": "internal/idp/appdoor.go is a mirrors.tsv trigger for internal/idp/testdata/app-door-golden.json, but this change is logging-only: it adds logRefusedSignin() calls in handlePresent's refusal branches and changes no wire/JSON response shape (appVerdict/appStatus/appChallengeDescriptor bytes are untouched), so the golden wire fixture is unchanged.",
  "summary": "The app door and words door now log one line per refused presentation naming AID, challenge id, refusal kind, the verifier's reason and (on a signature mismatch) the key-event seq, with no secret material.",
  "blockers": []
}
**close-report** for #1962 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. > :warning: **mirror_waiver:** internal/idp/appdoor.go is a mirrors.tsv trigger for internal/idp/testdata/app-door-golden.json, but this change is logging-only: it adds logRefusedSignin() calls in handlePresent's refusal branches and changes no wire/JSON response shape (appVerdict/appStatus/appChallengeDescriptor bytes are untouched), so the golden wire fixture is unchanged. <details><summary>envelope</summary> ```json { "issue": 1962, "status": "success", "commits": [ "fe7c308f" ], "changed_files": [ "STATUS.md", "internal/idp/appdoor.go", "internal/idp/fake_verifier_test.go", "internal/idp/keri_verifier.go", "internal/idp/provider.go", "internal/idp/refusallog.go", "internal/idp/refusallog_seam_test.go", "internal/idp/signin.go", "internal/keriauth/kel.go", "internal/keriauth/keystate.go", "internal/keriauth/verifier.go", "internal/keriauth/verifier_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci --command golangci-lint run ./internal/keriauth/... ./internal/idp/...", "exit_code": 0 }, { "command": "nix develop .#go-ci --command gofmt -l internal/keriauth internal/idp", "exit_code": 0 } ], "criteria": { "A refused presentation logs one line with AID, challenge id, refusal kind and reason (seam test on the log output)": "internal/idp/refusallog.go (logRefusedSignin) called from appdoor.go handlePresent and signin.go handleVerify; proven by TestSeam_AppDoor_RefusedPresentationLogsWhy and TestSeam_WordsDoor_RefusedPresentationLogsWhy in internal/idp/refusallog_seam_test.go (asserts door/aid/challenge_id/refusal/reason on the captured slog line)", "A spent (409) and an unknown (404) challenge log too": "appdoor.go handlePresent logs the 404 unknown and 409 spent pre-verifier guards; proven by TestSeam_AppDoor_SpentAndUnknownChallengeLog", "A signature mismatch names the key-event sequence number verified against": "keriauth DoorVerifier.VerifyChallenge (verifier.go) and idp KeriVerifier (keri_verifier.go) name the seq via keriauth.SeqOf / KeySeqResolver (keystate.go, KeyState.Seq in kel.go); proven by keriauth TestVerify_SignatureRefusalNamesKeyEventSeq and the seq assertion in TestSeam_AppDoor_RefusedPresentationLogsWhy", "No secret material appears in any of these lines (test)": "logRefusedSignin logs only aid/challenge_id/refusal/reason — never the signature/response, presented bytes or sealed passcode; TestSeam_AppDoor_RefusedPresentationLogsWhy asserts the secret response and presentation strings never appear in the log buffer" }, "mirror_waiver": "internal/idp/appdoor.go is a mirrors.tsv trigger for internal/idp/testdata/app-door-golden.json, but this change is logging-only: it adds logRefusedSignin() calls in handlePresent's refusal branches and changes no wire/JSON response shape (appVerdict/appStatus/appChallengeDescriptor bytes are untouched), so the golden wire fixture is unchanged.", "summary": "The app door and words door now log one line per refused presentation naming AID, challenge id, refusal kind, the verifier's reason and (on a signature mismatch) the key-event seq, with no secret material.", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1962
No description provided.