pub trait SecretProvider: Send + Sync {
// Required methods
fn get_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SecretValue>, ContextError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn set_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
value: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn delete_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ContextError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn name(&self) -> &'static str;
// Provided methods
fn has_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ContextError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn is_read_only(&self) -> bool { ... }
}Expand description
Trait for secret providers.
All secret values are wrapped in Zeroizing<String> to ensure
they are cleared from memory when no longer needed.
Required Methods§
Sourcefn get_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SecretValue>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SecretValue>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get a secret value.
Returns None if the secret doesn’t exist.
Sourcefn set_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
value: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
value: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set a secret value.
Sourcefn delete_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete a secret.
Provided Methods§
Sourcefn has_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn has_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Check if a secret exists.
Sourcefn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Check if this provider is read-only.