BrokerStore

Trait BrokerStore 

Source
pub trait BrokerStore
where Self: Send + Sync,
{ // Required methods fn save(&self, record: TokenRecord) -> StoreFuture<'_, ()>; fn fetch<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, ) -> StoreFuture<'a, Option<TokenRecord>>; fn compare_and_swap_refresh<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, expected_refresh: Option<&'a str>, replacement: TokenRecord, ) -> StoreFuture<'a, CompareAndSwapOutcome>; fn revoke<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, instant: OffsetDateTime, ) -> StoreFuture<'a, Option<TokenRecord>>; }
Expand description

Storage backend contract implemented by broker token stores.

Required Methods§

Source

fn save(&self, record: TokenRecord) -> StoreFuture<'_, ()>

Persists or replaces a token record for the provided family + scope.

Source

fn fetch<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, ) -> StoreFuture<'a, Option<TokenRecord>>

Fetches the record associated with the family + scope, if present.

Source

fn compare_and_swap_refresh<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, expected_refresh: Option<&'a str>, replacement: TokenRecord, ) -> StoreFuture<'a, CompareAndSwapOutcome>

Atomically rotates a refresh token if the expected secret matches.

Source

fn revoke<'a>( &'a self, family: &'a TokenFamily, scope: &'a ScopeSet, instant: OffsetDateTime, ) -> StoreFuture<'a, Option<TokenRecord>>

Marks a record as revoked at the provided instant.

Implementors§