pub struct ValidationPolicy<'a> {
pub validate_exp: bool,
pub validate_nbf: bool,
pub leeway_seconds: u64,
pub issuer: Option<&'a str>,
pub audiences: &'a [JwtAudience],
}Expand description
The claim checks applied on top of the always-on signature, RS256, and
kid enforcement. An empty audiences slice disables the aud check.
Fields§
§validate_exp: bool§validate_nbf: bool§leeway_seconds: u64§issuer: Option<&'a str>§audiences: &'a [JwtAudience]Implementations§
Source§impl<'a> ValidationPolicy<'a>
impl<'a> ValidationPolicy<'a>
Sourcepub const fn session_context() -> Self
pub const fn session_context() -> Self
Stateless decode for request-context middleware that performs its own
DB-backed session and user checks after decode. Validates exp and
nbf (with leeway); issuer and audience are enforced by the stateful
validators that hold deployment config, not here.
Sourcepub const fn issuer_scoped(
issuer: &'a str,
audiences: &'a [JwtAudience],
) -> Self
pub const fn issuer_scoped( issuer: &'a str, audiences: &'a [JwtAudience], ) -> Self
Full first-party validation: exp + nbf + issuer pinning + audience
membership, with the standard leeway.
Trait Implementations§
Source§impl<'a> Clone for ValidationPolicy<'a>
impl<'a> Clone for ValidationPolicy<'a>
Source§fn clone(&self) -> ValidationPolicy<'a>
fn clone(&self) -> ValidationPolicy<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ValidationPolicy<'a>
impl<'a> Debug for ValidationPolicy<'a>
Source§impl<'a> Default for ValidationPolicy<'a>
impl<'a> Default for ValidationPolicy<'a>
Source§fn default() -> ValidationPolicy<'a>
fn default() -> ValidationPolicy<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for ValidationPolicy<'a>
impl<'a> RefUnwindSafe for ValidationPolicy<'a>
impl<'a> Send for ValidationPolicy<'a>
impl<'a> Sync for ValidationPolicy<'a>
impl<'a> Unpin for ValidationPolicy<'a>
impl<'a> UnsafeUnpin for ValidationPolicy<'a>
impl<'a> UnwindSafe for ValidationPolicy<'a>
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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