credentials 0.12.0

Fetch secrets from either environment variables or Hashicorp's Vault
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Generic interface to secret storage backends.

use crate::errors::*;
use crate::secretfile::Secretfile;

/// Generic interface to a secret-storage backend.
pub trait Backend: Send + Sync {
    /// Return the name of this backend.
    fn name(&self) -> &'static str;

    /// Get the value of the specified secret.
    fn var(&mut self, secretfile: &Secretfile, credential: &str) -> Result<String>;

    /// Get the value of the specified credential file.
    fn file(&mut self, secretfile: &Secretfile, path: &str) -> Result<String>;
}