pub struct MemoryIdTokenVerifier<S: ScopePiiReader> { /* private fields */ }Expand description
In-memory verifier — pre-registered token → IdAssertion<S> map.
Implementations§
Source§impl<S: ScopePiiReader> MemoryIdTokenVerifier<S>
impl<S: ScopePiiReader> MemoryIdTokenVerifier<S>
pub fn new() -> Self
Sourcepub fn with_expectations(self, expectations: VerifyConfig) -> Self
pub fn with_expectations(self, expectations: VerifyConfig) -> Self
Attach VerifyConfig for symmetry with PasIdTokenVerifier construction. The in-memory adapter does not currently consult them; it’s a hook point for future “simulate iss/aud check” semantics.
Sourcepub fn insert(
&mut self,
id_token: impl Into<String>,
assertion: IdAssertion<S>,
) -> &mut Self
pub fn insert( &mut self, id_token: impl Into<String>, assertion: IdAssertion<S>, ) -> &mut Self
Register a successful verification: when id_token is
presented, return assertion.
Sourcepub fn fail_with(&mut self, err: IdVerifyError) -> &mut Self
pub fn fail_with(&mut self, err: IdVerifyError) -> &mut Self
Configure a global default failure — every id_token (including
those in the assertions map) returns this error. Useful for
simulating a keyset outage or M66 nonce-mismatch in consumer
integration tests.
Trait Implementations§
Source§impl<S: ScopePiiReader> Default for MemoryIdTokenVerifier<S>
impl<S: ScopePiiReader> Default for MemoryIdTokenVerifier<S>
Source§fn default() -> Self
fn default() -> Self
Manual Default impl — #[derive(Default)] would generate an
S: Default bound, but engine scope markers (Openid, Email,
etc.) intentionally do not implement Default (they’re unit
witnesses, not constructible state). Manual impl drops the
extra bound; the struct fields are all Default regardless of S.