[][src]Struct aliri_jose::jwt::CoreValidator

pub struct CoreValidator { /* fields omitted */ }

A core validator for JWTs

A default validator configured with common expected validations.

Implementations

impl CoreValidator[src]

pub fn with_leeway(self, leeway: Duration) -> Self[src]

Allows a grace period for token validation

Applies on either side of the "not before" and "expires" claims.

pub fn with_leeway_secs(self, leeway: u64) -> Self[src]

Allows a grace period (in seconds) for token validation

Applies on either side of the "not before" and "expires" claims.

pub fn check_expiration(self) -> Self[src]

Enforces expiration checks

pub fn check_not_before(self) -> Self[src]

Enforces "not valid before" checks

pub fn ignore_expiration(self) -> Self[src]

Skips expiration checks

pub fn ignore_not_before(self) -> Self[src]

Skips "not valid before" checks

pub fn add_allowed_audience(self, audience: Audience) -> Self[src]

Adds a single audience to the set of allowed audiences

pub fn extend_allowed_audiences<I: IntoIterator<Item = Audience>>(
    self,
    alg: I
) -> Self
[src]

Adds mutliple audiences to the set of allowed audiences

pub fn add_approved_algorithm(self, alg: Algorithm) -> Self[src]

Approves a single algorithm

pub fn extend_approved_algorithms<I: IntoIterator<Item = Algorithm>>(
    self,
    alg: I
) -> Self
[src]

Approves multiple algorithms

pub fn require_issuer(self, issuer: Issuer) -> Self[src]

Require that tokens specify a particular issuer

pub fn check_subject(self, sub_regex: Regex) -> Self[src]

Require that the sub claim exists and matches a particular regular expression

Trait Implementations

impl Clone for CoreValidator[src]

impl Debug for CoreValidator[src]

impl Default for CoreValidator[src]

fn default() -> Self[src]

The default validator does not accept any algorithms and that the token is not expired (no grace period)

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.