CredentialStore

Struct CredentialStore 

Source
pub struct CredentialStore {
    pub store: SavedCredentialStore,
}
Expand description

High-level credential management

Fields§

§store: SavedCredentialStore

Implementations§

Source§

impl CredentialStore

Source

pub fn new() -> Result<Self>

Create a new credential store

Source

pub fn create_credential( &self, name: String, api_key: &str, template_type: TemplateType, ) -> Result<SavedCredential>

Create and save a new credential

Source

pub fn get_api_key(&self, credential: &SavedCredential) -> Result<String>

Get the API key from a credential

Source

pub fn update_name(&self, credential_id: &str, new_name: String) -> Result<()>

Update credential name

Source

pub fn update_metadata( &self, credential_id: &str, metadata: HashMap<String, String>, ) -> Result<()>

Update credential metadata

Trait Implementations§

Source§

impl CredentialManager for CredentialStore

Source§

fn save_credential( &self, name: String, api_key: &str, template_type: TemplateType, ) -> Result<()>

Save a credential
Source§

fn load_credentials(&self) -> Result<Vec<SavedCredential>>

Load all stored credentials
Source§

fn delete_credential(&self, credential_id: &str) -> Result<()>

Delete a credential by ID
Source§

fn clear_credentials(&self) -> Result<()>

Clear all credentials

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.