pub struct CredentialStore {
pub store: SavedCredentialStore,
}Expand description
High-level credential management
Fields§
§store: SavedCredentialStoreImplementations§
Source§impl CredentialStore
impl CredentialStore
Sourcepub fn create_credential(
&self,
name: String,
api_key: &str,
template_type: TemplateType,
) -> Result<SavedCredential>
pub fn create_credential( &self, name: String, api_key: &str, template_type: TemplateType, ) -> Result<SavedCredential>
Create and save a new credential
Sourcepub fn get_api_key(&self, credential: &SavedCredential) -> Result<String>
pub fn get_api_key(&self, credential: &SavedCredential) -> Result<String>
Get the API key from a credential
Sourcepub fn has_api_key(&self, api_key: &str, template_type: &TemplateType) -> bool
pub fn has_api_key(&self, api_key: &str, template_type: &TemplateType) -> bool
Check if API key already exists for this template type
Sourcepub fn get_endpoint_ids(
&self,
template_type: &TemplateType,
) -> Vec<(String, String)>
pub fn get_endpoint_ids( &self, template_type: &TemplateType, ) -> Vec<(String, String)>
Get saved endpoint IDs for a template type (from credential metadata)
Sourcepub fn save_endpoint_id(
&self,
credential_id: &str,
endpoint_id: &str,
) -> Result<()>
pub fn save_endpoint_id( &self, credential_id: &str, endpoint_id: &str, ) -> Result<()>
Save endpoint ID to credential metadata
Sourcepub fn has_endpoint_id(
&self,
endpoint_id: &str,
template_type: &TemplateType,
) -> bool
pub fn has_endpoint_id( &self, endpoint_id: &str, template_type: &TemplateType, ) -> bool
Check if endpoint ID exists
Trait Implementations§
Source§impl CredentialManager for CredentialStore
impl CredentialManager for CredentialStore
Source§fn save_credential(
&self,
name: String,
api_key: &str,
template_type: TemplateType,
) -> Result<()>
fn save_credential( &self, name: String, api_key: &str, template_type: TemplateType, ) -> Result<()>
Save a credential
Source§fn load_credentials(&self) -> Result<Vec<SavedCredential>>
fn load_credentials(&self) -> Result<Vec<SavedCredential>>
Load all stored credentials
Source§fn clear_credentials(&self) -> Result<()>
fn clear_credentials(&self) -> Result<()>
Clear all credentials
Auto Trait Implementations§
impl Freeze for CredentialStore
impl RefUnwindSafe for CredentialStore
impl Send for CredentialStore
impl Sync for CredentialStore
impl Unpin for CredentialStore
impl UnwindSafe for CredentialStore
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