pub struct TokenRevocationList { /* private fields */ }Expand description
Token revocation list with automatic cleanup
Implementations§
Source§impl TokenRevocationList
impl TokenRevocationList
Sourcepub fn with_max_age(self, max_age: Duration) -> Self
pub fn with_max_age(self, max_age: Duration) -> Self
Set the maximum age of revocation entries
Sourcepub async fn revoke(&self, jti: impl Into<String>)
pub async fn revoke(&self, jti: impl Into<String>)
Revoke a token by its JTI using max_age as a fallback expiry.
Sourcepub async fn revoke_until(&self, jti: impl Into<String>, expires_at: u64)
pub async fn revoke_until(&self, jti: impl Into<String>, expires_at: u64)
Revoke a token by its JTI until the token naturally expires.
Sourcepub async fn is_revoked(&self, jti: &str) -> bool
pub async fn is_revoked(&self, jti: &str) -> bool
Check if a token is revoked
Sourcepub async fn cleanup_expired(&self, now: u64) -> usize
pub async fn cleanup_expired(&self, now: u64) -> usize
Clean up old revocation entries (should be called periodically)
Trait Implementations§
Source§impl Clone for TokenRevocationList
impl Clone for TokenRevocationList
Source§fn clone(&self) -> TokenRevocationList
fn clone(&self) -> TokenRevocationList
Returns a duplicate 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 Default for TokenRevocationList
impl Default for TokenRevocationList
Auto Trait Implementations§
impl Freeze for TokenRevocationList
impl !RefUnwindSafe for TokenRevocationList
impl Send for TokenRevocationList
impl Sync for TokenRevocationList
impl Unpin for TokenRevocationList
impl UnsafeUnpin for TokenRevocationList
impl !UnwindSafe for TokenRevocationList
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