pub struct JwtVerifier { /* private fields */ }Expand description
Strict verifier: only signature-verified claims cross the validation boundary.
Implementations§
Source§impl JwtVerifier
impl JwtVerifier
Sourcepub fn new(key: JwtKey, policy: JwtPolicy, clock: Arc<dyn Clock>) -> Self
pub fn new(key: JwtKey, policy: JwtPolicy, clock: Arc<dyn Clock>) -> Self
Creates a verifier with an injectable clock.
Sourcepub fn with_system_clock(key: JwtKey, policy: JwtPolicy) -> Self
pub fn with_system_clock(key: JwtKey, policy: JwtPolicy) -> Self
Creates a production verifier using system time.
Sourcepub fn verify(
&self,
token: &str,
expected: AuthTokenType,
) -> Result<VerifiedToken>
pub fn verify( &self, token: &str, expected: AuthTokenType, ) -> Result<VerifiedToken>
Verifies signature, namespace, purpose, identifiers, and time boundaries.
§Errors
Returns a classified error without token/key material. Products additionally check live
account/version state and live sid state when promising immediate session revocation.
Returns CryptoProviderNotInitialized until the product initializes the JWT backend.
Trait Implementations§
Source§impl Clone for JwtVerifier
impl Clone for JwtVerifier
Source§fn clone(&self) -> JwtVerifier
fn clone(&self) -> JwtVerifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for JwtVerifier
impl !RefUnwindSafe for JwtVerifier
impl Send for JwtVerifier
impl Sync for JwtVerifier
impl Unpin for JwtVerifier
impl UnsafeUnpin for JwtVerifier
impl !UnwindSafe for JwtVerifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more