Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,7 @@ struct FoldersPostReq {
// Used for the Bitwarden-Client-Name header. Accepted values:
// https://github.com/bitwarden/server/blob/main/src/Core/Enums/BitwardenClient.cs
const BITWARDEN_CLIENT: &str = "cli";
const BITWARDEN_CLIENT_VERSION: &str = "2024.12.0";

// DeviceType.LinuxDesktop, as per Bitwarden API device types.
const DEVICE_TYPE: u8 = 8;
Expand Down Expand Up @@ -848,7 +849,7 @@ impl Client {
);
default_headers.insert(
"Bitwarden-Client-Version",
axum::http::HeaderValue::from_static(env!("CARGO_PKG_VERSION")),
axum::http::HeaderValue::from_static(BITWARDEN_CLIENT_VERSION),
);
default_headers.append(
"Device-Type",
Expand Down Expand Up @@ -1159,7 +1160,7 @@ impl Client {
.get(self.api_url("/sync"))
.header("Authorization", format!("Bearer {access_token}"))
// This is necessary for vaultwarden to include the ssh keys in the response
.header("Bitwarden-Client-Version", "2024.12.0")
.header("Bitwarden-Client-Version", BITWARDEN_CLIENT_VERSION)
.send()
.await
.map_err(|source| Error::Reqwest { source })?;
Expand Down Expand Up @@ -1453,6 +1454,7 @@ impl Client {
let res = client
.put(self.api_url(&format!("/ciphers/{id}")))
.header("Authorization", format!("Bearer {access_token}"))
.header("Bitwarden-Client-Version", BITWARDEN_CLIENT_VERSION)
.json(&req)
.send()
.map_err(|source| Error::Reqwest { source })?;
Expand Down
Loading