#login #vault #hashi-corp #client #api-client

vaultrs-login

Adds login support for Vault clients from vaultrs

10 releases

0.2.1 Mar 20, 2024
0.2.0 Mar 16, 2024
0.1.7 Mar 25, 2023
0.1.6 May 13, 2022
0.1.4 Sep 22, 2021

#377 in Authentication

Download history 1890/week @ 2024-03-15 981/week @ 2024-03-22 1162/week @ 2024-03-29 1067/week @ 2024-04-05 975/week @ 2024-04-12 1005/week @ 2024-04-19 1009/week @ 2024-04-26 329/week @ 2024-05-03 1077/week @ 2024-05-10 806/week @ 2024-05-17 880/week @ 2024-05-24 1651/week @ 2024-05-31 878/week @ 2024-06-07 1130/week @ 2024-06-14 641/week @ 2024-06-21 506/week @ 2024-06-28

3,354 downloads per month
Used in 2 crates

MIT license

465KB
10K SLoC

vaultrs-login

Adds login support for Vault clients from [vaultrs][1].

Installation

Add vaultrs-login as a dependency to your cargo.toml:

[dependencies]
vaultrs-login = "0.2.0"

Usage

use vaultrs::client::{VaultClient, VaultClientSettingsBuilder};
use vaultrs_login::LoginClient;
use vaultrs_login::engines::approle::AppRoleLogin;

// Create a client
let mut client = VaultClient::new(
    VaultClientSettingsBuilder::default()
        .address("https://127.0.0.1:8200")
        .build()
        .unwrap()
).unwrap();

// Use one of the login flows to obtain a token for the client
let role_id = String::from("my-role-id");
let secret_id = String::from("secret");
let login = AppRoleLogin { role_id, secret_id };

client.login("approle", &login).await; // Token is automatically set to client

Testing

Run tests with cargo:

cargo test

lib.rs:

vaultrs-login

Adds login support for Vault clients from [vaultrs][1].

Installation

Add vaultrs-login as a dependency to your cargo.toml:

[dependencies]
vaultrs-login = "0.2.0"

Usage

use vaultrs::client::{VaultClient, VaultClientSettingsBuilder};
use vaultrs_login::LoginClient;
use vaultrs_login::engines::approle::AppRoleLogin;

// Create a client
let mut client = VaultClient::new(
    VaultClientSettingsBuilder::default()
        .address("https://127.0.0.1:8200")
        .build()
        .unwrap()
).unwrap();

// Use one of the login flows to obtain a token for the client
let role_id = String::from("my-role-id");
let secret_id = String::from("secret");
let login = AppRoleLogin { role_id, secret_id };

client.login("approle", &login).await; // Token is automatically set to client

Testing

Run tests with cargo:

cargo test

Dependencies

~7–24MB
~361K SLoC