pub trait TokenStore:
Send
+ Sync
+ 'static {
// Required methods
fn insert_refresh(
&self,
record: RefreshRecord,
) -> BoxFuture<Result<(), TokenStoreError>>;
fn find_refresh(
&self,
token_hash: String,
now: u64,
) -> BoxFuture<Result<Option<RefreshRecord>, TokenStoreError>>;
fn rotate_refresh(
&self,
token_hash: String,
replacement_hash: String,
replacement_expires_at: u64,
now: u64,
) -> BoxFuture<Result<RotateRefresh, TokenStoreError>>;
fn revoke_family(
&self,
family_id: String,
expires_at: u64,
) -> BoxFuture<Result<(), TokenStoreError>>;
fn is_family_revoked(
&self,
family_id: String,
now: u64,
) -> BoxFuture<Result<bool, TokenStoreError>>;
fn revoke_access(
&self,
token_id: String,
expires_at: u64,
) -> BoxFuture<Result<(), TokenStoreError>>;
fn is_access_revoked(
&self,
token_id: String,
now: u64,
) -> BoxFuture<Result<bool, TokenStoreError>>;
fn purge_expired(&self, now: u64) -> BoxFuture<Result<(), TokenStoreError>>;
}Expand description
Atomic persistence contract required by refresh rotation and access revocation.
Required Methods§
fn insert_refresh( &self, record: RefreshRecord, ) -> BoxFuture<Result<(), TokenStoreError>>
fn find_refresh( &self, token_hash: String, now: u64, ) -> BoxFuture<Result<Option<RefreshRecord>, TokenStoreError>>
fn rotate_refresh( &self, token_hash: String, replacement_hash: String, replacement_expires_at: u64, now: u64, ) -> BoxFuture<Result<RotateRefresh, TokenStoreError>>
fn revoke_family( &self, family_id: String, expires_at: u64, ) -> BoxFuture<Result<(), TokenStoreError>>
fn is_family_revoked( &self, family_id: String, now: u64, ) -> BoxFuture<Result<bool, TokenStoreError>>
fn revoke_access( &self, token_id: String, expires_at: u64, ) -> BoxFuture<Result<(), TokenStoreError>>
fn is_access_revoked( &self, token_id: String, now: u64, ) -> BoxFuture<Result<bool, TokenStoreError>>
fn purge_expired(&self, now: u64) -> BoxFuture<Result<(), TokenStoreError>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".