[−][src]Struct jsonwebtokens::VerifierBuilder
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]
&mut self,
claim: impl Into<String>,
value: impl Into<String>
) -> &mut Self
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]
&mut self,
claim: impl Into<String>,
values: &[&str]
) -> &mut Self
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]
&mut self,
claim: impl Into<String>,
value: impl Into<Regex>
) -> &mut Self
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]
&mut self,
claim: impl Into<String>,
values: &[Regex]
) -> &mut Self
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]
&mut self,
claim: impl Into<String>,
func: impl Fn(&Value) -> bool + 'static
) -> &mut Self
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
impl !RefUnwindSafe for VerifierBuilder
impl !Send for VerifierBuilder
impl !Sync for VerifierBuilder
impl Unpin for VerifierBuilder
impl !UnwindSafe for VerifierBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,