pub struct TokenConfig {
pub clock_skew: Option<u64>,
pub max_age: u64,
}Available on (crate features
oauth or oauth-server) and crate feature oauth only.Expand description
Configuration for token validation behavior.
Fields§
§clock_skew: Option<u64>§max_age: u64Implementations§
Source§impl TokenConfig
impl TokenConfig
Sourcepub fn new(clock_skew: u64, max_age: u64) -> Self
pub fn new(clock_skew: u64, max_age: u64) -> Self
Creates a new token configuration.
§Arguments
clock_skew- Clock skew tolerance in seconds (0 means disabled)max_age- Maximum token age in seconds
Sourcepub fn with_clock_skew(self, clock_skew: u64) -> Self
pub fn with_clock_skew(self, clock_skew: u64) -> Self
Sourcepub fn with_max_age(self, max_age: u64) -> Self
pub fn with_max_age(self, max_age: u64) -> Self
Sets the maximum token age.
Trait Implementations§
Source§impl Clone for TokenConfig
impl Clone for TokenConfig
Source§fn clone(&self) -> TokenConfig
fn clone(&self) -> TokenConfig
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 TokenConfig
impl Debug for TokenConfig
Source§impl Default for TokenConfig
impl Default for TokenConfig
Source§impl PartialEq for TokenConfig
impl PartialEq for TokenConfig
impl Copy for TokenConfig
impl Eq for TokenConfig
impl StructuralPartialEq for TokenConfig
Auto Trait Implementations§
impl Freeze for TokenConfig
impl RefUnwindSafe for TokenConfig
impl Send for TokenConfig
impl Sync for TokenConfig
impl Unpin for TokenConfig
impl UnwindSafe for TokenConfig
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.