pub struct AuthCredentialStore { /* private fields */ }Expand description
Credential store for authentication data.
Wraps CredentialStore with profile management.
Implementations§
Source§impl AuthCredentialStore
impl AuthCredentialStore
Sourcepub fn store_oauth_token(
&mut self,
profile_id: &str,
token: &OAuthToken,
) -> Result<(), AuthError>
pub fn store_oauth_token( &mut self, profile_id: &str, token: &OAuthToken, ) -> Result<(), AuthError>
Sourcepub fn load_oauth_token(
&self,
profile_id: &str,
) -> Result<OAuthToken, AuthError>
pub fn load_oauth_token( &self, profile_id: &str, ) -> Result<OAuthToken, AuthError>
Load an OAuth token for a profile.
§Errors
Returns error if profile not found, decryption fails, or token expired.
Sourcepub fn set_profile(&mut self, profile: AuthProfile) -> Result<(), AuthError>
pub fn set_profile(&mut self, profile: AuthProfile) -> Result<(), AuthError>
Add or update an auth profile.
Sourcepub fn get_profile(&self, profile_id: &str) -> Option<&AuthProfile>
pub fn get_profile(&self, profile_id: &str) -> Option<&AuthProfile>
Get an auth profile.
Sourcepub fn get_profile_mut(&mut self, profile_id: &str) -> Option<&mut AuthProfile>
pub fn get_profile_mut(&mut self, profile_id: &str) -> Option<&mut AuthProfile>
Get a mutable auth profile.
Sourcepub fn list_profiles(&self) -> Vec<&AuthProfile>
pub fn list_profiles(&self) -> Vec<&AuthProfile>
List all profiles.
Sourcepub fn profiles_for_target(&self, target: &str) -> Vec<&AuthProfile>
pub fn profiles_for_target(&self, target: &str) -> Vec<&AuthProfile>
List profiles for a specific target (channel or provider).
Sourcepub fn active_profile_for_target(&self, target: &str) -> Option<&AuthProfile>
pub fn active_profile_for_target(&self, target: &str) -> Option<&AuthProfile>
Get the active profile for a target.
Auto Trait Implementations§
impl Freeze for AuthCredentialStore
impl RefUnwindSafe for AuthCredentialStore
impl Send for AuthCredentialStore
impl Sync for AuthCredentialStore
impl Unpin for AuthCredentialStore
impl UnwindSafe for AuthCredentialStore
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