pub struct InMemoryRevocationStore { /* private fields */ }Expand description
In-memory revocation store for testing and single-instance dev.
Implementations§
Source§impl InMemoryRevocationStore
impl InMemoryRevocationStore
Sourcepub fn cleanup_expired(&self)
pub fn cleanup_expired(&self)
Remove expired entries (single-JTI revocations and per-user epochs).
Trait Implementations§
Source§impl Default for InMemoryRevocationStore
impl Default for InMemoryRevocationStore
Source§impl RevocationStore for InMemoryRevocationStore
impl RevocationStore for InMemoryRevocationStore
Source§fn is_revoked<'life0, 'life1, 'async_trait>(
&'life0 self,
jti: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_revoked<'life0, 'life1, 'async_trait>(
&'life0 self,
jti: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a JTI has been revoked.
Source§fn revoke<'life0, 'life1, 'async_trait>(
&'life0 self,
jti: &'life1 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke<'life0, 'life1, 'async_trait>(
&'life0 self,
jti: &'life1 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Revoke a single JTI.
ttl_secs is the remaining JWT lifetime —
the store should auto-expire the entry after this duration.Source§fn revoke_all_for_user<'life0, 'life1, 'async_trait>(
&'life0 self,
sub: &'life1 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn revoke_all_for_user<'life0, 'life1, 'async_trait>(
&'life0 self,
sub: &'life1 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = Result<(), RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Revoke all of a user’s tokens by recording a per-user epoch: every token
for
sub whose iat (issued-at) is at or before now is henceforth rejected by
user_revoked_after. Read moreSource§fn user_revoked_after<'life0, 'life1, 'async_trait>(
&'life0 self,
sub: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn user_revoked_after<'life0, 'life1, 'async_trait>(
&'life0 self,
sub: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<i64>, RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Return the
revoke-all epoch (unix seconds) currently in effect for sub, or
None when the user has no active epoch. Tokens with iat <= epoch are revoked.Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryRevocationStore
impl Freeze for InMemoryRevocationStore
impl Send for InMemoryRevocationStore
impl Sync for InMemoryRevocationStore
impl Unpin for InMemoryRevocationStore
impl UnsafeUnpin for InMemoryRevocationStore
impl UnwindSafe for InMemoryRevocationStore
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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