Skip to content

feat: add typed atomic JWT replay consumption - #132

Open
greg6775 wants to merge 1 commit into
luikyv:mainfrom
dev-null-GmbH:codex/typed-jti-assertion-policy
Open

greg6775 wants to merge 1 commit into
luikyv:mainfrom
dev-null-GmbH:codex/typed-jti-assertion-policy

Conversation

@greg6775

@greg6775 greg6775 commented Aug 2, 2026 •

Copy link
Copy Markdown

Summary

Add a typed, atomic JWT replay-consumption callback carrying the JTI, issuer, protocol purpose, and exact acceptance expiry. Client assertions, DPoP proofs, JAR, CIBA request objects, and attestation PoP reserve their identifiers after signature and JWT-claim validation. The callback implementation supplies the shared atomic store.

goidc.ErrJTIReplay distinguishes a replay from an operational store failure; typed store failures fail closed as internal_error. Preserve the legacy callback while rejecting dual configuration. Also add a post-verification private_key_jwt policy hook with a bounded JOSE header view and close the sub-second DPoP replay-expiry gap.

PR #134 builds on this contract and integrates nonce validation before JTI reservation. Merge this PR before #134.

Verification

Rechecked the unchanged head 915db0b locally on 2026-10-08 with Go 1.27.2:

  • go test ./...
  • go test -race ./internal/client ./internal/dpop ./internal/authorize ./internal/oidc ./pkg/provider
  • git diff --check

Coverage includes private_key_jwt, client_secret_jwt, JAR including zero-expiry reservations, CIBA request objects, DPoP, and attestation PoP. The integrated #134 branch additionally passes the full race suite.

Upstream CI and conformance runs need maintainer approval; the original workflow runs expired before approval. A real shared replay-store deployment was not exercised by these library tests.

Integration check on 2026-10-08: the current heads of #131–#134 merge without conflicts, and go test ./... passes on their combined tree (c46e03f8823665c0387d317dc9990d1f54095272).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant