pub struct ValidationSettings {
pub required_spec_claims: HashSet<String>,
pub leeway: u64,
pub validate_exp: bool,
pub validate_nbf: bool,
pub aud: Option<HashSet<String>>,
pub iss: Option<HashSet<String>>,
pub sub: Option<String>,
}
Fields§
§required_spec_claims: HashSet<String>
§leeway: u64
§validate_exp: bool
§validate_nbf: bool
§aud: Option<HashSet<String>>
§iss: Option<HashSet<String>>
§sub: Option<String>
Implementations§
Source§impl ValidationSettings
impl ValidationSettings
pub fn new() -> Self
Sourcepub fn set_audience<T: ToString>(&mut self, items: &[T])
pub fn set_audience<T: ToString>(&mut self, items: &[T])
aud
is a collection of one or more acceptable audience members
The simple usage is set_audience(&["some aud name"])
Sourcepub fn set_issuer<T: ToString>(&mut self, items: &[T])
pub fn set_issuer<T: ToString>(&mut self, items: &[T])
iss
is a collection of one or more acceptable issuers members
The simple usage is set_issuer(&["some iss name"])
Sourcepub fn set_required_spec_claims<T: ToString>(&mut self, items: &[T])
pub fn set_required_spec_claims<T: ToString>(&mut self, items: &[T])
Which claims are required to be present for this JWT to be considered valid.
The only values that will be considered are “exp”, “nbf”, “aud”, “iss”, “sub”.
The simple usage is set_required_spec_claims(&["exp", "nbf"])
.
If you want to have an empty set, do not use this function - set an empty set on the struct
param directly.
Trait Implementations§
Source§impl Clone for ValidationSettings
impl Clone for ValidationSettings
Source§fn clone(&self) -> ValidationSettings
fn clone(&self) -> ValidationSettings
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 ValidationSettings
impl Debug for ValidationSettings
Source§impl Default for ValidationSettings
impl Default for ValidationSettings
Source§impl PartialEq for ValidationSettings
impl PartialEq for ValidationSettings
impl Eq for ValidationSettings
impl StructuralPartialEq for ValidationSettings
Auto Trait Implementations§
impl Freeze for ValidationSettings
impl RefUnwindSafe for ValidationSettings
impl Send for ValidationSettings
impl Sync for ValidationSettings
impl Unpin for ValidationSettings
impl UnwindSafe for ValidationSettings
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.