pub trait SecretStore: Send + Sync {
// Required methods
fn get_secret<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<SecretValue, SecretError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn secret_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<bool, SecretError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn list_secrets<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecretKey>, SecretError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn store_name(&self) -> &str;
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SecretError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Trait for pluggable secret storage backends.
Required Methods§
Sourcefn get_secret<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<SecretValue, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_secret<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<SecretValue, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get a secret by key.
Sourcefn secret_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<bool, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn secret_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 SecretKey,
) -> Pin<Box<dyn Future<Output = Result<bool, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Check if a secret exists.
Sourcefn list_secrets<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecretKey>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn list_secrets<'life0, 'life1, 'async_trait>(
&'life0 self,
prefix: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<Vec<SecretKey>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
List available secrets (if supported).
Sourcefn store_name(&self) -> &str
fn store_name(&self) -> &str
Get the store name for logging/debugging.
Sourcefn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn health_check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Check if the store is healthy/connected.