pub struct OAuthCredentialStore { /* private fields */ }Expand description
OAuth credential store that persists credentials in the OS keychain
and directly implements rmcp’s CredentialStore trait.
Each server/provider ID maps to its own keychain entry.
Implementations§
Source§impl OAuthCredentialStore
impl OAuthCredentialStore
Sourcepub fn new(server_id: &str) -> OAuthCredentialStore
pub fn new(server_id: &str) -> OAuthCredentialStore
Create a new store for the given server/provider ID.
Sourcepub async fn load_credential(
&self,
) -> Result<Option<OAuthCredential>, OAuthError>
pub async fn load_credential( &self, ) -> Result<Option<OAuthCredential>, OAuthError>
Load the raw OAuthCredential for this store’s server ID.
Sourcepub async fn save_credential(
&self,
credential: OAuthCredential,
) -> Result<(), OAuthError>
pub async fn save_credential( &self, credential: OAuthCredential, ) -> Result<(), OAuthError>
Save a raw OAuthCredential directly, keyed by this store’s server ID.
Sourcepub fn has_credential(server_id: &str) -> bool
pub fn has_credential(server_id: &str) -> bool
Check synchronously whether credentials exist for a given server ID.
Trait Implementations§
Source§impl Clone for OAuthCredentialStore
impl Clone for OAuthCredentialStore
Source§fn clone(&self) -> OAuthCredentialStore
fn clone(&self) -> OAuthCredentialStore
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 CredentialStore for OAuthCredentialStore
impl CredentialStore for OAuthCredentialStore
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredCredentials>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OAuthCredentialStore: 'async_trait,
fn save<'life0, 'async_trait>(
&'life0 self,
credentials: StoredCredentials,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OAuthCredentialStore: 'async_trait,
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
OAuthCredentialStore: 'async_trait,
Source§impl Default for OAuthCredentialStore
impl Default for OAuthCredentialStore
Source§fn default() -> OAuthCredentialStore
fn default() -> OAuthCredentialStore
Returns the “default value” for a type. Read more
Source§impl OAuthCredentialStorage for OAuthCredentialStore
impl OAuthCredentialStorage for OAuthCredentialStore
async fn load_credential( &self, server_id: &str, ) -> Result<Option<OAuthCredential>, OAuthError>
async fn save_credential( &self, server_id: &str, credential: OAuthCredential, ) -> Result<(), OAuthError>
fn has_credential(&self, server_id: &str) -> bool
Auto Trait Implementations§
impl Freeze for OAuthCredentialStore
impl RefUnwindSafe for OAuthCredentialStore
impl Send for OAuthCredentialStore
impl Sync for OAuthCredentialStore
impl Unpin for OAuthCredentialStore
impl UnsafeUnpin for OAuthCredentialStore
impl UnwindSafe for OAuthCredentialStore
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