-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for decrypting folders
- Loading branch information
Showing
8 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
mod client; | ||
mod crypto; | ||
mod custom_types; | ||
mod error; | ||
mod vault; | ||
|
||
pub use client::BitwardenClient; | ||
pub use crypto::ClientCrypto; | ||
pub use vault::folders::ClientFolders; | ||
pub use vault::ClientVault; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use std::rc::Rc; | ||
|
||
use bitwarden::{ | ||
vault::{ClientVaultExt, Folder, FolderView}, | ||
Client, | ||
}; | ||
use wasm_bindgen::prelude::*; | ||
|
||
use crate::error::Result; | ||
|
||
#[wasm_bindgen] | ||
pub struct ClientFolders(pub(crate) Rc<Client>); | ||
|
||
#[wasm_bindgen] | ||
impl ClientFolders { | ||
/// Decrypt folder | ||
pub fn decrypt(&self, folder: Folder) -> Result<FolderView> { | ||
Ok(self.0.vault().folders().decrypt(folder)?) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
pub mod folders; | ||
|
||
use std::rc::Rc; | ||
|
||
use bitwarden::Client; | ||
use wasm_bindgen::prelude::*; | ||
|
||
use crate::ClientFolders; | ||
|
||
#[wasm_bindgen] | ||
pub struct ClientVault(pub(crate) Rc<Client>); | ||
|
||
#[wasm_bindgen] | ||
impl ClientVault { | ||
pub fn folders(&self) -> ClientFolders { | ||
ClientFolders(self.0.clone()) | ||
} | ||
} |