Struct aliri_tokens::TokenLifetimeConfig
source · pub struct TokenLifetimeConfig<C = System> { /* private fields */ }
Expand description
Configuration for determining how long a token should be considered fresh
Implementations§
source§impl TokenLifetimeConfig
impl TokenLifetimeConfig
sourcepub fn new(freshness_period: f64, min_staleness_period: DurationSecs) -> Self
pub fn new(freshness_period: f64, min_staleness_period: DurationSecs) -> Self
Constructs a new lifetime configuration
A token using this configuration will be considered stale when the freshness_period
(represented as a ratio of the token’s lifetime) has passed. The token will be always
be considered stale with at least min_staleness_period
remaining.
source§impl<C: Clock> TokenLifetimeConfig<C>
impl<C: Clock> TokenLifetimeConfig<C>
sourcepub fn create_token<A, I>(
&self,
access_token: A,
id_token: Option<I>,
valid_duration: DurationSecs
) -> TokenWithLifetime
pub fn create_token<A, I>( &self, access_token: A, id_token: Option<I>, valid_duration: DurationSecs ) -> TokenWithLifetime
Given an access token, id token, and token lifetime, constructs a token with a lifetime
Trait Implementations§
source§impl<C: Clone> Clone for TokenLifetimeConfig<C>
impl<C: Clone> Clone for TokenLifetimeConfig<C>
source§fn clone(&self) -> TokenLifetimeConfig<C>
fn clone(&self) -> TokenLifetimeConfig<C>
Returns a copy 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<C: Debug> Debug for TokenLifetimeConfig<C>
impl<C: Debug> Debug for TokenLifetimeConfig<C>
Auto Trait Implementations§
impl<C> Freeze for TokenLifetimeConfig<C>where
C: Freeze,
impl<C> RefUnwindSafe for TokenLifetimeConfig<C>where
C: RefUnwindSafe,
impl<C> Send for TokenLifetimeConfig<C>where
C: Send,
impl<C> Sync for TokenLifetimeConfig<C>where
C: Sync,
impl<C> Unpin for TokenLifetimeConfig<C>where
C: Unpin,
impl<C> UnwindSafe for TokenLifetimeConfig<C>where
C: UnwindSafe,
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