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.
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,
) -> Pin<Box<dyn Future<Output = Result<u64, 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,
) -> Pin<Box<dyn Future<Output = Result<u64, RevocationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Revoke all tokens for a user (by
sub claim).
Returns the number of tokens revoked.Auto Trait Implementations§
impl Freeze for InMemoryRevocationStore
impl !RefUnwindSafe 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
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