feat: Implement public directory cp & more efficient copy for PrivateFile
#319
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thebare_name
property ofExternalFileContent
).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.