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 SecretKey,
    ) -> Pin<Box<dyn Future<Output = SecretResult<SecretValue>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn secret_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 SecretKey,
    ) -> Pin<Box<dyn Future<Output = SecretResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_secrets<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prefix: Option<&'life1 str>,
    ) -> Pin<Box<dyn Future<Output = SecretResult<Vec<SecretKey>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn store_name(&self) -> &str;
    fn health_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = SecretResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for pluggable secret storage backends.

Required Methods§

Source

fn get_secret<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 SecretKey, ) -> Pin<Box<dyn Future<Output = SecretResult<SecretValue>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get a secret by key.

Source

fn secret_exists<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 SecretKey, ) -> Pin<Box<dyn Future<Output = SecretResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a secret exists.

Source

fn list_secrets<'life0, 'life1, 'async_trait>( &'life0 self, prefix: Option<&'life1 str>, ) -> Pin<Box<dyn Future<Output = SecretResult<Vec<SecretKey>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List available secrets (if supported).

Source

fn store_name(&self) -> &str

Get the store name for logging/debugging.

Source

fn health_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = SecretResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if the store is healthy/connected.

Implementors§