#[non_exhaustive]pub struct SessionPolicy {
pub access_ttl_seconds: i64,
pub refresh_ttl_seconds: i64,
}Expand description
TTL defaults for a session, so consumers don’t pick the wrong durations.
Access tokens are minutes-scale (a stateless token can’t be un-minted, so it’s kept short — that short window is also the revocation-propagation bound); refresh tokens are days-scale (the stateful, rotatable half).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.access_ttl_seconds: i64Access-token lifetime in seconds. Also the upper bound on how long a revoked-but-not-yet-propagated access token stays accepted at the edge.
refresh_ttl_seconds: i64Refresh-token lifetime in seconds (applied to root and every successor).
Implementations§
Source§impl SessionPolicy
impl SessionPolicy
Sourcepub const DEFAULT_ACCESS_TTL_SECONDS: i64
pub const DEFAULT_ACCESS_TTL_SECONDS: i64
15 minutes — short enough to bound revocation lag, long enough to avoid rotating on every request.
Sourcepub const DEFAULT_REFRESH_TTL_SECONDS: i64
pub const DEFAULT_REFRESH_TTL_SECONDS: i64
30 days.
pub fn new(access_ttl_seconds: i64, refresh_ttl_seconds: i64) -> Self
pub fn with_access_ttl(self, seconds: i64) -> Self
pub fn with_refresh_ttl(self, seconds: i64) -> Self
Trait Implementations§
Source§impl Clone for SessionPolicy
impl Clone for SessionPolicy
Source§fn clone(&self) -> SessionPolicy
fn clone(&self) -> SessionPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SessionPolicy
Source§impl Debug for SessionPolicy
impl Debug for SessionPolicy
Source§impl Default for SessionPolicy
impl Default for SessionPolicy
impl Eq for SessionPolicy
Source§impl PartialEq for SessionPolicy
impl PartialEq for SessionPolicy
impl StructuralPartialEq for SessionPolicy
Auto Trait Implementations§
impl Freeze for SessionPolicy
impl RefUnwindSafe for SessionPolicy
impl Send for SessionPolicy
impl Sync for SessionPolicy
impl Unpin for SessionPolicy
impl UnsafeUnpin for SessionPolicy
impl UnwindSafe for SessionPolicy
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