An open API service indexing awesome lists of open source software.

https://github.com/commercetools/vaultier

Vault secrets reader
https://github.com/commercetools/vaultier

Last synced: about 1 year ago
JSON representation

Vault secrets reader

Awesome Lists containing this project

README

          

# Vaultier `/slɒθ/` :sloth:

Small crate to read secrets from Hashicorp Vault. Based on [vaultrs](https://github.com/jmgilman/vaultrs).

## Usage

```rust
use vaultier::SecretClient;
use serde::Deserialize;

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

let address = "";
let mount = String::from("");
let base_path = String::from("");

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

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

// read secrets from that base path
let secrets = client.read_secrets::().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::("my-secrets").await.unwrap();

```

## License

[MIT](./LICENSE-MIT)