From 6669b416b6c66702e7f982d94cfa09a6ec5acb46 Mon Sep 17 00:00:00 2001 From: jng Date: Wed, 13 Aug 2025 15:21:20 -0400 Subject: [PATCH 1/6] add archivedDate to cipherdetails --- .../.openapi-generator/FILES | 2 + crates/bitwarden-api-api/Cargo.toml | 19 +- crates/bitwarden-api-api/README.md | 6 + .../bitwarden-api-api/src/apis/ciphers_api.rs | 224 +++++++++++++++++- .../apis/organization_billing_v_next_api.rs | 35 +++ crates/bitwarden-api-api/src/models/cipher.rs | 3 + .../cipher_bulk_archive_request_model.rs | 25 ++ .../cipher_bulk_unarchive_request_model.rs | 25 ++ .../models/cipher_details_response_model.rs | 3 + .../cipher_mini_details_response_model.rs | 3 + .../src/models/cipher_mini_response_model.rs | 3 + .../src/models/cipher_request_model.rs | 3 + .../src/models/cipher_response_model.rs | 3 + .../models/cipher_with_id_request_model.rs | 3 + .../src/models/event_type.rs | 4 + crates/bitwarden-api-api/src/models/mod.rs | 4 + ...ization_user_bulk_confirm_request_model.rs | 10 +- crates/bitwarden-api-identity/Cargo.toml | 19 +- crates/bitwarden-exporters/src/lib.rs | 1 + .../bitwarden-vault/src/cipher/attachment.rs | 3 + crates/bitwarden-vault/src/cipher/cipher.rs | 10 + .../src/cipher/cipher_client.rs | 3 + .../bitwarden-vault/src/cipher/secure_note.rs | 1 + crates/bitwarden-vault/src/totp.rs | 1 + 24 files changed, 387 insertions(+), 26 deletions(-) create mode 100644 crates/bitwarden-api-api/src/models/cipher_bulk_archive_request_model.rs create mode 100644 crates/bitwarden-api-api/src/models/cipher_bulk_unarchive_request_model.rs diff --git a/crates/bitwarden-api-api/.openapi-generator/FILES b/crates/bitwarden-api-api/.openapi-generator/FILES index d477e416e..b01ce9d70 100644 --- a/crates/bitwarden-api-api/.openapi-generator/FILES +++ b/crates/bitwarden-api-api/.openapi-generator/FILES @@ -120,10 +120,12 @@ src/models/bulk_deny_admin_auth_request_request_model.rs src/models/change_plan_frequency_request.rs src/models/cipher.rs src/models/cipher_attachment_model.rs +src/models/cipher_bulk_archive_request_model.rs src/models/cipher_bulk_delete_request_model.rs src/models/cipher_bulk_move_request_model.rs src/models/cipher_bulk_restore_request_model.rs src/models/cipher_bulk_share_request_model.rs +src/models/cipher_bulk_unarchive_request_model.rs src/models/cipher_bulk_update_collections_request_model.rs src/models/cipher_card_model.rs src/models/cipher_collections_request_model.rs diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index 1c68a6cf1..b4a55b22c 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -1,6 +1,5 @@ [package] name = "bitwarden-api-api" -description = "Api bindings for the Bitwarden API." categories = ["api-bindings"] version.workspace = true @@ -13,14 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { version = ">=3.8, <4", default-features = false, features = [ - "base64", - "std", - "macros", -] } -url = ">=2.5, <3" -uuid = { workspace = true } +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } diff --git a/crates/bitwarden-api-api/README.md b/crates/bitwarden-api-api/README.md index f79a76f09..f08240b7a 100644 --- a/crates/bitwarden-api-api/README.md +++ b/crates/bitwarden-api-api/README.md @@ -106,6 +106,7 @@ All URIs are relative to _http://localhost_ | _AuthRequestsApi_ | [**auth_requests_post**](docs/AuthRequestsApi.md#auth_requests_post) | **POST** /auth-requests | | _CiphersApi_ | [**ciphers_admin_delete**](docs/CiphersApi.md#ciphers_admin_delete) | **DELETE** /ciphers/admin | | _CiphersApi_ | [**ciphers_admin_post**](docs/CiphersApi.md#ciphers_admin_post) | **POST** /ciphers/admin | +| _CiphersApi_ | [**ciphers_archive_put**](docs/CiphersApi.md#ciphers_archive_put) | **PUT** /ciphers/archive | | _CiphersApi_ | [**ciphers_attachment_validate_azure_post**](docs/CiphersApi.md#ciphers_attachment_validate_azure_post) | **POST** /ciphers/attachment/validate/azure | | _CiphersApi_ | [**ciphers_bulk_collections_post**](docs/CiphersApi.md#ciphers_bulk_collections_post) | **POST** /ciphers/bulk-collections | | _CiphersApi_ | [**ciphers_create_post**](docs/CiphersApi.md#ciphers_create_post) | **POST** /ciphers/create | @@ -119,6 +120,7 @@ All URIs are relative to _http://localhost_ | _CiphersApi_ | [**ciphers_id_admin_get**](docs/CiphersApi.md#ciphers_id_admin_get) | **GET** /ciphers/{id}/admin | | _CiphersApi_ | [**ciphers_id_admin_post**](docs/CiphersApi.md#ciphers_id_admin_post) | **POST** /ciphers/{id}/admin | | _CiphersApi_ | [**ciphers_id_admin_put**](docs/CiphersApi.md#ciphers_id_admin_put) | **PUT** /ciphers/{id}/admin | +| _CiphersApi_ | [**ciphers_id_archive_put**](docs/CiphersApi.md#ciphers_id_archive_put) | **PUT** /ciphers/{id}/archive | | _CiphersApi_ | [**ciphers_id_attachment_admin_post**](docs/CiphersApi.md#ciphers_id_attachment_admin_post) | **POST** /ciphers/{id}/attachment-admin | | _CiphersApi_ | [**ciphers_id_attachment_attachment_id_admin_delete**](docs/CiphersApi.md#ciphers_id_attachment_attachment_id_admin_delete) | **DELETE** /ciphers/{id}/attachment/{attachmentId}/admin | | _CiphersApi_ | [**ciphers_id_attachment_attachment_id_admin_get**](docs/CiphersApi.md#ciphers_id_attachment_attachment_id_admin_get) | **GET** /ciphers/{id}/attachment/{attachmentId}/admin | @@ -153,6 +155,7 @@ All URIs are relative to _http://localhost_ | _CiphersApi_ | [**ciphers_id_restore_put**](docs/CiphersApi.md#ciphers_id_restore_put) | **PUT** /ciphers/{id}/restore | | _CiphersApi_ | [**ciphers_id_share_post**](docs/CiphersApi.md#ciphers_id_share_post) | **POST** /ciphers/{id}/share | | _CiphersApi_ | [**ciphers_id_share_put**](docs/CiphersApi.md#ciphers_id_share_put) | **PUT** /ciphers/{id}/share | +| _CiphersApi_ | [**ciphers_id_unarchive_put**](docs/CiphersApi.md#ciphers_id_unarchive_put) | **PUT** /ciphers/{id}/unarchive | | _CiphersApi_ | [**ciphers_move_post**](docs/CiphersApi.md#ciphers_move_post) | **POST** /ciphers/move | | _CiphersApi_ | [**ciphers_move_put**](docs/CiphersApi.md#ciphers_move_put) | **PUT** /ciphers/move | | _CiphersApi_ | [**ciphers_organization_details_assigned_get**](docs/CiphersApi.md#ciphers_organization_details_assigned_get) | **GET** /ciphers/organization-details/assigned | @@ -163,6 +166,7 @@ All URIs are relative to _http://localhost_ | _CiphersApi_ | [**ciphers_restore_put**](docs/CiphersApi.md#ciphers_restore_put) | **PUT** /ciphers/restore | | _CiphersApi_ | [**ciphers_share_post**](docs/CiphersApi.md#ciphers_share_post) | **POST** /ciphers/share | | _CiphersApi_ | [**ciphers_share_put**](docs/CiphersApi.md#ciphers_share_put) | **PUT** /ciphers/share | +| _CiphersApi_ | [**ciphers_unarchive_put**](docs/CiphersApi.md#ciphers_unarchive_put) | **PUT** /ciphers/unarchive | | _CollectionsApi_ | [**collections_get**](docs/CollectionsApi.md#collections_get) | **GET** /collections | | _CollectionsApi_ | [**organizations_org_id_collections_bulk_access_post**](docs/CollectionsApi.md#organizations_org_id_collections_bulk_access_post) | **POST** /organizations/{orgId}/collections/bulk-access | | _CollectionsApi_ | [**organizations_org_id_collections_delete**](docs/CollectionsApi.md#organizations_org_id_collections_delete) | **DELETE** /organizations/{orgId}/collections | @@ -625,10 +629,12 @@ All URIs are relative to _http://localhost_ - [ChangePlanFrequencyRequest](docs/ChangePlanFrequencyRequest.md) - [Cipher](docs/Cipher.md) - [CipherAttachmentModel](docs/CipherAttachmentModel.md) +- [CipherBulkArchiveRequestModel](docs/CipherBulkArchiveRequestModel.md) - [CipherBulkDeleteRequestModel](docs/CipherBulkDeleteRequestModel.md) - [CipherBulkMoveRequestModel](docs/CipherBulkMoveRequestModel.md) - [CipherBulkRestoreRequestModel](docs/CipherBulkRestoreRequestModel.md) - [CipherBulkShareRequestModel](docs/CipherBulkShareRequestModel.md) +- [CipherBulkUnarchiveRequestModel](docs/CipherBulkUnarchiveRequestModel.md) - [CipherBulkUpdateCollectionsRequestModel](docs/CipherBulkUpdateCollectionsRequestModel.md) - [CipherCardModel](docs/CipherCardModel.md) - [CipherCollectionsRequestModel](docs/CipherCollectionsRequestModel.md) diff --git a/crates/bitwarden-api-api/src/apis/ciphers_api.rs b/crates/bitwarden-api-api/src/apis/ciphers_api.rs index c5f0c2ce2..e1adfeea9 100644 --- a/crates/bitwarden-api-api/src/apis/ciphers_api.rs +++ b/crates/bitwarden-api-api/src/apis/ciphers_api.rs @@ -28,6 +28,13 @@ pub enum CiphersAdminPostError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_archive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersArchivePutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`ciphers_attachment_validate_azure_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -119,6 +126,13 @@ pub enum CiphersIdAdminPutError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_id_archive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersIdArchivePutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`ciphers_id_attachment_admin_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -357,6 +371,13 @@ pub enum CiphersIdSharePutError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_id_unarchive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersIdUnarchivePutError { + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`ciphers_move_post`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -427,6 +448,13 @@ pub enum CiphersSharePutError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`ciphers_unarchive_put`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CiphersUnarchivePutError { + UnknownValue(serde_json::Value), +} + pub async fn ciphers_admin_delete( configuration: &configuration::Configuration, cipher_bulk_delete_request_model: Option, @@ -514,6 +542,53 @@ pub async fn ciphers_admin_post( } } +pub async fn ciphers_archive_put( + configuration: &configuration::Configuration, + cipher_bulk_archive_request_model: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_cipher_bulk_archive_request_model = cipher_bulk_archive_request_model; + + let uri_str = format!("{}/ciphers/archive", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_cipher_bulk_archive_request_model); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + pub async fn ciphers_attachment_validate_azure_post( configuration: &configuration::Configuration, ) -> Result<(), Error> { @@ -1068,6 +1143,56 @@ pub async fn ciphers_id_admin_put( } } +pub async fn ciphers_id_archive_put( + configuration: &configuration::Configuration, + id: uuid::Uuid, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_id = id; + + let uri_str = format!( + "{}/ciphers/{id}/archive", + configuration.base_path, + id = crate::apis::urlencode(p_id.to_string()) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + pub async fn ciphers_id_attachment_admin_post( configuration: &configuration::Configuration, id: &str, @@ -2821,6 +2946,56 @@ pub async fn ciphers_id_share_put( } } +pub async fn ciphers_id_unarchive_put( + configuration: &configuration::Configuration, + id: uuid::Uuid, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_id = id; + + let uri_str = format!( + "{}/ciphers/{id}/unarchive", + configuration.base_path, + id = crate::apis::urlencode(p_id.to_string()) + ); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + pub async fn ciphers_move_post( configuration: &configuration::Configuration, cipher_bulk_move_request_model: Option, @@ -3055,7 +3230,7 @@ pub async fn ciphers_post( pub async fn ciphers_purge_post( configuration: &configuration::Configuration, - organization_id: Option<&str>, + organization_id: Option, secret_verification_request_model: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -3285,3 +3460,50 @@ pub async fn ciphers_share_put( })) } } + +pub async fn ciphers_unarchive_put( + configuration: &configuration::Configuration, + cipher_bulk_unarchive_request_model: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_cipher_bulk_unarchive_request_model = cipher_bulk_unarchive_request_model; + + let uri_str = format!("{}/ciphers/unarchive", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.oauth_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_cipher_bulk_unarchive_request_model); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::CipherMiniResponseModelListResponseModel`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs b/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs index 4d8bc6dcf..99573dcba 100644 --- a/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs +++ b/crates/bitwarden-api-api/src/apis/organization_billing_v_next_api.rs @@ -128,6 +128,7 @@ pub async fn organizations_organization_id_billing_vnext_address_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -189,6 +190,7 @@ pub async fn organizations_organization_id_billing_vnext_address_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/address", @@ -376,6 +378,9 @@ pub async fn organizations_organization_id_billing_vnext_address_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -463,6 +468,7 @@ pub async fn organizations_organization_id_billing_vnext_address_put( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, billing_address_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -525,6 +531,7 @@ pub async fn organizations_organization_id_billing_vnext_address_put( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_billing_address_request = billing_address_request; let uri_str = format!( @@ -713,6 +720,9 @@ pub async fn organizations_organization_id_billing_vnext_address_put( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -801,6 +811,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, bit_pay_credit_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -863,6 +874,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_bit_pay_credit_request = bit_pay_credit_request; let uri_str = format!( @@ -1053,6 +1065,9 @@ pub async fn organizations_organization_id_billing_vnext_credit_bitpay_post( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1141,6 +1156,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -1202,6 +1218,7 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/credit", @@ -1389,6 +1406,9 @@ pub async fn organizations_organization_id_billing_vnext_credit_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1476,6 +1496,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions let p_organization_id = organization_id; @@ -1537,6 +1558,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let uri_str = format!( "{}/organizations/{organizationId}/billing/vnext/payment-method", @@ -1724,6 +1746,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_get( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -1811,6 +1836,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, tokenized_payment_method_request: Option, ) -> Result<(), Error> { // add a prefix to parameters to efficiently prevent name collisions @@ -1873,6 +1899,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_tokenized_payment_method_request = tokenized_payment_method_request; let uri_str = format!( @@ -2061,6 +2088,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_put( if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } @@ -2149,6 +2179,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b use_risk_insights: Option, use_organization_domains: Option, use_admin_sponsored_families: Option, + sync_seats: Option, verify_bank_account_request: Option, ) -> Result<(), Error> { @@ -2212,6 +2243,7 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b let p_use_risk_insights = use_risk_insights; let p_use_organization_domains = use_organization_domains; let p_use_admin_sponsored_families = use_admin_sponsored_families; + let p_sync_seats = sync_seats; let p_verify_bank_account_request = verify_bank_account_request; let uri_str = format!( @@ -2402,6 +2434,9 @@ pub async fn organizations_organization_id_billing_vnext_payment_method_verify_b if let Some(ref param_value) = p_use_admin_sponsored_families { req_builder = req_builder.query(&[("useAdminSponsoredFamilies", ¶m_value.to_string())]); } + if let Some(ref param_value) = p_sync_seats { + req_builder = req_builder.query(&[("syncSeats", ¶m_value.to_string())]); + } if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } diff --git a/crates/bitwarden-api-api/src/models/cipher.rs b/crates/bitwarden-api-api/src/models/cipher.rs index 8bdcdb0bd..cea411cae 100644 --- a/crates/bitwarden-api-api/src/models/cipher.rs +++ b/crates/bitwarden-api-api/src/models/cipher.rs @@ -40,6 +40,8 @@ pub struct Cipher { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, } impl Cipher { @@ -58,6 +60,7 @@ impl Cipher { deleted_date: None, reprompt: None, key: None, + archived_date: None, } } } diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_archive_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_archive_request_model.rs new file mode 100644 index 000000000..b32db1950 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_archive_request_model.rs @@ -0,0 +1,25 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CipherBulkArchiveRequestModel { + #[serde(rename = "ids")] + pub ids: Vec, +} + +impl CipherBulkArchiveRequestModel { + pub fn new(ids: Vec) -> CipherBulkArchiveRequestModel { + CipherBulkArchiveRequestModel { ids } + } +} diff --git a/crates/bitwarden-api-api/src/models/cipher_bulk_unarchive_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_bulk_unarchive_request_model.rs new file mode 100644 index 000000000..0bf375689 --- /dev/null +++ b/crates/bitwarden-api-api/src/models/cipher_bulk_unarchive_request_model.rs @@ -0,0 +1,25 @@ +/* + * Bitwarden Internal API + * + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: latest + * + * Generated by: https://openapi-generator.tech + */ + +use serde::{Deserialize, Serialize}; + +use crate::models; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CipherBulkUnarchiveRequestModel { + #[serde(rename = "ids")] + pub ids: Vec, +} + +impl CipherBulkUnarchiveRequestModel { + pub fn new(ids: Vec) -> CipherBulkUnarchiveRequestModel { + CipherBulkUnarchiveRequestModel { ids } + } +} diff --git a/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs index e0b1958d9..e71a0529d 100644 --- a/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_details_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -97,6 +99,7 @@ impl CipherDetailsResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, folder_id: None, favorite: None, edit: None, diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs index 37d33da67..86a1d62d9 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_details_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherMiniDetailsResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "collectionIds", skip_serializing_if = "Option::is_none")] pub collection_ids: Option>, } @@ -87,6 +89,7 @@ impl CipherMiniDetailsResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, collection_ids: None, } } diff --git a/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs index f4596cf22..9e660a791 100644 --- a/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_mini_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherMiniResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, } impl CipherMiniResponseModel { @@ -85,6 +87,7 @@ impl CipherMiniResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, } } } diff --git a/crates/bitwarden-api-api/src/models/cipher_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_request_model.rs index 0da128035..d639a320b 100644 --- a/crates/bitwarden-api-api/src/models/cipher_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_request_model.rs @@ -56,6 +56,8 @@ pub struct CipherRequestModel { skip_serializing_if = "Option::is_none" )] pub last_known_revision_date: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, } impl CipherRequestModel { @@ -80,6 +82,7 @@ impl CipherRequestModel { secure_note: None, ssh_key: None, last_known_revision_date: None, + archived_date: None, } } } diff --git a/crates/bitwarden-api-api/src/models/cipher_response_model.rs b/crates/bitwarden-api-api/src/models/cipher_response_model.rs index 4470969c8..8a529831b 100644 --- a/crates/bitwarden-api-api/src/models/cipher_response_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_response_model.rs @@ -59,6 +59,8 @@ pub struct CipherResponseModel { pub reprompt: Option, #[serde(rename = "key", skip_serializing_if = "Option::is_none")] pub key: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "folderId", skip_serializing_if = "Option::is_none")] pub folder_id: Option, #[serde(rename = "favorite", skip_serializing_if = "Option::is_none")] @@ -95,6 +97,7 @@ impl CipherResponseModel { deleted_date: None, reprompt: None, key: None, + archived_date: None, folder_id: None, favorite: None, edit: None, diff --git a/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs b/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs index a7f207c55..86f19c6a0 100644 --- a/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs +++ b/crates/bitwarden-api-api/src/models/cipher_with_id_request_model.rs @@ -56,6 +56,8 @@ pub struct CipherWithIdRequestModel { skip_serializing_if = "Option::is_none" )] pub last_known_revision_date: Option, + #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")] + pub archived_date: Option, #[serde(rename = "id")] pub id: uuid::Uuid, } @@ -82,6 +84,7 @@ impl CipherWithIdRequestModel { secure_note: None, ssh_key: None, last_known_revision_date: None, + archived_date: None, id, } } diff --git a/crates/bitwarden-api-api/src/models/event_type.rs b/crates/bitwarden-api-api/src/models/event_type.rs index 29cce16a4..40cb4efc4 100644 --- a/crates/bitwarden-api-api/src/models/event_type.rs +++ b/crates/bitwarden-api-api/src/models/event_type.rs @@ -48,6 +48,8 @@ pub enum EventType { Cipher_SoftDeleted = 1115, Cipher_Restored = 1116, Cipher_ClientToggledCardNumberVisible = 1117, + Cipher_Archived = 1118, + Cipher_Unarchived = 1119, Collection_Created = 1300, Collection_Updated = 1301, Collection_Deleted = 1302, @@ -136,6 +138,8 @@ impl std::fmt::Display for EventType { Self::Cipher_SoftDeleted => "1115", Self::Cipher_Restored => "1116", Self::Cipher_ClientToggledCardNumberVisible => "1117", + Self::Cipher_Archived => "1118", + Self::Cipher_Unarchived => "1119", Self::Collection_Created => "1300", Self::Collection_Updated => "1301", Self::Collection_Deleted => "1302", diff --git a/crates/bitwarden-api-api/src/models/mod.rs b/crates/bitwarden-api-api/src/models/mod.rs index 0529112f4..78a50cff6 100644 --- a/crates/bitwarden-api-api/src/models/mod.rs +++ b/crates/bitwarden-api-api/src/models/mod.rs @@ -102,6 +102,8 @@ pub mod cipher; pub use self::cipher::Cipher; pub mod cipher_attachment_model; pub use self::cipher_attachment_model::CipherAttachmentModel; +pub mod cipher_bulk_archive_request_model; +pub use self::cipher_bulk_archive_request_model::CipherBulkArchiveRequestModel; pub mod cipher_bulk_delete_request_model; pub use self::cipher_bulk_delete_request_model::CipherBulkDeleteRequestModel; pub mod cipher_bulk_move_request_model; @@ -110,6 +112,8 @@ pub mod cipher_bulk_restore_request_model; pub use self::cipher_bulk_restore_request_model::CipherBulkRestoreRequestModel; pub mod cipher_bulk_share_request_model; pub use self::cipher_bulk_share_request_model::CipherBulkShareRequestModel; +pub mod cipher_bulk_unarchive_request_model; +pub use self::cipher_bulk_unarchive_request_model::CipherBulkUnarchiveRequestModel; pub mod cipher_bulk_update_collections_request_model; pub use self::cipher_bulk_update_collections_request_model::CipherBulkUpdateCollectionsRequestModel; pub mod cipher_card_model; diff --git a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs index 7b0383cb8..c39a877f7 100644 --- a/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs +++ b/crates/bitwarden-api-api/src/models/organization_user_bulk_confirm_request_model.rs @@ -16,12 +16,20 @@ use crate::models; pub struct OrganizationUserBulkConfirmRequestModel { #[serde(rename = "keys")] pub keys: Vec, + #[serde( + rename = "defaultUserCollectionName", + skip_serializing_if = "Option::is_none" + )] + pub default_user_collection_name: Option, } impl OrganizationUserBulkConfirmRequestModel { pub fn new( keys: Vec, ) -> OrganizationUserBulkConfirmRequestModel { - OrganizationUserBulkConfirmRequestModel { keys } + OrganizationUserBulkConfirmRequestModel { + keys, + default_user_collection_name: None, + } } } diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index 022225451..ec616cec1 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -1,6 +1,5 @@ [package] name = "bitwarden-api-identity" -description = "Api bindings for the Bitwarden Identity API." categories = ["api-bindings"] version.workspace = true @@ -13,14 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { workspace = true } -serde = { workspace = true } -serde_json = { workspace = true } -serde_repr = { workspace = true } -serde_with = { version = ">=3.8, <4", default-features = false, features = [ - "base64", - "std", - "macros", -] } -url = ">=2.5, <3" -uuid = { workspace = true } +serde = { version = "^1.0", features = ["derive"] } +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } +serde_json = "^1.0" +serde_repr = "^0.1" +url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } diff --git a/crates/bitwarden-exporters/src/lib.rs b/crates/bitwarden-exporters/src/lib.rs index 4466460d8..51c256caa 100644 --- a/crates/bitwarden-exporters/src/lib.rs +++ b/crates/bitwarden-exporters/src/lib.rs @@ -147,6 +147,7 @@ impl From for CipherView { creation_date: value.creation_date, deleted_date: None, revision_date: value.revision_date, + archived_date: None, } } } diff --git a/crates/bitwarden-vault/src/cipher/attachment.rs b/crates/bitwarden-vault/src/cipher/attachment.rs index 2bfa4edb7..1a9e2fcf8 100644 --- a/crates/bitwarden-vault/src/cipher/attachment.rs +++ b/crates/bitwarden-vault/src/cipher/attachment.rs @@ -286,6 +286,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + archived_date: None, }, attachment, contents: contents.as_slice(), @@ -340,6 +341,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + archived_date: None, }; let enc_file = STANDARD.decode(b"Ao00qr1xLsV+ZNQpYZ/UwEwOWo3hheKwCYcOGIbsorZ6JIG2vLWfWEXCVqP0hDuzRvmx8otApNZr8pJYLNwCe1aQ+ySHQYGkdubFjoMojulMbQ959Y4SJ6Its/EnVvpbDnxpXTDpbutDxyhxfq1P3lstL2G9rObJRrxiwdGlRGu1h94UA1fCCkIUQux5LcqUee6W4MyQmRnsUziH8gGzmtI=").unwrap(); @@ -398,6 +400,7 @@ mod tests { creation_date: "2023-07-24T12:05:09.466666700Z".parse().unwrap(), deleted_date: None, revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(), + archived_date: None, }; let enc_file = STANDARD.decode(b"AsQLXOBHrJ8porroTUlPxeJOm9XID7LL9D2+KwYATXEpR1EFjLBpcCvMmnqcnYLXIEefe9TCeY4Us50ux43kRSpvdB7YkjxDKV0O1/y6tB7qC4vvv9J9+O/uDEnMx/9yXuEhAW/LA/TsU/WAgxkOM0uTvm8JdD9LUR1z9Ql7zOWycMVzkvGsk2KBNcqAdrotS5FlDftZOXyU8pWecNeyA/w=").unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/cipher.rs b/crates/bitwarden-vault/src/cipher/cipher.rs index cce9a2360..023b0ee2f 100644 --- a/crates/bitwarden-vault/src/cipher/cipher.rs +++ b/crates/bitwarden-vault/src/cipher/cipher.rs @@ -136,6 +136,7 @@ pub struct Cipher { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + pub archived_date: Option>, } bitwarden_state::register_repository_item!(Cipher, "Cipher"); @@ -179,6 +180,7 @@ pub struct CipherView { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + pub archived_date: Option>, } #[allow(missing_docs)] @@ -247,6 +249,7 @@ pub struct CipherListView { pub creation_date: DateTime, pub deleted_date: Option>, pub revision_date: DateTime, + pub archived_date: Option>, /// Hints for the presentation layer for which fields can be copied. pub copyable_fields: Vec, @@ -333,6 +336,7 @@ impl CompositeEncryptable for CipherView { deleted_date: cipher_view.deleted_date, revision_date: cipher_view.revision_date, permissions: cipher_view.permissions, + archived_date: cipher_view.archived_date, }) } } @@ -376,6 +380,7 @@ impl Decryptable for Cipher { creation_date: self.creation_date, deleted_date: self.deleted_date, revision_date: self.revision_date, + archived_date: self.archived_date, }; // For compatibility we only remove URLs with invalid checksums if the cipher has a key @@ -681,6 +686,7 @@ impl Decryptable for Cipher { revision_date: self.revision_date, copyable_fields: self.get_copyable_fields(), local_data: self.local_data.decrypt(ctx, ciphers_key)?, + archived_date: self.archived_date, }) } } @@ -757,6 +763,7 @@ impl TryFrom for Cipher { deleted_date: cipher.deleted_date.map(|d| d.parse()).transpose()?, revision_date: require!(cipher.revision_date).parse()?, key: EncString::try_from_optional(cipher.key)?, + archived_date: cipher.archived_date.map(|d| d.parse()).transpose()?, }) } } @@ -831,6 +838,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, } } @@ -895,6 +903,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, }; let view: CipherListView = key_store.decrypt(&cipher).unwrap(); @@ -939,6 +948,7 @@ mod tests { CopyableCipherFields::LoginTotp ], local_data: None, + archived_date: cipher.archived_date, } ) } diff --git a/crates/bitwarden-vault/src/cipher/cipher_client.rs b/crates/bitwarden-vault/src/cipher/cipher_client.rs index 45e9d846a..2ba28eca8 100644 --- a/crates/bitwarden-vault/src/cipher/cipher_client.rs +++ b/crates/bitwarden-vault/src/cipher/cipher_client.rs @@ -219,6 +219,7 @@ mod tests { creation_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T11:20:58.4566667Z".parse().unwrap(), + archived_date: None, } } @@ -259,6 +260,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, } } @@ -321,6 +323,7 @@ mod tests { creation_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), deleted_date: None, revision_date: "2024-05-31T09:35:55.12Z".parse().unwrap(), + archived_date: None, }]) .unwrap(); diff --git a/crates/bitwarden-vault/src/cipher/secure_note.rs b/crates/bitwarden-vault/src/cipher/secure_note.rs index 821bded5c..268b71971 100644 --- a/crates/bitwarden-vault/src/cipher/secure_note.rs +++ b/crates/bitwarden-vault/src/cipher/secure_note.rs @@ -139,6 +139,7 @@ mod tests { creation_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-01T00:00:00.000Z".parse().unwrap(), + archived_date: None, } } diff --git a/crates/bitwarden-vault/src/totp.rs b/crates/bitwarden-vault/src/totp.rs index 196182102..446379631 100644 --- a/crates/bitwarden-vault/src/totp.rs +++ b/crates/bitwarden-vault/src/totp.rs @@ -753,6 +753,7 @@ mod tests { revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), copyable_fields: vec![CopyableCipherFields::LoginTotp], local_data: None, + archived_date: None, }; let key = SymmetricCryptoKey::try_from("w2LO+nwV4oxwswVYCxlOfRUseXfvU03VzvKQHrqeklPgiMZrspUe6sOBToCnDn9Ay0tuCBn8ykVVRb7PWhub2Q==".to_string()).unwrap(); From ff5f1d6f1b2a08e1b272f0ae3d4e5ed5a0c4a171 Mon Sep 17 00:00:00 2001 From: jng Date: Wed, 3 Sep 2025 12:59:41 -0400 Subject: [PATCH 2/6] add archived_date to models, update linting --- Cargo.toml | 30 ++++++++++++------------ crates/bitwarden-api-api/Cargo.toml | 4 ++-- crates/bitwarden-api-identity/Cargo.toml | 4 ++-- crates/bitwarden-auth/Cargo.toml | 2 +- crates/bitwarden-collections/Cargo.toml | 2 +- crates/bitwarden-core/Cargo.toml | 6 ++--- crates/bitwarden-error-macro/Cargo.toml | 12 +++++----- crates/bitwarden-error/Cargo.toml | 8 +++---- crates/bitwarden-exporters/Cargo.toml | 2 +- crates/bitwarden-exporters/src/models.rs | 2 ++ crates/bitwarden-generators/Cargo.toml | 2 +- crates/bitwarden-ipc/Cargo.toml | 2 +- crates/bitwarden-send/Cargo.toml | 2 +- crates/bitwarden-ssh/Cargo.toml | 2 +- crates/bitwarden-threading/Cargo.toml | 2 +- crates/bitwarden-uniffi/Cargo.toml | 4 ++-- crates/bitwarden-uuid-macro/Cargo.toml | 6 ++--- crates/bitwarden-uuid/Cargo.toml | 6 ++--- crates/bitwarden-vault/Cargo.toml | 4 ++-- 19 files changed, 52 insertions(+), 50 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 827edd519..1684497eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,9 @@ keywords = ["bitwarden"] # Define dependencies that are expected to be consistent across all crates [workspace.dependencies] + +# External crates that are expected to maintain a consistent version across all crates +async-trait = ">=0.1.80, <0.2" bitwarden = { path = "crates/bitwarden", version = "=1.0.0" } bitwarden-api-api = { path = "crates/bitwarden-api-api", version = "=1.0.0" } bitwarden-api-identity = { path = "crates/bitwarden-api-identity", version = "=1.0.0" } @@ -43,9 +46,6 @@ bitwarden-uniffi-error = { path = "crates/bitwarden-uniffi-error", version = "=1 bitwarden-uuid = { path = "crates/bitwarden-uuid", version = "=1.0.0" } bitwarden-uuid-macro = { path = "crates/bitwarden-uuid-macro", version = "=1.0.0" } bitwarden-vault = { path = "crates/bitwarden-vault", version = "=1.0.0" } - -# External crates that are expected to maintain a consistent version across all crates -async-trait = ">=0.1.80, <0.2" chrono = { version = ">=0.4.26, <0.5", features = [ "clock", "serde", @@ -64,11 +64,11 @@ reqwest = { version = ">=0.12.5, <0.13", features = [ ], default-features = false } schemars = { version = ">=1.0.0, <2.0", features = ["uuid1", "chrono04"] } serde = { version = ">=1.0, <2.0", features = ["derive"] } +serde-wasm-bindgen = ">=0.6.0, <0.7" serde_bytes = { version = ">=0.11.17, <0.12.0" } serde_json = ">=1.0.96, <2.0" serde_qs = ">=0.12.0, <0.16" serde_repr = ">=0.1.12, <0.2" -serde-wasm-bindgen = ">=0.6.0, <0.7" syn = ">=2.0.87, <3" thiserror = ">=1.0.40, <3" tokio = { version = "1.36.0", features = ["macros"] } @@ -83,12 +83,6 @@ wasm-bindgen-futures = "0.4.41" wasm-bindgen-test = "0.3.45" wiremock = ">=0.6.0, <0.7" -# There is an incompatibility when using pkcs5 and chacha20 on wasm builds. This can be removed once a new -# rustcrypto-formats crate version is released since the fix has been upstreamed. -# https://github.com/RustCrypto/formats/pull/1625 -[patch.crates-io] -pkcs5 = { git = "https://github.com/bitwarden/rustcrypto-formats.git", rev = "2b27c63034217dd126bbf5ed874da51b84f8c705" } - [workspace.lints.clippy] unused_async = "deny" unwrap_used = "deny" @@ -97,17 +91,23 @@ string_slice = "warn" [workspace.lints.rust] missing_docs = "warn" -# Compile all dependencies with some optimizations when building this crate on debug -# This slows down clean builds by about 50%, but the resulting binaries can be orders of magnitude faster -# As clean builds won't occur very often, this won't slow down the development process -[profile.dev.package."*"] -opt-level = 2 +# There is an incompatibility when using pkcs5 and chacha20 on wasm builds. This can be removed once a new +# rustcrypto-formats crate version is released since the fix has been upstreamed. +# https://github.com/RustCrypto/formats/pull/1625 +[patch.crates-io] +pkcs5 = { git = "https://github.com/bitwarden/rustcrypto-formats.git", rev = "2b27c63034217dd126bbf5ed874da51b84f8c705" } # Turn on a small amount of optimisation in development mode. This might interfere when trying to use a debugger # if the compiler decides to optimize some code away, if that's the case, it can be set to 0 or commented out [profile.dev] opt-level = 1 +# Compile all dependencies with some optimizations when building this crate on debug +# This slows down clean builds by about 50%, but the resulting binaries can be orders of magnitude faster +# As clean builds won't occur very often, this won't slow down the development process +[profile.dev.package."*"] +opt-level = 2 + # Turn on LTO on release mode [profile.release] codegen-units = 1 diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index b4a55b22c..a7a03456d 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -12,10 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } serde = { version = "^1.0", features = ["derive"] } -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" serde_repr = "^0.1" +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index ec616cec1..bdbcb8eaa 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -12,10 +12,10 @@ license-file.workspace = true keywords.workspace = true [dependencies] +reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } serde = { version = "^1.0", features = ["derive"] } -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } serde_json = "^1.0" serde_repr = "^0.1" +serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } url = "^2.5" uuid = { version = "^1.8", features = ["serde", "v4"] } -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } diff --git a/crates/bitwarden-auth/Cargo.toml b/crates/bitwarden-auth/Cargo.toml index 787a5b2b1..ab2fdb0eb 100644 --- a/crates/bitwarden-auth/Cargo.toml +++ b/crates/bitwarden-auth/Cargo.toml @@ -20,7 +20,7 @@ wasm = [ "bitwarden-core/wasm", "dep:tsify", "dep:wasm-bindgen", - "dep:wasm-bindgen-futures" + "dep:wasm-bindgen-futures", ] # WASM support [dependencies] diff --git a/crates/bitwarden-collections/Cargo.toml b/crates/bitwarden-collections/Cargo.toml index 72d824687..6c144ba9d 100644 --- a/crates/bitwarden-collections/Cargo.toml +++ b/crates/bitwarden-collections/Cargo.toml @@ -14,7 +14,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi" + "dep:uniffi", ] # Uniffi bindings wasm = ["bitwarden-core/wasm", "dep:tsify", "dep:wasm-bindgen"] # WASM support diff --git a/crates/bitwarden-core/Cargo.toml b/crates/bitwarden-core/Cargo.toml index a76a1a92e..bcc74e709 100644 --- a/crates/bitwarden-core/Cargo.toml +++ b/crates/bitwarden-core/Cargo.toml @@ -17,19 +17,19 @@ keywords.workspace = true [features] internal = ["dep:zxcvbn"] no-memory-hardening = [ - "bitwarden-crypto/no-memory-hardening" + "bitwarden-crypto/no-memory-hardening", ] # Disable memory hardening features secrets = [] # Secrets manager API uniffi = [ "bitwarden-crypto/uniffi", "bitwarden-encoding/uniffi", - "dep:uniffi" + "dep:uniffi", ] # Uniffi bindings wasm = [ "bitwarden-error/wasm", "dep:wasm-bindgen", "dep:wasm-bindgen-futures", - "dep:tsify" + "dep:tsify", ] # WASM support [dependencies] diff --git a/crates/bitwarden-error-macro/Cargo.toml b/crates/bitwarden-error-macro/Cargo.toml index 19d78f001..ac88af95b 100644 --- a/crates/bitwarden-error-macro/Cargo.toml +++ b/crates/bitwarden-error-macro/Cargo.toml @@ -14,6 +14,9 @@ repository.workspace = true license-file.workspace = true keywords.workspace = true +[lib] +proc-macro = true + [features] wasm = [] @@ -23,12 +26,6 @@ proc-macro2 = { workspace = true } quote = { workspace = true } syn = { workspace = true } -[lints] -workspace = true - -[lib] -proc-macro = true - [dev-dependencies] bitwarden-error = { workspace = true, features = ["wasm"] } js-sys.workspace = true @@ -36,3 +33,6 @@ serde.workspace = true thiserror.workspace = true tsify.workspace = true wasm-bindgen.workspace = true + +[lints] +workspace = true diff --git a/crates/bitwarden-error/Cargo.toml b/crates/bitwarden-error/Cargo.toml index 9757669ed..ebbfe7a8c 100644 --- a/crates/bitwarden-error/Cargo.toml +++ b/crates/bitwarden-error/Cargo.toml @@ -19,7 +19,7 @@ wasm = [ "bitwarden-error-macro/wasm", "dep:js-sys", "dep:tsify", - "dep:wasm-bindgen" + "dep:wasm-bindgen", ] [dependencies] @@ -28,10 +28,10 @@ js-sys = { workspace = true, optional = true } tsify = { workspace = true, optional = true } wasm-bindgen = { workspace = true, optional = true } -[lints] -workspace = true - [dev-dependencies] serde.workspace = true trybuild = "1.0.101" wasm-bindgen-test = { workspace = true } + +[lints] +workspace = true diff --git a/crates/bitwarden-exporters/Cargo.toml b/crates/bitwarden-exporters/Cargo.toml index 4f39acfb8..f3fe09280 100644 --- a/crates/bitwarden-exporters/Cargo.toml +++ b/crates/bitwarden-exporters/Cargo.toml @@ -21,7 +21,7 @@ wasm = [ "bitwarden-collections/wasm", "bitwarden-vault/wasm", "dep:tsify", - "dep:wasm-bindgen" + "dep:wasm-bindgen", ] # WebAssembly bindings [dependencies] diff --git a/crates/bitwarden-exporters/src/models.rs b/crates/bitwarden-exporters/src/models.rs index 3bc3a85c4..bf8cbd7ac 100644 --- a/crates/bitwarden-exporters/src/models.rs +++ b/crates/bitwarden-exporters/src/models.rs @@ -261,6 +261,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, }; let login = from_login(&view, &key_store).unwrap(); @@ -312,6 +313,7 @@ mod tests { creation_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), deleted_date: None, revision_date: "2024-01-30T17:55:36.150Z".parse().unwrap(), + archived_date: None, }; let encrypted = key_store.encrypt(cipher_view).unwrap(); diff --git a/crates/bitwarden-generators/Cargo.toml b/crates/bitwarden-generators/Cargo.toml index 93f601cee..e3f4ea080 100644 --- a/crates/bitwarden-generators/Cargo.toml +++ b/crates/bitwarden-generators/Cargo.toml @@ -19,7 +19,7 @@ uniffi = ["dep:uniffi"] # Uniffi bindings wasm = [ "bitwarden-core/wasm", "dep:tsify", - "dep:wasm-bindgen" + "dep:wasm-bindgen", ] # WebAssembly bindings [dependencies] diff --git a/crates/bitwarden-ipc/Cargo.toml b/crates/bitwarden-ipc/Cargo.toml index e181292fe..ae4036230 100644 --- a/crates/bitwarden-ipc/Cargo.toml +++ b/crates/bitwarden-ipc/Cargo.toml @@ -16,7 +16,7 @@ wasm = [ "dep:wasm-bindgen-futures", "dep:js-sys", "bitwarden-error/wasm", - "bitwarden-threading/wasm" + "bitwarden-threading/wasm", ] # WASM support [dependencies] diff --git a/crates/bitwarden-send/Cargo.toml b/crates/bitwarden-send/Cargo.toml index 161be4b93..a5b500b8d 100644 --- a/crates/bitwarden-send/Cargo.toml +++ b/crates/bitwarden-send/Cargo.toml @@ -18,7 +18,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi" + "dep:uniffi", ] # Uniffi bindings [dependencies] diff --git a/crates/bitwarden-ssh/Cargo.toml b/crates/bitwarden-ssh/Cargo.toml index 7211a8357..4a1cebea7 100644 --- a/crates/bitwarden-ssh/Cargo.toml +++ b/crates/bitwarden-ssh/Cargo.toml @@ -19,7 +19,7 @@ keywords.workspace = true wasm = [ "bitwarden-error/wasm", "dep:tsify", - "dep:wasm-bindgen" + "dep:wasm-bindgen", ] # WASM support uniffi = ["dep:uniffi"] # Uniffi bindings diff --git a/crates/bitwarden-threading/Cargo.toml b/crates/bitwarden-threading/Cargo.toml index b322847e3..86ebae0f3 100644 --- a/crates/bitwarden-threading/Cargo.toml +++ b/crates/bitwarden-threading/Cargo.toml @@ -17,7 +17,7 @@ wasm = [ "dep:wasm-bindgen", "dep:wasm-bindgen-futures", "dep:js-sys", - "dep:gloo-timers" + "dep:gloo-timers", ] [dependencies] diff --git a/crates/bitwarden-uniffi/Cargo.toml b/crates/bitwarden-uniffi/Cargo.toml index 76a489869..b74299955 100644 --- a/crates/bitwarden-uniffi/Cargo.toml +++ b/crates/bitwarden-uniffi/Cargo.toml @@ -12,12 +12,12 @@ repository.workspace = true license-file.workspace = true keywords.workspace = true -[features] - [lib] crate-type = ["lib", "staticlib", "cdylib"] bench = false +[features] + [dependencies] async-trait = { workspace = true } bitwarden-collections = { workspace = true, features = ["uniffi"] } diff --git a/crates/bitwarden-uuid-macro/Cargo.toml b/crates/bitwarden-uuid-macro/Cargo.toml index de8740350..ec9d8fb69 100644 --- a/crates/bitwarden-uuid-macro/Cargo.toml +++ b/crates/bitwarden-uuid-macro/Cargo.toml @@ -14,12 +14,12 @@ repository.workspace = true license-file.workspace = true keywords.workspace = true +[lib] +proc-macro = true + [dependencies] quote = { workspace = true } syn = { workspace = true } [lints] workspace = true - -[lib] -proc-macro = true diff --git a/crates/bitwarden-uuid/Cargo.toml b/crates/bitwarden-uuid/Cargo.toml index 37013e93a..69fbc20a5 100644 --- a/crates/bitwarden-uuid/Cargo.toml +++ b/crates/bitwarden-uuid/Cargo.toml @@ -17,12 +17,12 @@ keywords.workspace = true [dependencies] bitwarden-uuid-macro = { workspace = true } -[lints] -workspace = true - [dev-dependencies] serde = { workspace = true } serde-wasm-bindgen = { workspace = true } serde_json = { workspace = true } uuid = { workspace = true } wasm-bindgen-test = { workspace = true } + +[lints] +workspace = true diff --git a/crates/bitwarden-vault/Cargo.toml b/crates/bitwarden-vault/Cargo.toml index fd5e40540..be74d60c1 100644 --- a/crates/bitwarden-vault/Cargo.toml +++ b/crates/bitwarden-vault/Cargo.toml @@ -18,7 +18,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi" + "dep:uniffi", ] # Uniffi bindings wasm = [ "bitwarden-collections/wasm", @@ -26,7 +26,7 @@ wasm = [ "bitwarden-encoding/wasm", "dep:tsify", "dep:wasm-bindgen", - "dep:wasm-bindgen-futures" + "dep:wasm-bindgen-futures", ] # WASM support [dependencies] From e02701458ad0462aaccab0fa6aadcc3109a5e7a5 Mon Sep 17 00:00:00 2001 From: jng Date: Wed, 3 Sep 2025 14:42:57 -0400 Subject: [PATCH 3/6] update linting for cargo sort --- crates/bitwarden-auth/Cargo.toml | 2 +- crates/bitwarden-collections/Cargo.toml | 2 +- crates/bitwarden-core/Cargo.toml | 6 +++--- crates/bitwarden-error/Cargo.toml | 2 +- crates/bitwarden-exporters/Cargo.toml | 2 +- crates/bitwarden-generators/Cargo.toml | 2 +- crates/bitwarden-ipc/Cargo.toml | 2 +- crates/bitwarden-send/Cargo.toml | 2 +- crates/bitwarden-ssh/Cargo.toml | 2 +- crates/bitwarden-threading/Cargo.toml | 2 +- crates/bitwarden-vault/Cargo.toml | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/bitwarden-auth/Cargo.toml b/crates/bitwarden-auth/Cargo.toml index ab2fdb0eb..787a5b2b1 100644 --- a/crates/bitwarden-auth/Cargo.toml +++ b/crates/bitwarden-auth/Cargo.toml @@ -20,7 +20,7 @@ wasm = [ "bitwarden-core/wasm", "dep:tsify", "dep:wasm-bindgen", - "dep:wasm-bindgen-futures", + "dep:wasm-bindgen-futures" ] # WASM support [dependencies] diff --git a/crates/bitwarden-collections/Cargo.toml b/crates/bitwarden-collections/Cargo.toml index 6c144ba9d..72d824687 100644 --- a/crates/bitwarden-collections/Cargo.toml +++ b/crates/bitwarden-collections/Cargo.toml @@ -14,7 +14,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi", + "dep:uniffi" ] # Uniffi bindings wasm = ["bitwarden-core/wasm", "dep:tsify", "dep:wasm-bindgen"] # WASM support diff --git a/crates/bitwarden-core/Cargo.toml b/crates/bitwarden-core/Cargo.toml index bcc74e709..a76a1a92e 100644 --- a/crates/bitwarden-core/Cargo.toml +++ b/crates/bitwarden-core/Cargo.toml @@ -17,19 +17,19 @@ keywords.workspace = true [features] internal = ["dep:zxcvbn"] no-memory-hardening = [ - "bitwarden-crypto/no-memory-hardening", + "bitwarden-crypto/no-memory-hardening" ] # Disable memory hardening features secrets = [] # Secrets manager API uniffi = [ "bitwarden-crypto/uniffi", "bitwarden-encoding/uniffi", - "dep:uniffi", + "dep:uniffi" ] # Uniffi bindings wasm = [ "bitwarden-error/wasm", "dep:wasm-bindgen", "dep:wasm-bindgen-futures", - "dep:tsify", + "dep:tsify" ] # WASM support [dependencies] diff --git a/crates/bitwarden-error/Cargo.toml b/crates/bitwarden-error/Cargo.toml index ebbfe7a8c..15b544ba8 100644 --- a/crates/bitwarden-error/Cargo.toml +++ b/crates/bitwarden-error/Cargo.toml @@ -19,7 +19,7 @@ wasm = [ "bitwarden-error-macro/wasm", "dep:js-sys", "dep:tsify", - "dep:wasm-bindgen", + "dep:wasm-bindgen" ] [dependencies] diff --git a/crates/bitwarden-exporters/Cargo.toml b/crates/bitwarden-exporters/Cargo.toml index f3fe09280..4f39acfb8 100644 --- a/crates/bitwarden-exporters/Cargo.toml +++ b/crates/bitwarden-exporters/Cargo.toml @@ -21,7 +21,7 @@ wasm = [ "bitwarden-collections/wasm", "bitwarden-vault/wasm", "dep:tsify", - "dep:wasm-bindgen", + "dep:wasm-bindgen" ] # WebAssembly bindings [dependencies] diff --git a/crates/bitwarden-generators/Cargo.toml b/crates/bitwarden-generators/Cargo.toml index e3f4ea080..93f601cee 100644 --- a/crates/bitwarden-generators/Cargo.toml +++ b/crates/bitwarden-generators/Cargo.toml @@ -19,7 +19,7 @@ uniffi = ["dep:uniffi"] # Uniffi bindings wasm = [ "bitwarden-core/wasm", "dep:tsify", - "dep:wasm-bindgen", + "dep:wasm-bindgen" ] # WebAssembly bindings [dependencies] diff --git a/crates/bitwarden-ipc/Cargo.toml b/crates/bitwarden-ipc/Cargo.toml index ae4036230..e181292fe 100644 --- a/crates/bitwarden-ipc/Cargo.toml +++ b/crates/bitwarden-ipc/Cargo.toml @@ -16,7 +16,7 @@ wasm = [ "dep:wasm-bindgen-futures", "dep:js-sys", "bitwarden-error/wasm", - "bitwarden-threading/wasm", + "bitwarden-threading/wasm" ] # WASM support [dependencies] diff --git a/crates/bitwarden-send/Cargo.toml b/crates/bitwarden-send/Cargo.toml index a5b500b8d..161be4b93 100644 --- a/crates/bitwarden-send/Cargo.toml +++ b/crates/bitwarden-send/Cargo.toml @@ -18,7 +18,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi", + "dep:uniffi" ] # Uniffi bindings [dependencies] diff --git a/crates/bitwarden-ssh/Cargo.toml b/crates/bitwarden-ssh/Cargo.toml index 4a1cebea7..7211a8357 100644 --- a/crates/bitwarden-ssh/Cargo.toml +++ b/crates/bitwarden-ssh/Cargo.toml @@ -19,7 +19,7 @@ keywords.workspace = true wasm = [ "bitwarden-error/wasm", "dep:tsify", - "dep:wasm-bindgen", + "dep:wasm-bindgen" ] # WASM support uniffi = ["dep:uniffi"] # Uniffi bindings diff --git a/crates/bitwarden-threading/Cargo.toml b/crates/bitwarden-threading/Cargo.toml index 86ebae0f3..b322847e3 100644 --- a/crates/bitwarden-threading/Cargo.toml +++ b/crates/bitwarden-threading/Cargo.toml @@ -17,7 +17,7 @@ wasm = [ "dep:wasm-bindgen", "dep:wasm-bindgen-futures", "dep:js-sys", - "dep:gloo-timers", + "dep:gloo-timers" ] [dependencies] diff --git a/crates/bitwarden-vault/Cargo.toml b/crates/bitwarden-vault/Cargo.toml index be74d60c1..fd5e40540 100644 --- a/crates/bitwarden-vault/Cargo.toml +++ b/crates/bitwarden-vault/Cargo.toml @@ -18,7 +18,7 @@ keywords.workspace = true uniffi = [ "bitwarden-core/uniffi", "bitwarden-crypto/uniffi", - "dep:uniffi", + "dep:uniffi" ] # Uniffi bindings wasm = [ "bitwarden-collections/wasm", @@ -26,7 +26,7 @@ wasm = [ "bitwarden-encoding/wasm", "dep:tsify", "dep:wasm-bindgen", - "dep:wasm-bindgen-futures", + "dep:wasm-bindgen-futures" ] # WASM support [dependencies] From a0f52a3f35db89723424b38e95813795706f520a Mon Sep 17 00:00:00 2001 From: jng Date: Wed, 10 Sep 2025 13:49:12 -0400 Subject: [PATCH 4/6] revert several cargo files --- Cargo.toml | 32 ++++++++++++------------ crates/bitwarden-api-api/Cargo.toml | 19 ++++++++------ crates/bitwarden-api-identity/Cargo.toml | 19 ++++++++------ 3 files changed, 40 insertions(+), 30 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1684497eb..2460b69b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,9 +18,6 @@ keywords = ["bitwarden"] # Define dependencies that are expected to be consistent across all crates [workspace.dependencies] - -# External crates that are expected to maintain a consistent version across all crates -async-trait = ">=0.1.80, <0.2" bitwarden = { path = "crates/bitwarden", version = "=1.0.0" } bitwarden-api-api = { path = "crates/bitwarden-api-api", version = "=1.0.0" } bitwarden-api-identity = { path = "crates/bitwarden-api-identity", version = "=1.0.0" } @@ -46,6 +43,9 @@ bitwarden-uniffi-error = { path = "crates/bitwarden-uniffi-error", version = "=1 bitwarden-uuid = { path = "crates/bitwarden-uuid", version = "=1.0.0" } bitwarden-uuid-macro = { path = "crates/bitwarden-uuid-macro", version = "=1.0.0" } bitwarden-vault = { path = "crates/bitwarden-vault", version = "=1.0.0" } + +# External crates that are expected to maintain a consistent version across all crates +async-trait = ">=0.1.80, <0.2" chrono = { version = ">=0.4.26, <0.5", features = [ "clock", "serde", @@ -64,11 +64,11 @@ reqwest = { version = ">=0.12.5, <0.13", features = [ ], default-features = false } schemars = { version = ">=1.0.0, <2.0", features = ["uuid1", "chrono04"] } serde = { version = ">=1.0, <2.0", features = ["derive"] } -serde-wasm-bindgen = ">=0.6.0, <0.7" serde_bytes = { version = ">=0.11.17, <0.12.0" } serde_json = ">=1.0.96, <2.0" serde_qs = ">=0.12.0, <0.16" serde_repr = ">=0.1.12, <0.2" +serde-wasm-bindgen = ">=0.6.0, <0.7" syn = ">=2.0.87, <3" thiserror = ">=1.0.40, <3" tokio = { version = "1.36.0", features = ["macros"] } @@ -83,6 +83,12 @@ wasm-bindgen-futures = "0.4.41" wasm-bindgen-test = "0.3.45" wiremock = ">=0.6.0, <0.7" +# There is an incompatibility when using pkcs5 and chacha20 on wasm builds. This can be removed once a new +# rustcrypto-formats crate version is released since the fix has been upstreamed. +# https://github.com/RustCrypto/formats/pull/1625 +[patch.crates-io] +pkcs5 = { git = "https://github.com/bitwarden/rustcrypto-formats.git", rev = "2b27c63034217dd126bbf5ed874da51b84f8c705" } + [workspace.lints.clippy] unused_async = "deny" unwrap_used = "deny" @@ -91,23 +97,17 @@ string_slice = "warn" [workspace.lints.rust] missing_docs = "warn" -# There is an incompatibility when using pkcs5 and chacha20 on wasm builds. This can be removed once a new -# rustcrypto-formats crate version is released since the fix has been upstreamed. -# https://github.com/RustCrypto/formats/pull/1625 -[patch.crates-io] -pkcs5 = { git = "https://github.com/bitwarden/rustcrypto-formats.git", rev = "2b27c63034217dd126bbf5ed874da51b84f8c705" } - -# Turn on a small amount of optimisation in development mode. This might interfere when trying to use a debugger -# if the compiler decides to optimize some code away, if that's the case, it can be set to 0 or commented out -[profile.dev] -opt-level = 1 - # Compile all dependencies with some optimizations when building this crate on debug # This slows down clean builds by about 50%, but the resulting binaries can be orders of magnitude faster # As clean builds won't occur very often, this won't slow down the development process [profile.dev.package."*"] opt-level = 2 +# Turn on a small amount of optimisation in development mode. This might interfere when trying to use a debugger +# if the compiler decides to optimize some code away, if that's the case, it can be set to 0 or commented out +[profile.dev] +opt-level = 1 + # Turn on LTO on release mode [profile.release] codegen-units = 1 @@ -122,4 +122,4 @@ opt-level = 3 # Stripping the binary reduces the size by ~30%, but the stacktraces won't be usable anymore. # This is fine as long as we don't have any unhandled panics, but let's keep it disabled for now -# strip = true +# strip = true \ No newline at end of file diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index a7a03456d..548c1aecd 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "bitwarden-api-api" +description = "Api bindings for the Bitwarden API." categories = ["api-bindings"] version.workspace = true @@ -12,10 +13,14 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { version = ">=3.8, <4", default-features = false, features = [ + "base64", + "std", + "macros", +] } +url = ">=2.5, <3" +uuid = { workspace = true } \ No newline at end of file diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index bdbcb8eaa..1706b823e 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "bitwarden-api-identity" +description = "Api bindings for the Bitwarden Identity API." categories = ["api-bindings"] version.workspace = true @@ -12,10 +13,14 @@ license-file.workspace = true keywords.workspace = true [dependencies] -reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart", "http2"] } -serde = { version = "^1.0", features = ["derive"] } -serde_json = "^1.0" -serde_repr = "^0.1" -serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] } -url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } +reqwest = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_repr = { workspace = true } +serde_with = { version = ">=3.8, <4", default-features = false, features = [ + "base64", + "std", + "macros", +] } +url = ">=2.5, <3" +uuid = { workspace = true } \ No newline at end of file From 63bfaac0a69ff598200639f335326cfdba0d11fd Mon Sep 17 00:00:00 2001 From: jng Date: Wed, 10 Sep 2025 13:51:24 -0400 Subject: [PATCH 5/6] missing new lines --- Cargo.toml | 2 +- crates/bitwarden-api-api/Cargo.toml | 2 +- crates/bitwarden-api-identity/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2460b69b4..827edd519 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -122,4 +122,4 @@ opt-level = 3 # Stripping the binary reduces the size by ~30%, but the stacktraces won't be usable anymore. # This is fine as long as we don't have any unhandled panics, but let's keep it disabled for now -# strip = true \ No newline at end of file +# strip = true diff --git a/crates/bitwarden-api-api/Cargo.toml b/crates/bitwarden-api-api/Cargo.toml index 548c1aecd..1c68a6cf1 100644 --- a/crates/bitwarden-api-api/Cargo.toml +++ b/crates/bitwarden-api-api/Cargo.toml @@ -23,4 +23,4 @@ serde_with = { version = ">=3.8, <4", default-features = false, features = [ "macros", ] } url = ">=2.5, <3" -uuid = { workspace = true } \ No newline at end of file +uuid = { workspace = true } diff --git a/crates/bitwarden-api-identity/Cargo.toml b/crates/bitwarden-api-identity/Cargo.toml index 1706b823e..022225451 100644 --- a/crates/bitwarden-api-identity/Cargo.toml +++ b/crates/bitwarden-api-identity/Cargo.toml @@ -23,4 +23,4 @@ serde_with = { version = ">=3.8, <4", default-features = false, features = [ "macros", ] } url = ">=2.5, <3" -uuid = { workspace = true } \ No newline at end of file +uuid = { workspace = true } From b0b62122faecd63162bbe51653518fec5d34ed55 Mon Sep 17 00:00:00 2001 From: jng Date: Thu, 11 Sep 2025 16:34:44 -0400 Subject: [PATCH 6/6] revert cargo --- crates/bitwarden-error-macro/Cargo.toml | 12 ++++++------ crates/bitwarden-error/Cargo.toml | 6 +++--- crates/bitwarden-uniffi/Cargo.toml | 4 ++-- crates/bitwarden-uuid-macro/Cargo.toml | 6 +++--- crates/bitwarden-uuid/Cargo.toml | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/bitwarden-error-macro/Cargo.toml b/crates/bitwarden-error-macro/Cargo.toml index ac88af95b..19d78f001 100644 --- a/crates/bitwarden-error-macro/Cargo.toml +++ b/crates/bitwarden-error-macro/Cargo.toml @@ -14,9 +14,6 @@ repository.workspace = true license-file.workspace = true keywords.workspace = true -[lib] -proc-macro = true - [features] wasm = [] @@ -26,6 +23,12 @@ proc-macro2 = { workspace = true } quote = { workspace = true } syn = { workspace = true } +[lints] +workspace = true + +[lib] +proc-macro = true + [dev-dependencies] bitwarden-error = { workspace = true, features = ["wasm"] } js-sys.workspace = true @@ -33,6 +36,3 @@ serde.workspace = true thiserror.workspace = true tsify.workspace = true wasm-bindgen.workspace = true - -[lints] -workspace = true diff --git a/crates/bitwarden-error/Cargo.toml b/crates/bitwarden-error/Cargo.toml index 15b544ba8..9757669ed 100644 --- a/crates/bitwarden-error/Cargo.toml +++ b/crates/bitwarden-error/Cargo.toml @@ -28,10 +28,10 @@ js-sys = { workspace = true, optional = true } tsify = { workspace = true, optional = true } wasm-bindgen = { workspace = true, optional = true } +[lints] +workspace = true + [dev-dependencies] serde.workspace = true trybuild = "1.0.101" wasm-bindgen-test = { workspace = true } - -[lints] -workspace = true diff --git a/crates/bitwarden-uniffi/Cargo.toml b/crates/bitwarden-uniffi/Cargo.toml index b74299955..76a489869 100644 --- a/crates/bitwarden-uniffi/Cargo.toml +++ b/crates/bitwarden-uniffi/Cargo.toml @@ -12,12 +12,12 @@ repository.workspace = true license-file.workspace = true keywords.workspace = true +[features] + [lib] crate-type = ["lib", "staticlib", "cdylib"] bench = false -[features] - [dependencies] async-trait = { workspace = true } bitwarden-collections = { workspace = true, features = ["uniffi"] } diff --git a/crates/bitwarden-uuid-macro/Cargo.toml b/crates/bitwarden-uuid-macro/Cargo.toml index ec9d8fb69..de8740350 100644 --- a/crates/bitwarden-uuid-macro/Cargo.toml +++ b/crates/bitwarden-uuid-macro/Cargo.toml @@ -14,12 +14,12 @@ repository.workspace = true license-file.workspace = true keywords.workspace = true -[lib] -proc-macro = true - [dependencies] quote = { workspace = true } syn = { workspace = true } [lints] workspace = true + +[lib] +proc-macro = true diff --git a/crates/bitwarden-uuid/Cargo.toml b/crates/bitwarden-uuid/Cargo.toml index 69fbc20a5..37013e93a 100644 --- a/crates/bitwarden-uuid/Cargo.toml +++ b/crates/bitwarden-uuid/Cargo.toml @@ -17,12 +17,12 @@ keywords.workspace = true [dependencies] bitwarden-uuid-macro = { workspace = true } +[lints] +workspace = true + [dev-dependencies] serde = { workspace = true } serde-wasm-bindgen = { workspace = true } serde_json = { workspace = true } uuid = { workspace = true } wasm-bindgen-test = { workspace = true } - -[lints] -workspace = true