pub struct JwtValidator { /* private fields */ }Expand description
JWT validator
Implementations§
Source§impl JwtValidator
impl JwtValidator
Sourcepub fn validate(&self, token: &str) -> Result<JwtClaims, JwtError>
pub fn validate(&self, token: &str) -> Result<JwtClaims, JwtError>
Validate a JWT token and return claims
Sourcepub fn validate_to_identity(&self, token: &str) -> Result<Identity, JwtError>
pub fn validate_to_identity(&self, token: &str) -> Result<Identity, JwtError>
Validate token and convert to Identity
Sourcepub async fn refresh_jwks(&self) -> Result<(), JwtError>
pub async fn refresh_jwks(&self) -> Result<(), JwtError>
Refresh JWKS from remote endpoint
Sourcepub fn needs_refresh(&self) -> bool
pub fn needs_refresh(&self) -> bool
Check if JWKS needs refresh
Sourcepub fn last_refresh_time(&self) -> Option<Instant>
pub fn last_refresh_time(&self) -> Option<Instant>
Get last refresh time
Auto Trait Implementations§
impl Freeze for JwtValidator
impl !RefUnwindSafe for JwtValidator
impl Send for JwtValidator
impl Sync for JwtValidator
impl Unpin for JwtValidator
impl UnsafeUnpin for JwtValidator
impl !UnwindSafe for JwtValidator
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> 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