pub struct CredentialManager { /* private fields */ }Expand description
Credential manager that aggregates multiple providers
Implementations§
Source§impl CredentialManager
impl CredentialManager
Sourcepub fn new(config: CredentialConfig) -> Self
pub fn new(config: CredentialConfig) -> Self
Create a new credential manager
Sourcepub fn builder() -> CredentialManagerBuilder
pub fn builder() -> CredentialManagerBuilder
Create a builder
Sourcepub fn add_provider(&mut self, provider: Box<dyn CredentialProvider>)
pub fn add_provider(&mut self, provider: Box<dyn CredentialProvider>)
Add a provider
Sourcepub fn get_credential(
&self,
key: &str,
) -> Result<DatabaseCredential, CredentialError>
pub fn get_credential( &self, key: &str, ) -> Result<DatabaseCredential, CredentialError>
Get credential by key
Sourcepub fn get_credential_from(
&self,
key: &str,
provider_name: &str,
) -> Result<DatabaseCredential, CredentialError>
pub fn get_credential_from( &self, key: &str, provider_name: &str, ) -> Result<DatabaseCredential, CredentialError>
Get credential with specific provider
Sourcepub fn refresh_credential(
&self,
key: &str,
) -> Result<DatabaseCredential, CredentialError>
pub fn refresh_credential( &self, key: &str, ) -> Result<DatabaseCredential, CredentialError>
Refresh credential
Sourcepub fn list_credentials(&self) -> Vec<(String, String)>
pub fn list_credentials(&self) -> Vec<(String, String)>
List all available credentials
Sourcepub fn invalidate(&self, key: &str)
pub fn invalidate(&self, key: &str)
Invalidate cached credential
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear credential cache
Sourcepub fn cache_stats(&self) -> CacheStats
pub fn cache_stats(&self) -> CacheStats
Get cache statistics
Auto Trait Implementations§
impl Freeze for CredentialManager
impl !RefUnwindSafe for CredentialManager
impl Send for CredentialManager
impl Sync for CredentialManager
impl Unpin for CredentialManager
impl UnsafeUnpin for CredentialManager
impl !UnwindSafe for CredentialManager
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> 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