Skip to main content

SecretStore

Trait SecretStore 

Source
pub trait SecretStore: Send + Sync {
    // Required methods
    fn get_secret<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Secret, SecretError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_secrets<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, SecretError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for secrets backend implementations

Required Methods§

Source

fn get_secret<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Secret, SecretError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve a secret by key

§Arguments
  • key - The secret key to retrieve
§Returns
  • Ok(Secret) - The secret if found
  • Err(SecretError) - Error if secret not found or other failure
Source

fn list_secrets<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, SecretError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all available secret keys

§Returns
  • Ok(Vec<String>) - List of secret keys
  • Err(SecretError) - Error if operation fails

Implementors§