Expand description
JWT verification via JWKS with TTL cache + bounded kid-miss refresh.
Mirrors src/crypto/jwt.rs (RS256, exp/iat/type, kid header), the
ValidationPolicy surface from crate::policy, and the RFC 9068 §2.1
at+jwt JOSE typ check auth_service mints on every access token (WP-03b).
MultiIssuerVerifier (R-21.2) is the engine: an explicit issuer
allow-list is checked against the token’s iss BEFORE any JWKS fetch,
every listed issuer has its own JWKS cache, the verification algorithm
comes from the key (never the token header), and a kid miss triggers one
refresh that is rate-limited per issuer, so a flood of unknown kids (or of
tokens from unlisted issuers) cannot drive unbounded fetches. Verifier
is the single-issuer wrapper over it and keeps the original API.
Structs§
- Claims
- Current
User - Verified identity from an access token.
- Issuer
Config - One allow-listed issuer.
jwks_urioverrides the default<issuer>/.well-known/jwks.json(set it from discovery). - Logout
Token Options - What
MultiIssuerVerifier::verify_logout_tokenneeds besides the token. - Multi
Issuer Verifier - Kid-aware JWKS verifier over an explicit issuer allow-list. The production
surface:
verifyenforces the RFC 9068at+jwtprofile, the issuer allow-list and the configured audience;verify_claimstakes an explicitValidationPolicymatching auth_service’sdecode_with_policysemantics exactly. - Verifier
- Single-issuer verifier: the original API, as a one-issuer
MultiIssuerVerifier. The issuer and audience pins are required; a blank one fails closed at verification time, before any network call.
Constants§
- DEFAULT_
MIN_ FETCH_ INTERVAL - Default minimum interval between JWKS fetch attempts, kept per issuer.
Bounds the kid-miss refetch path so a forged
kidcannot drive a fetch loop — mirrors jose’scooldownDurationcontract.Duration::ZEROdisables it (tests, and verifiers pinned to a static JWKS).
Functions§
- create_
multi_ issuer_ verifier - create_
verifier - generate_
code_ challenge - generate_
code_ verifier - PKCE helpers (S256, 43-char unpadded base64url)
Type Aliases§
- Consume
Jti - Replay protection for logout tokens: called once with
(jti, expires_at)after every other check passed; returnfalsewhen thatjtiwas seen before.