pub struct JwtAccessTokenValidator { /* private fields */ }
Expand description
JWT Access Token Validator for RFC 9068 compliance
Implementations§
Source§impl JwtAccessTokenValidator
impl JwtAccessTokenValidator
Sourcepub fn new(
algorithm: Algorithm,
decoding_key: DecodingKey,
expected_issuer: String,
) -> Self
pub fn new( algorithm: Algorithm, decoding_key: DecodingKey, expected_issuer: String, ) -> Self
Create a new JWT access token validator
Sourcepub fn validate_jwt_access_token(
&self,
token: &str,
) -> Result<JwtAccessTokenClaims>
pub fn validate_jwt_access_token( &self, token: &str, ) -> Result<JwtAccessTokenClaims>
Validate a JWT access token and extract claims
Sourcepub fn extract_scopes(&self, claims: &JwtAccessTokenClaims) -> Vec<String>
pub fn extract_scopes(&self, claims: &JwtAccessTokenClaims) -> Vec<String>
Extract scope list from JWT access token claims
Sourcepub fn has_scope(
&self,
claims: &JwtAccessTokenClaims,
required_scope: &str,
) -> bool
pub fn has_scope( &self, claims: &JwtAccessTokenClaims, required_scope: &str, ) -> bool
Check if JWT access token has specific scope
Sourcepub fn validate_audience(
&self,
claims: &JwtAccessTokenClaims,
expected_audiences: &[String],
) -> Result<()>
pub fn validate_audience( &self, claims: &JwtAccessTokenClaims, expected_audiences: &[String], ) -> Result<()>
Validate audience claim against expected audiences
Trait Implementations§
Source§impl Clone for JwtAccessTokenValidator
impl Clone for JwtAccessTokenValidator
Source§fn clone(&self) -> JwtAccessTokenValidator
fn clone(&self) -> JwtAccessTokenValidator
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 JwtAccessTokenValidator
impl RefUnwindSafe for JwtAccessTokenValidator
impl Send for JwtAccessTokenValidator
impl Sync for JwtAccessTokenValidator
impl Unpin for JwtAccessTokenValidator
impl UnwindSafe for JwtAccessTokenValidator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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