Skip to main content

Module memory

Module memory 

Source
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:

Two ways to fail a verification:

  • Lookup miss: the token string isn’t in the assertions map. Surfaces as IdVerifyError::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§

InMemoryStateStore
In-memory atomic single-use state store for boundary tests.
MemoryIdTokenVerifier
In-memory verifier — pre-registered token → IdAssertion<S> map.