CloudSecretManager

Trait CloudSecretManager 

Source
pub trait CloudSecretManager: Send + Sync {
    // Required methods
    fn get_secret<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<SecretValue, CloudError>> + 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>, CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn create_secret<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        value: &'life2 SecretValue,
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
    fn update_secret<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        value: &'life2 SecretValue,
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + 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,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;

    // Provided methods
    fn rotate_secret<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        new_value: &'life2 SecretValue,
    ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait { ... }
    fn get_secret_metadata<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<SecretMetadata, CloudError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait { ... }
}
Expand description

Unified trait for cloud secret management.

This trait provides a consistent interface for managing secrets across different cloud providers (AWS, GCP, Azure).

Required Methods§

Source

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

Fetches a secret by name.

§Arguments
  • name - The name/ID of the secret to fetch
§Returns

Returns the secret value if found.

§Errors

Returns CloudError::SecretNotFound if the secret doesn’t exist. Returns CloudError::SecretFetch if the fetch operation fails.

Source

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

Lists all secret names.

§Returns

Returns a vector of secret names/IDs.

§Errors

Returns CloudError::SecretList if the list operation fails.

Source

fn create_secret<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, value: &'life2 SecretValue, ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Creates a new secret.

§Arguments
  • name - The name/ID for the new secret
  • value - The secret value to store
§Errors

Returns CloudError::SecretCreate if the create operation fails.

Source

fn update_secret<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, value: &'life2 SecretValue, ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Updates an existing secret.

§Arguments
  • name - The name/ID of the secret to update
  • value - The new secret value
§Errors

Returns CloudError::SecretUpdate if the update operation fails.

Source

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

Deletes a secret.

§Arguments
  • name - The name/ID of the secret to delete
§Errors

Returns CloudError::SecretDelete if the delete operation fails.

Provided Methods§

Source

fn rotate_secret<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, new_value: &'life2 SecretValue, ) -> Pin<Box<dyn Future<Output = Result<(), CloudError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Rotates a secret (creates a new version).

Default implementation calls update_secret.

§Arguments
  • name - The name/ID of the secret to rotate
  • new_value - The new secret value
§Errors

Returns CloudError::SecretUpdate if the rotation fails.

Source

fn get_secret_metadata<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<SecretMetadata, CloudError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Gets secret metadata without fetching the value.

Default implementation fetches the secret and discards the value. Providers should override this for efficiency.

§Arguments
  • name - The name/ID of the secret
§Errors

Returns CloudError::SecretFetch if the operation fails.

Implementors§