pub struct JwtBestPracticesConfig {Show 14 fields
pub security_level: SecurityLevel,
pub allowed_algorithms: Vec<Algorithm>,
pub forbidden_algorithms: Vec<Algorithm>,
pub max_lifetime: i64,
pub min_lifetime: i64,
pub clock_skew: i64,
pub required_issuers: HashSet<String>,
pub required_audiences: HashSet<String>,
pub require_subject: bool,
pub require_issued_at: bool,
pub require_expiration: bool,
pub require_not_before: bool,
pub require_jwt_id: bool,
pub max_nested_depth: u8,
}
Expand description
JWT Best Practices Configuration
Fields§
§security_level: SecurityLevel
Required security level
allowed_algorithms: Vec<Algorithm>
Allowed signing algorithms (in order of preference)
forbidden_algorithms: Vec<Algorithm>
Forbidden algorithms (explicitly denied)
max_lifetime: i64
Maximum token lifetime (seconds)
min_lifetime: i64
Minimum token lifetime (seconds)
clock_skew: i64
Clock skew tolerance (seconds)
required_issuers: HashSet<String>
Required issuer(s)
required_audiences: HashSet<String>
Required audience(s)
require_subject: bool
Whether to require the ‘sub’ claim
require_issued_at: bool
Whether to require the ‘iat’ claim
require_expiration: bool
Whether to require the ‘exp’ claim
require_not_before: bool
Whether to require the ‘nbf’ claim
require_jwt_id: bool
Whether to require the ‘jti’ claim (replay protection)
max_nested_depth: u8
Maximum allowed nested JWT depth
Implementations§
Source§impl JwtBestPracticesConfig
impl JwtBestPracticesConfig
Sourcepub fn minimum_security() -> Self
pub fn minimum_security() -> Self
Create configuration for minimum security level
Sourcepub fn maximum_security() -> Self
pub fn maximum_security() -> Self
Create configuration for maximum security level
Trait Implementations§
Source§impl Clone for JwtBestPracticesConfig
impl Clone for JwtBestPracticesConfig
Source§fn clone(&self) -> JwtBestPracticesConfig
fn clone(&self) -> JwtBestPracticesConfig
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 moreSource§impl Debug for JwtBestPracticesConfig
impl Debug for JwtBestPracticesConfig
Auto Trait Implementations§
impl Freeze for JwtBestPracticesConfig
impl RefUnwindSafe for JwtBestPracticesConfig
impl Send for JwtBestPracticesConfig
impl Sync for JwtBestPracticesConfig
impl Unpin for JwtBestPracticesConfig
impl UnwindSafe for JwtBestPracticesConfig
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