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§
Required Methods§
sourcefn 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 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
sourcefn 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 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 generatorclock
: The clock used to generate timestampsparams
: The parameters of the provider to add
§Errors
Returns Self::Error
if the underlying repository fails
sourcefn 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 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
sourcefn 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 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 timestampsid
: The ID of the provider to updateparams
: The parameters of the provider to update
§Errors
Returns Self::Error
if the underlying repository fails
sourcefn 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 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 timestampsprovider
: The provider to disable
§Errors
Returns Self::Error
if the underlying repository fails
sourcefn 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 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 applypagination
: The pagination parameters
§Errors
Returns Self::Error
if the underlying repository fails
sourcefn 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 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
sourcefn 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,
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§
sourcefn 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,
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