8 releases (1 stable)

1.0.0 Sep 26, 2024
0.5.0 Apr 25, 2024
0.4.0 Dec 21, 2023
0.3.1 Oct 13, 2023
0.1.0 Jan 31, 2023

#1072 in Authentication

Download history 2012/week @ 2025-08-17 2119/week @ 2025-08-24 1773/week @ 2025-08-31 2249/week @ 2025-09-07 2492/week @ 2025-09-14 2575/week @ 2025-09-21 2717/week @ 2025-09-28 3100/week @ 2025-10-05 3304/week @ 2025-10-12 2991/week @ 2025-10-19 1192/week @ 2025-10-26 1599/week @ 2025-11-02 1224/week @ 2025-11-09 1517/week @ 2025-11-16 1159/week @ 2025-11-23 1261/week @ 2025-11-30

5,205 downloads per month
Used in 3 crates

Custom license

2.5MB
51K SLoC

Bitwarden Secrets Manager SDK

A Rust client SDK to interact with the Bitwarden Secrets Manager. This is a beta release and might be missing some functionality.

Usage

[dependencies]
bitwarden = { "*", features = ["secrets"] }

Minimum Supported Rust Version

Rust 1.75 or higher.

Example

use bitwarden::{
    auth::login::AccessTokenLoginRequest,
    error::Result,
    secrets_manager::{secrets::SecretIdentifiersRequest, ClientSecretsExt},
    Client, ClientSettings, DeviceType,
};
use uuid::Uuid;

async fn test() -> Result<()> {
    // Use the default values
    let mut client = Client::new(None);

    // Or set your own values
    let settings = ClientSettings {
        identity_url: "https://identity.bitwarden.com".to_string(),
        api_url: "https://api.bitwarden.com".to_string(),
        user_agent: "Bitwarden Rust-SDK".to_string(),
        device_type: DeviceType::SDK,
    };
    let mut client = Client::new(Some(settings));

    // Before we operate, we need to authenticate with a token
    let token = AccessTokenLoginRequest {
        access_token: String::from(""),
        state_file: None,
    };
    client.auth().login_access_token(&token).await.unwrap();

    let org_id = SecretIdentifiersRequest {
        organization_id: Uuid::parse_str("00000000-0000-0000-0000-000000000000").unwrap(),
    };
    println!(
        "Stored secrets: {:#?}",
        client.secrets().list(&org_id).await.unwrap()
    );
    Ok(())
}

Dependencies

~18–37MB
~570K SLoC