b2creds

b2creds is a simple library built to access the credentials for BackBlaze APIs. It mimics the access patterns of the b2 CLI tool and thus should work on any machine where a user has logged in with the b2 CLI.

By default, b2creds will search in the following locations:

  1. In the B2APPLICATIONKEY and B2APPLICATIONKEY_ID environmentals variables

  2. In the sqlite database pointed to by the environmental variable B2ACCOUNTINFO

  3. In the default sqlite database ~/.b2accountinfo

rust let creds = b2creds::Credentials::default().unwrap(); println!("Key ID: {} Key: {}", creds.application_key_id, creds.application_key);