Skip to main content

SecretProvider

Trait SecretProvider 

Source
pub trait SecretProvider: Send + Sync {
    // Required methods
    fn get(
        &self,
        path: &str,
        key: Option<&str>,
    ) -> impl Future<Output = SecretsResult<SecretValue>> + Send;
    fn health_check(&self) -> impl Future<Output = SecretsResult<()>> + Send;
    fn name(&self) -> &'static str;
}
Available on crate feature secrets only.
Expand description

Trait for secret providers.

Required Methods§

Source

fn get( &self, path: &str, key: Option<&str>, ) -> impl Future<Output = SecretsResult<SecretValue>> + Send

Get a secret by path/key.

Source

fn health_check(&self) -> impl Future<Output = SecretsResult<()>> + Send

Check if the provider is healthy/reachable.

Source

fn name(&self) -> &'static str

Provider name for logging.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§