diff --git a/crates/bitwarden-api-api/src/models/global_domains.rs b/crates/bitwarden-api-api/src/models/global_domains.rs index f0582caa4..10a943482 100644 --- a/crates/bitwarden-api-api/src/models/global_domains.rs +++ b/crates/bitwarden-api-api/src/models/global_domains.rs @@ -11,7 +11,7 @@ #[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)] pub struct GlobalDomains { #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, + pub r#type: Option, #[serde(rename = "domains", skip_serializing_if = "Option::is_none")] pub domains: Option>, #[serde(rename = "excluded", skip_serializing_if = "Option::is_none")] diff --git a/crates/bitwarden/src/platform/domain.rs b/crates/bitwarden/src/platform/domain.rs index 205f6868e..9ed28017b 100644 --- a/crates/bitwarden/src/platform/domain.rs +++ b/crates/bitwarden/src/platform/domain.rs @@ -11,7 +11,7 @@ pub struct GlobalDomains { impl From for GlobalDomains { fn from(global_domains: bitwarden_api_api::models::GlobalDomains) -> Self { GlobalDomains { - r#type: 0, + r#type: global_domains.r#type.unwrap(), domains: global_domains.domains.unwrap(), excluded: global_domains.excluded.unwrap(), } diff --git a/crates/bitwarden/src/platform/sync.rs b/crates/bitwarden/src/platform/sync.rs index a7d97caa5..3315821ab 100644 --- a/crates/bitwarden/src/platform/sync.rs +++ b/crates/bitwarden/src/platform/sync.rs @@ -12,6 +12,8 @@ use crate::{ vault::{Cipher, Collection, Folder}, }; +use super::domain::GlobalDomains; + #[derive(Serialize, Deserialize, Debug, JsonSchema)] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct SyncRequest { @@ -62,7 +64,7 @@ pub struct ProfileOrganizationResponse { #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct DomainResponse { pub equivalent_domains: Vec>, - pub global_equivalent_domains: Vec, + pub global_equivalent_domains: Vec, } #[derive(Serialize, Deserialize, Debug, JsonSchema)] @@ -102,7 +104,7 @@ impl SyncResponse { .map(|c| c.into()) .collect(), ciphers: ciphers.into_iter().map(|c| c.into()).collect(), - domains: response.domains.unwrap().into(), + domains: (*response.domains.unwrap()).into(), policies: response .policies .ok_or(Error::MissingFields)?