Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement public directory cp & more efficient copy for PrivateFile #319

Merged
merged 3 commits into from
Aug 2, 2023

Conversation

matheus23
Copy link
Member

Fixes #316 (although what was missing was actually cp for Public directory, not private)

Since #306 we can actually do a more efficient copy of external PrivateFile content that doesn't require re-encryption, because we can directly refer to the old content (using the bare_name property of ExternalFileContent).

I've decided to set this as the default copy algorithm. There's no benefit to re-encrypting the actual content bytes. You already get the key rotation on the wrapping PrivateFile, and it doesn't implicitly give you access to anything else besides the bytes you're supposed to be able to read.

I think this supersedes #256 at least in terms of what Banyan needs.

@matheus23 matheus23 self-assigned this Aug 1, 2023
@matheus23 matheus23 requested a review from a team as a code owner August 1, 2023 15:30
@codecov
Copy link

codecov bot commented Aug 1, 2023

Codecov Report

Merging #319 (7f15ee6) into main (55cf2e0) will increase coverage by 0.02%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #319      +/-   ##
==========================================
+ Coverage   56.28%   56.30%   +0.02%     
==========================================
  Files          43       43              
  Lines        3207     3204       -3     
  Branches      775      773       -2     
==========================================
- Hits         1805     1804       -1     
  Misses        904      904              
+ Partials      498      496       -2     
Files Changed Coverage Δ
wnfs/src/private/directory.rs 67.78% <ø> (ø)
wnfs/src/private/node/node.rs 69.94% <0.00%> (-0.18%) ⬇️
wnfs/src/public/directory.rs 70.42% <ø> (ø)
wnfs/src/private/file.rs 78.91% <100.00%> (+0.53%) ⬆️

Copy link
Member

@appcypher appcypher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀🚀

@matheus23 matheus23 merged commit cebb956 into main Aug 2, 2023
10 checks passed
@matheus23 matheus23 deleted the matheus23/copy branch August 2, 2023 08:08
@github-actions github-actions bot mentioned this pull request Aug 3, 2023
This was referenced Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wasm: Add bindings for cp in PrivateDirectory
2 participants