pub(super) struct AuthTokenInner {
user_id: Id,
exp: NumericDate,
iat: NumericDate,
session_start: NumericDate,
}Expand description
Plaintext content of AuthToken.
Fields§
§user_id: IdThe Id of the user to whom this token has been issued.
exp: NumericDateWhen this token expires.
iat: NumericDateWhen this token was issued.
session_start: NumericDateWhen the user logged in, i.e. the iat of the first token in the chain of refreshes that
led to this token.
Implementations§
Source§impl AuthTokenInner
impl AuthTokenInner
fn seal(&self, key: &SealingKey) -> Result<AuthToken>
fn unseal( sealed: &AuthToken, key: &SealingKey, ) -> Result<AuthTokenInner, Opaque>
Sourcefn open(self, accept_expired: bool) -> Result<Self, Opaque>
fn open(self, accept_expired: bool) -> Result<Self, Opaque>
Checks whether this AuthToken is still valid, unless accept_expired is set.
Sourcefn may_be_refreshed(
&self,
now: NumericDate,
max_idle: Duration,
max_session: Duration,
) -> bool
fn may_be_refreshed( &self, now: NumericDate, max_idle: Duration, max_session: Duration, ) -> bool
Whether a new auth token may be issued based on this (possibly expired) one at now,
without the user logging in again.
Trait Implementations§
Source§impl Clone for AuthTokenInner
impl Clone for AuthTokenInner
Source§fn clone(&self) -> AuthTokenInner
fn clone(&self) -> AuthTokenInner
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 moreSource§impl Debug for AuthTokenInner
impl Debug for AuthTokenInner
Source§impl<'de> Deserialize<'de> for AuthTokenInner
impl<'de> Deserialize<'de> for AuthTokenInner
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthTokenInner
impl RefUnwindSafe for AuthTokenInner
impl Send for AuthTokenInner
impl Sync for AuthTokenInner
impl Unpin for AuthTokenInner
impl UnsafeUnpin for AuthTokenInner
impl UnwindSafe for AuthTokenInner
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more