Expand description

Coult, is crate to getting from hashicorp vault

Usage

Coult use hyper client instead of reqwest for more simpler and lightweight crate, it will help you to send GET request to Vault for retrieving the secret. This crate will help you to automatically parsing using serde, and make sure your struct has Deserialize derive.

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 vault = Vault::new().build().await.unwrap();
  let data = vault.get_secret::<Secret>().await.unwrap(); // for v1, get_secret_v2
  println!("{:?}", data)
}

Re-exports

pub use client::Vault;

Modules

Client instance to get secret from Hashicorp Vault

HTTP response that maybe happen in Vault

Schema is response struct from hashicorp vault when we hit /v1/secret/path