Skip to main content

RevocationStore

Trait RevocationStore 

Source
pub trait RevocationStore: Send + Sync {
    // Required methods
    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 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_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;
}
Expand description

Revocation store abstraction.

Required Methods§

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,

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,

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,

Revoke all tokens for a user (by sub claim). Returns the number of tokens revoked.

Implementors§