[][src]Struct jsonwebtokens::VerifierBuilder

pub struct VerifierBuilder { /* fields omitted */ }

Configures the requirements for checking token claims with a builder-pattern API

Methods

impl VerifierBuilder[src]

pub fn new() -> VerifierBuilder[src]

pub fn issuer(&mut self, issuer: impl Into<String>) -> &mut Self[src]

Convenience for string_equals("iss", "value")

pub fn audience(&mut self, aud: impl Into<String>) -> &mut Self[src]

Convenience for string_equals("aud", "value")

pub fn subject(&mut self, sub: impl Into<String>) -> &mut Self[src]

Convenience for string_equals("sub", "value")

pub fn nonce(&mut self, nonce: impl Into<String>) -> &mut Self[src]

Convenience for string_equals("nonce", "value")

pub fn string_equals(
    &mut self,
    claim: impl Into<String>,
    value: impl Into<String>
) -> &mut Self
[src]

Check that a claim has a specific string value

pub fn string_equals_one_of(
    &mut self,
    claim: impl Into<String>,
    values: &[&str]
) -> &mut Self
[src]

Check that a claim equals one of the given string values

pub fn string_matches(
    &mut self,
    claim: impl Into<String>,
    value: impl Into<Regex>
) -> &mut Self
[src]

Check that the claim matches the given regular expression

pub fn string_matches_one_of(
    &mut self,
    claim: impl Into<String>,
    values: &[Regex]
) -> &mut Self
[src]

Check that the claim matches one of the given regular expressions

pub fn leeway(&mut self, leeway: u32) -> &mut Self[src]

Sets a leeway (in seconds) should be allowed when checking exp, nbf and iat claims

pub fn ignore_exp(&mut self) -> &mut Self[src]

Don't check the 'exp' expiry claim

pub fn ignore_nbf(&mut self) -> &mut Self[src]

Don't check the 'nbf' not before claim

pub fn ignore_iat(&mut self) -> &mut Self[src]

Don't check the 'iat' issued at claim

pub fn claim_callback(
    &mut self,
    claim: impl Into<String>,
    func: impl Fn(&Value) -> bool + 'static
) -> &mut Self
[src]

Check a claim Value manually, returning true if ok, else false

pub fn build(&self) -> Result<Verifier, Error>[src]

Build the final Verifier

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, 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.