pub struct BitwConfig {
pub api_url: String,
pub identity_url: String,
pub client_id: String,
pub client_secret: String,
}Expand description
Bitwarden pull configuration.
Auth uses the client_credentials grant against the Bitwarden identity
endpoint. The machine token does not carry the master password, so
cipher values returned by the REST sync endpoint are E2E-encrypted and
cannot be decrypted in-process. This crate uses the bw CLI subprocess
to unlock and list items, which handles local decryption after bw unlock.
§Environment variables
| Variable | Description |
|---|---|
TSAFE_BW_CLIENT_ID | Bitwarden API client ID (org or personal) |
TSAFE_BW_CLIENT_SECRET | Bitwarden API client secret |
TSAFE_BW_PASSWORD | Master password for bw unlock |
Fields§
§api_url: StringBitwarden API base URL (default: https://api.bitwarden.com).
identity_url: StringBitwarden identity base URL (default: https://identity.bitwarden.com).
client_id: StringOAuth2 client ID. Maps to TSAFE_BW_CLIENT_ID when not set in the manifest.
client_secret: StringOAuth2 client secret. Maps to TSAFE_BW_CLIENT_SECRET when not set in the manifest.
Implementations§
Source§impl BitwConfig
impl BitwConfig
Sourcepub fn new(
api_url: impl Into<String>,
identity_url: impl Into<String>,
client_id: impl Into<String>,
client_secret: impl Into<String>,
) -> Self
pub fn new( api_url: impl Into<String>, identity_url: impl Into<String>, client_id: impl Into<String>, client_secret: impl Into<String>, ) -> Self
Construct from explicit values.
Sourcepub fn from_env() -> Option<Self>
pub fn from_env() -> Option<Self>
Construct from environment variables (TSAFE_BW_CLIENT_ID / TSAFE_BW_CLIENT_SECRET).
Returns None if either variable is unset or empty.
Sourcepub fn default_api_url() -> &'static str
pub fn default_api_url() -> &'static str
Default cloud API URL.
Sourcepub fn default_identity_url() -> &'static str
pub fn default_identity_url() -> &'static str
Default cloud identity URL.
Trait Implementations§
Source§impl Clone for BitwConfig
impl Clone for BitwConfig
Source§fn clone(&self) -> BitwConfig
fn clone(&self) -> BitwConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more