12 releases

0.2.3 Feb 21, 2025
0.2.2 Nov 11, 2024
0.2.1 Mar 20, 2024
0.1.7 Mar 25, 2023
0.1.4 Sep 22, 2021

#646 in Authentication

Download history 1507/week @ 2024-12-08 701/week @ 2024-12-15 234/week @ 2024-12-22 260/week @ 2024-12-29 551/week @ 2025-01-05 355/week @ 2025-01-12 865/week @ 2025-01-19 551/week @ 2025-01-26 872/week @ 2025-02-02 970/week @ 2025-02-09 1600/week @ 2025-02-16 1418/week @ 2025-02-23 1344/week @ 2025-03-02 1490/week @ 2025-03-09 1117/week @ 2025-03-16 1219/week @ 2025-03-23

5,194 downloads per month
Used in 2 crates

MIT license

470KB
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.3"

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
~332K SLoC