Skip to content

Commit

Permalink
Resolve review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Hinton committed Feb 5, 2024
1 parent 2cc612c commit 522e637
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
11 changes: 9 additions & 2 deletions crates/bitwarden-exporters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,19 @@ pub enum Format {
EncryptedJson { password: String },
}

/// Export representation of a Bitwarden folder.
///
/// These are mostly duplicated from the `bitwarden` vault models to facilitate a stable export API
/// that is not tied to the internal vault models. We may revisit this in the future.
pub struct Folder {
pub id: Uuid,
pub name: String,
}

/// Export representation of a Bitwarden cipher.
///
/// These are mostly duplicated from the `bitwarden` vault models to facilitate a stable export API
/// that is not tied to the internal vault models. We may revisit this in the future.
pub struct Cipher {
pub id: Uuid,
pub folder_id: Option<Uuid>,
Expand Down Expand Up @@ -116,7 +124,6 @@ pub fn export(folders: Vec<Folder>, ciphers: Vec<Cipher>, format: Format) -> Str
match format {
Format::Csv => export_csv(folders, ciphers).unwrap(),
Format::Json => export_json(folders, ciphers).unwrap(),
// Format::EncryptedJson { password } => export_encrypted_json(folders, ciphers, password),
_ => todo!(),
Format::EncryptedJson { password: _ } => todo!(),

Check warning on line 127 in crates/bitwarden-exporters/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-exporters/src/lib.rs#L123-L127

Added lines #L123 - L127 were not covered by tests
}
}

Check warning on line 129 in crates/bitwarden-exporters/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-exporters/src/lib.rs#L129

Added line #L129 was not covered by tests
3 changes: 1 addition & 2 deletions crates/bitwarden/src/tool/exporters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ impl From<ExportFormat> for bitwarden_exporters::Format {
mod tests {
use chrono::{DateTime, Utc};

use crate::vault::{login::LoginView, CipherRepromptType};

use super::*;
use crate::vault::{login::LoginView, CipherRepromptType};

#[test]
fn test_try_from_folder_view() {
Expand Down
8 changes: 4 additions & 4 deletions crates/bitwarden/src/vault/cipher/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ pub struct Field {
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[cfg_attr(feature = "mobile", derive(uniffi::Record))]
pub struct FieldView {
pub name: Option<String>,
pub value: Option<String>,
pub r#type: FieldType,
pub(crate) name: Option<String>,
pub(crate) value: Option<String>,
pub(crate) r#type: FieldType,

pub linked_id: Option<LinkedIdType>,
pub(crate) linked_id: Option<LinkedIdType>,
}

impl KeyEncryptable<SymmetricCryptoKey, Field> for FieldView {
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden/src/vault/cipher/secure_note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct SecureNote {
#[serde(rename_all = "camelCase", deny_unknown_fields)]
#[cfg_attr(feature = "mobile", derive(uniffi::Record))]
pub struct SecureNoteView {
pub r#type: SecureNoteType,
pub(crate) r#type: SecureNoteType,
}

impl KeyEncryptable<SymmetricCryptoKey, SecureNote> for SecureNoteView {
Expand Down

0 comments on commit 522e637

Please sign in to comment.