pub trait UpstreamOAuthProviderRepository: Send + Sync {
    type Error;

    // Required methods
    fn lookup<'life0, 'async_trait>(
        &'life0 mut self,
        id: Ulid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        params: UpstreamOAuthProviderParams,
    ) -> Pin<Box<dyn Future<Output = Result<UpstreamOAuthProvider, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_by_id<'life0, 'async_trait>(
        &'life0 mut self,
        id: Ulid,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn upsert<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        clock: &'life1 dyn Clock,
        id: Ulid,
        params: UpstreamOAuthProviderParams,
    ) -> Pin<Box<dyn Future<Output = Result<UpstreamOAuthProvider, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn disable<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        clock: &'life1 dyn Clock,
        provider: UpstreamOAuthProvider,
    ) -> Pin<Box<dyn Future<Output = Result<UpstreamOAuthProvider, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        filter: UpstreamOAuthProviderFilter<'life1>,
        pagination: Pagination,
    ) -> Pin<Box<dyn Future<Output = Result<Page<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        filter: UpstreamOAuthProviderFilter<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn all_enabled<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn delete<'life0, 'async_trait>(
        &'life0 mut self,
        provider: UpstreamOAuthProvider,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

An UpstreamOAuthProviderRepository helps interacting with [UpstreamOAuthProvider] 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<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Lookup an upstream OAuth provider by its ID

Returns None if the provider was not found

§Parameters
  • id: The ID of the provider to lookup
§Errors

Returns Self::Error if the underlying repository fails

source

fn add<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, rng: &'life1 mut (dyn RngCore + Send), clock: &'life2 dyn Clock, params: UpstreamOAuthProviderParams, ) -> Pin<Box<dyn Future<Output = Result<UpstreamOAuthProvider, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add a new upstream OAuth provider

Returns the newly created provider

§Parameters
  • rng: A random number generator
  • clock: The clock used to generate timestamps
  • params: The parameters of the provider to add
§Errors

Returns Self::Error if the underlying repository fails

source

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

Delete an upstream OAuth provider by its ID

§Parameters
  • id: The ID of the provider to delete
§Errors

Returns Self::Error if the underlying repository fails

source

fn upsert<'life0, 'life1, 'async_trait>( &'life0 mut self, clock: &'life1 dyn Clock, id: Ulid, params: UpstreamOAuthProviderParams, ) -> Pin<Box<dyn Future<Output = Result<UpstreamOAuthProvider, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Insert or update an upstream OAuth provider

§Parameters
  • clock: The clock used to generate timestamps
  • id: The ID of the provider to update
  • params: The parameters of the provider to update
§Errors

Returns Self::Error if the underlying repository fails

source

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

Disable an upstream OAuth provider

Returns the disabled provider

§Parameters
  • clock: The clock used to generate timestamps
  • provider: The provider to disable
§Errors

Returns Self::Error if the underlying repository fails

source

fn list<'life0, 'life1, 'async_trait>( &'life0 mut self, filter: UpstreamOAuthProviderFilter<'life1>, pagination: Pagination, ) -> Pin<Box<dyn Future<Output = Result<Page<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List [UpstreamOAuthProvider] with the given filter and pagination

§Parameters
  • filter: The filter to apply
  • pagination: The pagination parameters
§Errors

Returns Self::Error if the underlying repository fails

source

fn count<'life0, 'life1, 'async_trait>( &'life0 mut self, filter: UpstreamOAuthProviderFilter<'life1>, ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Count the number of [UpstreamOAuthProvider] with the given filter

§Parameters
  • filter: The filter to apply
§Errors

Returns Self::Error if the underlying repository fails

source

fn all_enabled<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all enabled upstream OAuth providers

§Errors

Returns Self::Error if the underlying repository fails

Provided Methods§

source

fn delete<'life0, 'async_trait>( &'life0 mut self, provider: UpstreamOAuthProvider, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Delete an upstream OAuth provider

§Parameters
  • provider: The provider to delete
§Errors

Returns Self::Error if the underlying repository fails

Implementations on Foreign Types§

source§

impl<R> UpstreamOAuthProviderRepository for Box<R>

§

type Error = <R as UpstreamOAuthProviderRepository>::Error

source§

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

source§

fn add<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, rng: &'life1 mut (dyn RngCore + Send), clock: &'life2 dyn Clock, params: UpstreamOAuthProviderParams, ) -> Pin<Box<dyn Future<Output = Result<UpstreamOAuthProvider, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source§

fn upsert<'life0, 'life1, 'async_trait>( &'life0 mut self, clock: &'life1 dyn Clock, id: Ulid, params: UpstreamOAuthProviderParams, ) -> Pin<Box<dyn Future<Output = Result<UpstreamOAuthProvider, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn delete<'life0, 'async_trait>( &'life0 mut self, provider: UpstreamOAuthProvider, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

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

source§

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

source§

fn list<'life0, 'life1, 'async_trait>( &'life0 mut self, filter: UpstreamOAuthProviderFilter<'life1>, pagination: Pagination, ) -> Pin<Box<dyn Future<Output = Result<Page<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn count<'life0, 'life1, 'async_trait>( &'life0 mut self, filter: UpstreamOAuthProviderFilter<'life1>, ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn all_enabled<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<UpstreamOAuthProvider>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§