Crate arclutevests
source ·Expand description
Arc Lute Vests - Load secrets from vault
Example
#[derive(Clone, Debug, Deserialize)]
struct TestData {
test_data: String,
}
#[tokio::main]
async fn main() -> Result<()> {
let test_data: TestData = secrets(&config).await?;
assert_eq!(test_data.test_data, "this isn't really secret");
match secrets::<TestData>(&config_bad).await {
Ok(_) => assert!(false, "This shouldn't happen"),
Err(e) => assert!(format!("{e}").starts_with("uri: /v1/s/error/authfailed, title: Authentication Failed, status: 500, detail: Vault was unable to authenticate the client")),
}
Ok(())
}
Structs
Functions
Get the secrets data from vault, given an approle and associated
role-id
.