pub struct JwtValidationService<C> { /* private fields */ }Expand description
Service responsible for validating raw JWT token strings.
This service adds application-level checks on top of the configured codec:
- decode the token into typed claims
- verify the expected issuer
Expiration, signature, algorithm, and claim-shape validation are delegated to the codec.
Implementations§
Source§impl<C> JwtValidationService<C>
impl<C> JwtValidationService<C>
Source§impl<C, R, G> JwtValidationService<C>
impl<C, R, G> JwtValidationService<C>
Sourcepub fn validate_token(
&self,
token_value: &str,
) -> JwtValidationResult<Account<R, G>>
pub fn validate_token( &self, token_value: &str, ) -> JwtValidationResult<Account<R, G>>
Validates a JWT token from its raw string representation.
Validation happens in two steps:
- decode the token with the configured codec
- verify the configured issuer against the decoded claims
Returns JwtValidationResult::Valid when decoding succeeds and the
issuer matches, JwtValidationResult::InvalidToken when decoding
fails, and JwtValidationResult::InvalidIssuer when decoding succeeds
but the issuer differs.
Trait Implementations§
Source§impl<C: Clone> Clone for JwtValidationService<C>
impl<C: Clone> Clone for JwtValidationService<C>
Source§fn clone(&self) -> JwtValidationService<C>
fn clone(&self) -> JwtValidationService<C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: Debug> Debug for JwtValidationService<C>
impl<C: Debug> Debug for JwtValidationService<C>
Source§impl<C, R, G> JwtClaimsVerifier<JwtClaims<Account<R, G>>> for JwtValidationService<C>
impl<C, R, G> JwtClaimsVerifier<JwtClaims<Account<R, G>>> for JwtValidationService<C>
Auto Trait Implementations§
impl<C> Freeze for JwtValidationService<C>
impl<C> RefUnwindSafe for JwtValidationService<C>where
C: RefUnwindSafe,
impl<C> Send for JwtValidationService<C>
impl<C> Sync for JwtValidationService<C>
impl<C> Unpin for JwtValidationService<C>
impl<C> UnsafeUnpin for JwtValidationService<C>
impl<C> UnwindSafe for JwtValidationService<C>where
C: RefUnwindSafe,
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