Skip to main content

SecretSource

Trait SecretSource 

Source
pub trait SecretSource: Send + Sync {
    // Required methods
    fn load(&self) -> Result<HashMap<String, String>, SecretError>;
    fn source_name(&self) -> &str;
}
Expand description

A source of key-value secret pairs.

Implementations may read from a file, the system environment, a remote vault, or any other backing store. Each call to load returns a fresh snapshot; sources are expected to be cheap to call repeatedly.

Required Methods§

Source

fn load(&self) -> Result<HashMap<String, String>, SecretError>

Load all secrets from this source.

Returns a map of variable names to their string values.

Source

fn source_name(&self) -> &str

Human-readable name used in error messages and diagnostics.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§