Expand description
In-memory adapters for tests + boundary fixtures.
Gated behind cfg(any(test, feature = "test-support")) so production
builds never link the test machinery. Two adapters live here:
MemoryIdTokenVerifier<S>— in-memoryIdTokenVerifier<S>. Mirrorscrate::MemoryBearerVerifierstructurally — same in-memory pattern, different port.InMemoryStateStore— in-memorysuper::StateStore. Atomic single-use guaranteed viatokio::sync::Mutex<HashMap>held acrossputandtake. Phase 11.A.
Two ways to fail a verification:
- Lookup miss: the token string isn’t in the
assertionsmap. Surfaces asIdVerifyError::SignatureInvalid(the boundary semantic of “this token doesn’t verify against our keyset” maps identically to “this token is unknown to the test fixture”). - Default failure: any token returns the configured error. Used to simulate keyset outages, expired tokens, M66 nonce mismatches, etc. without pre-registering every variant.
Nonce semantics: the test verifier ignores the per-call nonce
by default. Test fixtures control success/failure via the
assertions map and default_failure; callers that want to
simulate a nonce mismatch insert
IdVerifyError::NonceMismatch as the default_failure.
Structs§
- InMemory
State Store - In-memory atomic single-use state store for boundary tests.
- Memory
IdToken Verifier - In-memory verifier — pre-registered token →
IdAssertion<S>map.