coult

Crates.iocoult
lib.rscoult
version0.2.5
sourcesrc
created_at2021-10-18 01:03:06.143941
updated_at2022-08-03 11:05:49.84494
descriptionHashicorp vault secret retrival helper, using hyper and serde, and automatically parsing.
homepagehttps://github.com/guaychou/coult
repositoryhttps://github.com/guaychou/coult
max_upload_size
id466483
size14,602
Kevin Jonathan Harnanta (guaychou)

documentation

README

Coult

Rust vault secret retriever

Example

use coult::{Config, Vault};
use serde::Deserialize;
#[derive(Debug, Deserialize)]
struct Secret {
    password: String,
}

#[tokio::main]
async fn main() {
    tracing_subscriber::fmt::init();
    let config = Config::new(
    "http".to_string(),                           # Vault Http Protocol http/https
    "127.0.0.1".to_string(),                      # Vault Host
     8200,                                        # Port
    "config/path".to_string(),                    # Secret Path
    "vault-plaintext-root-tokenzqwe".to_string(), # Vault Token
    );
    let vault = Vault::new(config).await.unwrap();
    let data = vault.get_secret::<Secret>().await.unwrap();
    println!("{:?}", data)
}

Commit count: 19

cargo fmt