Vault IAM Authentication

crates.io Released API docs MIT licensed

Tiny library for Vault authentication using the AWS IAM engine.

Example

The authenticate function returns a serde_json::Value of the standard Vault login API response body.

```rust use std::error::Error;

use serdejson::Value; use vaultiam_auth::{authenticate, Parameters};

[tokio::main]

async fn main() -> Result<(), Box> { let params = Parameters { iamserverid: None, mountpath: String::from("aws"), role: String::from("my-role"), vaultaddress: String::from("https://vault.address.com:8200"), };

let response: serde_json::Value = authenticate(&params).await?;

let token = response .get("auth") .unwrap() .get("clienttoken") .unwrap() .asstr() .unwrap(); println!("{}", token); Ok(()) } ```