Skip to content

Commit 21432b5

Browse files
authored
[PM-25012] Add data field to Cipher type, and add functions for client-side parsing of the field. (#517)
## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-25012 ## 📔 Objective This PR adds the `data` field to the Cipher struct, and adds a function for parsing that field into the appropriate CipherType (Identity, SshKey, Login, SecureNote, Card) on the client-side, rather than consuming the server-provided values. The function sits unused - after #455 is merged, we should consider adding this to the `CiphersClient::get` and `CipherClient::list` functions behind a new feature flag.
1 parent 8ef7951 commit 21432b5

File tree

10 files changed

+434
-8
lines changed

10 files changed

+434
-8
lines changed

crates/bitwarden-vault/src/cipher/attachment.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ mod tests {
322322
deleted_date: None,
323323
revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(),
324324
archived_date: None,
325+
data: None,
325326
},
326327
attachment,
327328
contents: contents.as_slice(),
@@ -377,6 +378,7 @@ mod tests {
377378
deleted_date: None,
378379
revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(),
379380
archived_date: None,
381+
data: None,
380382
};
381383

382384
let enc_file = B64::try_from("Ao00qr1xLsV+ZNQpYZ/UwEwOWo3hheKwCYcOGIbsorZ6JIG2vLWfWEXCVqP0hDuzRvmx8otApNZr8pJYLNwCe1aQ+ySHQYGkdubFjoMojulMbQ959Y4SJ6Its/EnVvpbDnxpXTDpbutDxyhxfq1P3lstL2G9rObJRrxiwdGlRGu1h94UA1fCCkIUQux5LcqUee6W4MyQmRnsUziH8gGzmtI=").unwrap();
@@ -436,6 +438,7 @@ mod tests {
436438
deleted_date: None,
437439
revision_date: "2023-07-27T19:28:05.240Z".parse().unwrap(),
438440
archived_date: None,
441+
data: None,
439442
};
440443

441444
let enc_file = B64::try_from("AsQLXOBHrJ8porroTUlPxeJOm9XID7LL9D2+KwYATXEpR1EFjLBpcCvMmnqcnYLXIEefe9TCeY4Us50ux43kRSpvdB7YkjxDKV0O1/y6tB7qC4vvv9J9+O/uDEnMx/9yXuEhAW/LA/TsU/WAgxkOM0uTvm8JdD9LUR1z9Ql7zOWycMVzkvGsk2KBNcqAdrotS5FlDftZOXyU8pWecNeyA/w=").unwrap();

crates/bitwarden-vault/src/cipher/card.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use super::cipher::CipherKind;
1212
use crate::{Cipher, VaultParseError, cipher::cipher::CopyableCipherFields};
1313

1414
#[derive(Serialize, Deserialize, Debug, Clone)]
15-
#[serde(rename_all = "camelCase", deny_unknown_fields)]
15+
#[serde(rename_all = "camelCase")]
1616
#[cfg_attr(feature = "uniffi", derive(uniffi::Record))]
1717
#[cfg_attr(feature = "wasm", derive(Tsify), tsify(into_wasm_abi, from_wasm_abi))]
1818
pub struct Card {

0 commit comments

Comments
 (0)