-
Notifications
You must be signed in to change notification settings - Fork 6
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
chore(backup): add encrypted stream [WPB-10575] #3154
chore(backup): add encrypted stream [WPB-10575] #3154
Conversation
de9f33f
to
45ef225
Compare
Test Results3 337 tests 3 230 ✅ 5m 33s ⏱️ Results for commit 03d563a. ♻️ This comment has been updated with latest results. |
Datadog ReportBranch report: ✅ 0 Failed, 3230 Passed, 107 Skipped, 37.4s Total Time |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## epic/multiplatform-backup #3154 +/- ##
============================================================
Coverage ? 54.03%
============================================================
Files ? 1246
Lines ? 36152
Branches ? 3656
============================================================
Hits ? 19533
Misses ? 15208
Partials ? 1411 Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good 🎖️ Just one question about tests
backup/src/commonTest/kotlin/com/wire/backup/encryption/XChaChaPoly1305EncryptedStreamTest.kt
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
PR Submission Checklist for internal contributors
The PR Title
SQPIT-764
The PR Description
What's new in this PR?
Issues
Backups should be encrypted. We need to add support for this in the multiplatform library
Solutions
Rely on libsodium and the Kotlin Multiplatform bindings for it.
We can use libsodium's Secret Stream, which allows us to split encrypted messages in chunks, so we don't need to load the whole backup into memory.
This PR adds a wrapper around it, that uses Okio's Sink/Source to read/write data in streams.
On a future PR, I'll add the code that will actually call this, with data being backed up, etc.
This was originally implemented within
:cryptography
, but was only used for BackUps and the code could use a bit of refactoring.Maybe in the future it can be in its own
:secret-stream
module.Dependencies
Needs releases with:
Testing
Test Coverage
PR Post Merge Checklist for internal contributors
References
feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764
.