#secret #vault #hashi-corp #read-write

vaultier

用于从Hashicorp Vault写入和读取机密的Crate

4个版本 (2个重大更改)

0.3.0 2024年3月21日
0.2.1 2023年10月20日
0.2.0 2023年9月19日
0.1.1 2023年9月6日

#378身份验证

Download history 168/week @ 2024-04-14 21/week @ 2024-04-21 3/week @ 2024-04-28 9/week @ 2024-05-05 41/week @ 2024-05-12 29/week @ 2024-05-26 25/week @ 2024-06-09 58/week @ 2024-06-16 42/week @ 2024-06-23 18/week @ 2024-07-14 62/week @ 2024-07-28

每月80次下载

MIT 许可证

14KB
242

Vaultier /slɒθ/ 🦥

一个小型Crate,用于从Hashicorp Vault读取机密。基于vaultrs

用法

use vaultier::SecretClient;
use serde::Deserialize;

#[derive(Deserialize)]
struct MySecrets {
    pub username: String,
    pub password: String,
}

let address = "<vault instance address>";
let mount = String::from("<mount>");
let base_path = String::from("<base_path>");

// With token or default feature enabled
let client = SecretClient::new(address, mount, base_path, None).unwrap();

// With auth feature enabled
let auth_mount = "<mount to vault auth>";
let role = "<your role>";
let client = SecretClient::create(address, auth_mount, role, mount, base_path).unwrap();

// read secrets from that base path
let secrets = client.read_secrets::<MySecrets>().await.unwrap();

// read secrets from the passed path relative to the base path: mount/data/base_path/my-secrets
let secrets = client.read_secrets_from::<MySecrets>("my-secrets").await.unwrap();

许可证

MIT

依赖项

~8–24MB
~334K SLoC