pub struct JwtValidationService<C> { /* private fields */ }Expand description
Service responsible for JWT token validation.
This service handles all aspects of JWT token validation including:
- Token decoding using the provided codec
- Issuer validation
- Token expiration (handled by the underlying jsonwebtoken library)
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.
This method performs the following validations:
- Attempts to decode the token using the configured codec
- Validates the issuer matches the expected issuer
- Token expiration is automatically handled by the jsonwebtoken library
§Parameters
token_value: The raw JWT token string
§Returns
JwtValidationResult::Validif the token is valid and authorizedJwtValidationResult::InvalidTokenif the token cannot be decodedJwtValidationResult::InvalidIssuerif the issuer doesn’t match
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 · 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<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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more