-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Streaming write for PrivateFile (#163)
* Add initial structure * Implement sharing * refactor: Remove `content_key` from `PrivateRef` It can always be derived from `revision_key`. Storing it will only make it possible for `revision_key` and `content_key` to get out-of-sync. * refactor: Extract out `PrivateDirectoryContent` * Key-wrap using AES-KWP * refactor: use AES-KWP for encrypting previous links * refactor: Previous to be a set of encrypted Cids instead of an encrypted set of Cids * refactor: Add "# of revisions back" to backpointers * refactor: Extract private file content into struct * refactor: Move AES-KWP logic into `RevisionKey` * refactor: Move AES-GCM logic into `ContentKey` * chore: Add TODO comments for missing docs * fix: doctests due to refactor (whoops) * refactor: remove `KeyType` struct * refactor: Implement `load` & `store` for PNH * refactor: Split header & content, add disambiguation So: - PrivateNodeHeader gets its own block - PrivateFile and PrivateDirectory refer back to the header via a CID - PrivateRef gets its own "disambiguation pointer" content_cid - PrivateForest now resolves PrivateRefs - PrivateRefs always refer to pre-existing content, never to "open slots" * refactor: Introduce `RevisionRef` & fix examples * refactor: Adjust doctests ✅ * refactor: remove `.derive_private_ref()` * refactor: Simplify `SharePointer` creation * refactor: Remove `Version` from private dir content * refactor: move `persisted_as` into dir content * refactor: Move `persisted_as` into private file content * refactor: Docs & more * clippy: configure to ignore `Encrypted` wrapper * refactor: Rename to `TemporalKey` & `SnapshotKey` instead of `RevisionKey` and `ContentKey`, respectively. * refactor: Use `&mut Rc<PrivateForest>` and similar (#161) Also, make use of `Rc::make_mut`, accordingly. * refactor: Some fixes for wasm * feat: Refactor & add stuff to the wasm interface * feat: Allow wasm extracting values out of `PrivateRef` * fix: Small fix in doctest * feat: try implementing streaming write Having an issue with it in tests though. It stack-overflows. * fix: Fix streaming write implementation * docs: Write 'em * fix: Serialization and deserialization of share payloads * chore: Remove logging 🔇 * refactor: Just use a different tagging mechanism * refactor: Use `test_setup!` more consistently * fix: incorrectly resolved merge conflicts * fix: wasm tests. Also: Pin newest wasm-bindgen version (it had some good bugfixes regarding FinalizationRegistries recently) * refactor: Add a test fixture for testing streaming write * fix: ✅ Fix tests --------- Co-authored-by: Stephen Akinyemi <[email protected]>
- Loading branch information
Showing
7 changed files
with
253 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Seeds for failure cases proptest has generated in the past. It is | ||
# automatically read and these particular cases re-run before any | ||
# novel cases are generated. | ||
# | ||
# It is recommended to check this file in to source control so that | ||
# everyone who runs the test benefits from these saved cases. | ||
cc ff287a98919993cde9c4c1debe5a40170697949b611b0d37c24c9b6bce66ffc3 # shrinks to input = _SnapshotKeyCanEncryptAndDecryptDataInPlaceArgs { data: [], key_bytes: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], nonce: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] } |
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
Binary file not shown.