Struct mas_storage_pg::oauth2::PgOAuth2ClientRepository
source · pub struct PgOAuth2ClientRepository<'c> { /* private fields */ }
Expand description
An implementation of OAuth2ClientRepository
for a PostgreSQL connection
Implementations§
source§impl<'c> PgOAuth2ClientRepository<'c>
impl<'c> PgOAuth2ClientRepository<'c>
sourcepub fn new(conn: &'c mut PgConnection) -> Self
pub fn new(conn: &'c mut PgConnection) -> Self
Create a new PgOAuth2ClientRepository
from an active PostgreSQL
connection
Trait Implementations§
source§impl<'c> OAuth2ClientRepository for PgOAuth2ClientRepository<'c>
impl<'c> OAuth2ClientRepository for PgOAuth2ClientRepository<'c>
§type Error = DatabaseError
type Error = DatabaseError
The error type returned by the repository
source§fn lookup<'life0, 'async_trait>(
&'life0 mut self,
id: Ulid,
) -> Pin<Box<dyn Future<Output = Result<Option<Client>, 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<Client>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lookup an OAuth2 client by its ID Read more
source§fn load_batch<'life0, 'async_trait>(
&'life0 mut self,
ids: BTreeSet<Ulid>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<Ulid, Client>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_batch<'life0, 'async_trait>(
&'life0 mut self,
ids: BTreeSet<Ulid>,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<Ulid, Client>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load a batch of OAuth2 clients by their IDs Read more
source§fn add<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
redirect_uris: Vec<Url>,
encrypted_client_secret: Option<String>,
application_type: Option<ApplicationType>,
grant_types: Vec<GrantType>,
client_name: Option<String>,
logo_uri: Option<Url>,
client_uri: Option<Url>,
policy_uri: Option<Url>,
tos_uri: Option<Url>,
jwks_uri: Option<Url>,
jwks: Option<PublicJsonWebKeySet>,
id_token_signed_response_alg: Option<JsonWebSignatureAlg>,
userinfo_signed_response_alg: Option<JsonWebSignatureAlg>,
token_endpoint_auth_method: Option<OAuthClientAuthenticationMethod>,
token_endpoint_auth_signing_alg: Option<JsonWebSignatureAlg>,
initiate_login_uri: Option<Url>,
) -> Pin<Box<dyn Future<Output = Result<Client, 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,
redirect_uris: Vec<Url>,
encrypted_client_secret: Option<String>,
application_type: Option<ApplicationType>,
grant_types: Vec<GrantType>,
client_name: Option<String>,
logo_uri: Option<Url>,
client_uri: Option<Url>,
policy_uri: Option<Url>,
tos_uri: Option<Url>,
jwks_uri: Option<Url>,
jwks: Option<PublicJsonWebKeySet>,
id_token_signed_response_alg: Option<JsonWebSignatureAlg>,
userinfo_signed_response_alg: Option<JsonWebSignatureAlg>,
token_endpoint_auth_method: Option<OAuthClientAuthenticationMethod>,
token_endpoint_auth_signing_alg: Option<JsonWebSignatureAlg>,
initiate_login_uri: Option<Url>,
) -> Pin<Box<dyn Future<Output = Result<Client, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Add a new OAuth2 client Read more
source§fn upsert_static<'life0, 'async_trait>(
&'life0 mut self,
client_id: Ulid,
client_auth_method: OAuthClientAuthenticationMethod,
encrypted_client_secret: Option<String>,
jwks: Option<PublicJsonWebKeySet>,
jwks_uri: Option<Url>,
redirect_uris: Vec<Url>,
) -> Pin<Box<dyn Future<Output = Result<Client, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_static<'life0, 'async_trait>(
&'life0 mut self,
client_id: Ulid,
client_auth_method: OAuthClientAuthenticationMethod,
encrypted_client_secret: Option<String>,
jwks: Option<PublicJsonWebKeySet>,
jwks_uri: Option<Url>,
redirect_uris: Vec<Url>,
) -> Pin<Box<dyn Future<Output = Result<Client, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Add or replace a static client Read more
source§fn all_static<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Client>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn all_static<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<Client>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all static clients Read more
source§fn get_consent_for_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
client: &'life1 Client,
user: &'life2 User,
) -> Pin<Box<dyn Future<Output = Result<Scope, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_consent_for_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
client: &'life1 Client,
user: &'life2 User,
) -> Pin<Box<dyn Future<Output = Result<Scope, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get the list of scopes that the user has given consent for the given
client Read more
source§fn give_consent_for_user<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
client: &'life3 Client,
user: &'life4 User,
scope: &'life5 Scope,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
fn give_consent_for_user<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 mut self,
rng: &'life1 mut (dyn RngCore + Send),
clock: &'life2 dyn Clock,
client: &'life3 Client,
user: &'life4 User,
scope: &'life5 Scope,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
Give consent for a set of scopes for the given client and user Read more
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,
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 a client by ID Read more
source§fn find_by_client_id<'life0, 'life1, 'async_trait>(
&'life0 mut self,
client_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Client>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn find_by_client_id<'life0, 'life1, 'async_trait>(
&'life0 mut self,
client_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Client>, Self::Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Find an OAuth2 client by its client ID
Auto Trait Implementations§
impl<'c> Freeze for PgOAuth2ClientRepository<'c>
impl<'c> !RefUnwindSafe for PgOAuth2ClientRepository<'c>
impl<'c> Send for PgOAuth2ClientRepository<'c>
impl<'c> Sync for PgOAuth2ClientRepository<'c>
impl<'c> Unpin for PgOAuth2ClientRepository<'c>
impl<'c> !UnwindSafe for PgOAuth2ClientRepository<'c>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more