Trait mz_secrets::SecretsReader

source ·
pub trait SecretsReader:
    Debug
    + Send
    + Sync {
    // Required method
    fn read<'life0, 'async_trait>(
        &'life0 self,
        id: CatalogItemId,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn read_string<'life0, 'async_trait>(
        &'life0 self,
        id: CatalogItemId,
    ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Securely reads secrets that are managed by a SecretsController.

Does not provide access to create, update, or delete the secrets within.

Required Methods§

source

fn read<'life0, 'async_trait>( &'life0 self, id: CatalogItemId, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the binary contents of the specified secret.

Provided Methods§

source

fn read_string<'life0, 'async_trait>( &'life0 self, id: CatalogItemId, ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the string contents of the specified secret.

Returns an error if the secret’s contents cannot be decoded as UTF-8.

Implementors§