From 660211082ef415486c5f78b7ae77ab678cc326d9 Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 7 Dec 2023 14:37:28 +0100 Subject: [PATCH] Mock exports (#404) --- crates/bitwarden/src/tool/exporters/client_exporter.rs | 1 + crates/bitwarden/src/tool/exporters/mod.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/bitwarden/src/tool/exporters/client_exporter.rs b/crates/bitwarden/src/tool/exporters/client_exporter.rs index f14cbc846..9e0dfd5fc 100644 --- a/crates/bitwarden/src/tool/exporters/client_exporter.rs +++ b/crates/bitwarden/src/tool/exporters/client_exporter.rs @@ -10,6 +10,7 @@ pub struct ClientExporters<'a> { } impl<'a> ClientExporters<'a> { + /// **Draft:** Export the vault as a CSV, JSON, or encrypted JSON file. pub async fn export_vault( &self, folders: Vec, diff --git a/crates/bitwarden/src/tool/exporters/mod.rs b/crates/bitwarden/src/tool/exporters/mod.rs index 1170dbd38..d03ddeb77 100644 --- a/crates/bitwarden/src/tool/exporters/mod.rs +++ b/crates/bitwarden/src/tool/exporters/mod.rs @@ -20,9 +20,14 @@ pub enum ExportFormat { pub(super) fn export_vault( _folders: Vec, _ciphers: Vec, - _format: ExportFormat, + format: ExportFormat, ) -> Result { - todo!(); + Ok(match format { + ExportFormat::Csv => "Csv".to_owned(), + ExportFormat::Json => "Json".to_owned(), + ExportFormat::AccountEncryptedJson => "AccountEncryptedJson".to_owned(), + ExportFormat::EncryptedJson { .. } => "EncryptedJson".to_owned(), + }) } pub(super) fn export_organization_vault(