-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make AccessKey the key entrypoint for public apis (#285)
* Make AccessKey the key entrypoint for public apis * Remove todos * Update wnfs/src/private/share.rs Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com> Signed-off-by: Stephen Akinyemi <appcypher@outlook.com> * Refactor get_multivalue --------- Signed-off-by: Stephen Akinyemi <appcypher@outlook.com> Co-authored-by: Philipp Krüger <philipp.krueger1@gmail.com>
- Loading branch information
Showing
25 changed files
with
448 additions
and
846 deletions.
There are no files selected for viewing
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,31 @@ | ||
use wasm_bindgen::prelude::wasm_bindgen; | ||
use wnfs::private::AccessKey as WnfsAccessKey; | ||
|
||
//-------------------------------------------------------------------------------------------------- | ||
// Type Definitions | ||
//-------------------------------------------------------------------------------------------------- | ||
|
||
#[wasm_bindgen] | ||
pub struct AccessKey(pub(crate) WnfsAccessKey); | ||
|
||
//-------------------------------------------------------------------------------------------------- | ||
// Implementations | ||
//-------------------------------------------------------------------------------------------------- | ||
|
||
#[wasm_bindgen] | ||
impl AccessKey { | ||
#[wasm_bindgen(js_name = "getLabel")] | ||
pub fn get_label(&self) -> Vec<u8> { | ||
self.0.get_label().to_vec() | ||
} | ||
|
||
#[wasm_bindgen(js_name = "getTemporalKey")] | ||
pub fn get_temporal_key(&self) -> Vec<u8> { | ||
self.0.get_temporal_key().unwrap().0.as_bytes().to_vec() | ||
} | ||
|
||
#[wasm_bindgen(js_name = "getContentCid")] | ||
pub fn get_content_cid(&self) -> Vec<u8> { | ||
self.0.get_content_cid().to_bytes() | ||
} | ||
} |
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,19 +1,19 @@ | ||
mod access_key; | ||
mod directory; | ||
mod exchange_key; | ||
mod file; | ||
mod forest; | ||
mod namefilter; | ||
mod node; | ||
mod privateref; | ||
mod rng; | ||
mod share; | ||
|
||
pub use access_key::*; | ||
pub use directory::*; | ||
pub use exchange_key::*; | ||
pub use file::*; | ||
pub use forest::*; | ||
pub use namefilter::*; | ||
pub use node::*; | ||
pub use privateref::*; | ||
pub use rng::*; | ||
pub use share::*; |
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 was deleted.
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
Oops, something went wrong.