Skip to main content

Vault

Trait Vault 

Source
pub trait Vault: Binding {
    // Required methods
    fn get_secret<'life0, 'life1, 'async_trait>(
        &'life0 self,
        secret_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, AlienError<ErrorData>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn set_secret<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        secret_name: &'life1 str,
        value: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), AlienError<ErrorData>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn delete_secret<'life0, 'life1, 'async_trait>(
        &'life0 self,
        secret_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), AlienError<ErrorData>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn list_secrets<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, AlienError<ErrorData>>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

A trait for vault bindings that provide secure secret management.

Required Methods§

Source

fn get_secret<'life0, 'life1, 'async_trait>( &'life0 self, secret_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String, AlienError<ErrorData>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Gets a secret value by name.

Source

fn set_secret<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, secret_name: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), AlienError<ErrorData>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Sets a secret value, creating it if it doesn’t exist or updating it if it does.

Source

fn delete_secret<'life0, 'life1, 'async_trait>( &'life0 self, secret_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), AlienError<ErrorData>>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Deletes a secret by name.

Source

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

Lists the names of all secrets stored in this vault.

Returned names are in the vault’s own namespace (any provider-specific prefix is stripped), so each name can be passed straight back to Vault::get_secret.

Implementations backed by a flat namespace (a single string prefix with no reserved separator, e.g. "{vault_prefix}-{secret_name}") cannot implement this safely with a prefix/BeginsWith scan: a vault named "app" would also match a sibling vault named "app-prod", aliasing across vaults. Such providers should return OperationNotSupported rather than list under this hazard.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§