pub struct OAuth2ClientRepository { /* private fields */ }Expand description
Repository for multiple OAuth2 client registrations
Similar to Spring Security’s ClientRegistrationRepository.
Implementations§
Source§impl OAuth2ClientRepository
impl OAuth2ClientRepository
Sourcepub fn new() -> OAuth2ClientRepository
pub fn new() -> OAuth2ClientRepository
Create a new empty repository
Sourcepub fn add_client(&mut self, client: OAuth2Client)
pub fn add_client(&mut self, client: OAuth2Client)
Add a client registration
Sourcepub fn get_client(&self, registration_id: &str) -> Option<&OAuth2Client>
pub fn get_client(&self, registration_id: &str) -> Option<&OAuth2Client>
Get a client by registration ID
Sourcepub fn registration_ids(&self) -> Vec<&String>
pub fn registration_ids(&self) -> Vec<&String>
Get all registration IDs
Sourcepub async fn from_configs(
configs: Vec<OAuth2Config>,
) -> Result<OAuth2ClientRepository, OAuth2Error>
pub async fn from_configs( configs: Vec<OAuth2Config>, ) -> Result<OAuth2ClientRepository, OAuth2Error>
Build a repository from multiple configurations
Trait Implementations§
Source§impl Clone for OAuth2ClientRepository
impl Clone for OAuth2ClientRepository
Source§fn clone(&self) -> OAuth2ClientRepository
fn clone(&self) -> OAuth2ClientRepository
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for OAuth2ClientRepository
impl Default for OAuth2ClientRepository
Source§fn default() -> OAuth2ClientRepository
fn default() -> OAuth2ClientRepository
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OAuth2ClientRepository
impl RefUnwindSafe for OAuth2ClientRepository
impl Send for OAuth2ClientRepository
impl Sync for OAuth2ClientRepository
impl Unpin for OAuth2ClientRepository
impl UnwindSafe for OAuth2ClientRepository
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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