pub trait CompatRefreshTokenRepository: Send + Sync {
    type Error;

    // Required methods
    fn lookup<'life0, 'async_trait>(
        &'life0 mut self,
        id: Ulid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CompatRefreshToken>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_by_token<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        refresh_token: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<CompatRefreshToken>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        compat_session: &'life3 CompatSession,
        compat_access_token: &'life4 CompatAccessToken,
        token: String,
    ) -> Pin<Box<dyn Future<Output = Result<CompatRefreshToken, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait;
    fn consume<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        clock: &'life1 dyn Clock,
        compat_refresh_token: CompatRefreshToken,
    ) -> Pin<Box<dyn Future<Output = Result<CompatRefreshToken, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A CompatRefreshTokenRepository helps interacting with [CompatRefreshToken] saved in the storage backend

Required Associated Types§

source

type Error

The error type returned by the repository

Required Methods§

source

fn lookup<'life0, 'async_trait>( &'life0 mut self, id: Ulid, ) -> Pin<Box<dyn Future<Output = Result<Option<CompatRefreshToken>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lookup a compat refresh token by its ID

Returns the compat refresh token if it exists, None otherwise

§Parameters
  • id: The ID of the compat refresh token to lookup
§Errors

Returns Self::Error if the underlying repository fails

source

fn find_by_token<'life0, 'life1, 'async_trait>( &'life0 mut self, refresh_token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<CompatRefreshToken>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find a compat refresh token by its token

Returns the compat refresh token if found, None otherwise

§Parameters
  • refresh_token: The token of the compat refresh token to lookup
§Errors

Returns Self::Error if the underlying repository fails

source

fn add<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, rng: &'life1 mut (dyn RngCore + Send), clock: &'life2 dyn Clock, compat_session: &'life3 CompatSession, compat_access_token: &'life4 CompatAccessToken, token: String, ) -> Pin<Box<dyn Future<Output = Result<CompatRefreshToken, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Add a new compat refresh token to the database

Returns the newly created compat refresh token

§Parameters
  • rng: The random number generator to use
  • clock: The clock used to generate timestamps
  • compat_session: The compat session associated with this refresh token
  • compat_access_token: The compat access token created alongside this refresh token
  • token: The token of the refresh token
source

fn consume<'life0, 'life1, 'async_trait>( &'life0 mut self, clock: &'life1 dyn Clock, compat_refresh_token: CompatRefreshToken, ) -> Pin<Box<dyn Future<Output = Result<CompatRefreshToken, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Consume a compat refresh token

Returns the consumed compat refresh token

§Parameters
  • clock: The clock used to generate timestamps
  • compat_refresh_token: The compat refresh token to consume
§Errors

Returns Self::Error if the underlying repository fails

Implementations on Foreign Types§

source§

impl<R> CompatRefreshTokenRepository for Box<R>

§

type Error = <R as CompatRefreshTokenRepository>::Error

source§

fn lookup<'life0, 'async_trait>( &'life0 mut self, id: Ulid, ) -> Pin<Box<dyn Future<Output = Result<Option<CompatRefreshToken>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn find_by_token<'life0, 'life1, 'async_trait>( &'life0 mut self, refresh_token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<CompatRefreshToken>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn add<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, rng: &'life1 mut (dyn RngCore + Send), clock: &'life2 dyn Clock, compat_session: &'life3 CompatSession, compat_access_token: &'life4 CompatAccessToken, token: String, ) -> Pin<Box<dyn Future<Output = Result<CompatRefreshToken, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

source§

fn consume<'life0, 'life1, 'async_trait>( &'life0 mut self, clock: &'life1 dyn Clock, compat_refresh_token: CompatRefreshToken, ) -> Pin<Box<dyn Future<Output = Result<CompatRefreshToken, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§