pub struct JwtBestPracticesValidator { /* private fields */ }Expand description
JWT Best Practices Validator
Implementations§
Source§impl JwtBestPracticesValidator
impl JwtBestPracticesValidator
Sourcepub fn new(config: JwtBestPracticesConfig) -> Self
pub fn new(config: JwtBestPracticesConfig) -> Self
Create a new validator with configuration
Sourcepub fn validate_token_format(&self, token: &str) -> Result<()>
pub fn validate_token_format(&self, token: &str) -> Result<()>
Validate JWT token format
Sourcepub fn validate_algorithm(&self, algorithm: &Algorithm) -> Result<()>
pub fn validate_algorithm(&self, algorithm: &Algorithm) -> Result<()>
Validate algorithm security
Sourcepub fn validate_standard_claims(
&mut self,
claims: &SecureJwtClaims,
) -> Result<()>
pub fn validate_standard_claims( &mut self, claims: &SecureJwtClaims, ) -> Result<()>
Validate standard JWT claims
Sourcepub fn create_validation_rules(
&self,
algorithm: Algorithm,
) -> Result<Validation>
pub fn create_validation_rules( &self, algorithm: Algorithm, ) -> Result<Validation>
Create validation rules based on configuration
Sourcepub fn get_security_recommendations(&self) -> Vec<String>
pub fn get_security_recommendations(&self) -> Vec<String>
Get security recommendations for current configuration
Sourcepub fn clear_used_jtis(&mut self)
pub fn clear_used_jtis(&mut self)
Clear used JWT IDs (for cleanup)
Sourcepub fn get_config(&self) -> &JwtBestPracticesConfig
pub fn get_config(&self) -> &JwtBestPracticesConfig
Get current configuration
Auto Trait Implementations§
impl Freeze for JwtBestPracticesValidator
impl RefUnwindSafe for JwtBestPracticesValidator
impl Send for JwtBestPracticesValidator
impl Sync for JwtBestPracticesValidator
impl Unpin for JwtBestPracticesValidator
impl UnwindSafe for JwtBestPracticesValidator
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> 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