-
Notifications
You must be signed in to change notification settings - Fork 117
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
Enable database encryption for new logins on Nightly/PR builds. #2328
Conversation
Generated by 🚫 Danger Swift against 9e97be8 |
- Slightly reworks how the pusher client ID is generated.
178bc57
to
c498260
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #2328 +/- ##
===========================================
- Coverage 72.53% 72.44% -0.10%
===========================================
Files 512 513 +1
Lines 35327 35334 +7
Branches 16998 16988 -10
===========================================
- Hits 25626 25599 -27
- Misses 9077 9113 +36
+ Partials 624 622 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View 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.
I don't understand a lot of the new passphrase system works but... if we restore the encrypted db from the NSE... how does the NSE decrypt such db? I think we should decrypt it also in the NSE
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.
NOICE
Thank you 🙌 - I totally forgot about the NSE 🤦♂️ |
…ted store or not.
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
📱 Scan the QR code below to install the build for this PR. If you can't scan the QR code you can install the build via this link: https://i.diawi.com/26waWp |
This PR essentially closes #441, although we're going to test on Nightly first to measure any potential performance impact. The following approach has been taken:
RestorationToken
now contains an optionalpassphrase
string which is given to the SDK when restoring a session. Existing users won't have one set, so their accounts will continue to operate without encryption on the db.AuthenticationServiceProxy
will generate a passphrase in the init (which we do for each login so a fresh key will be generated for each login). This passphrase is handed to the SDK which will create the stores, and when a sucessfull login is made, it is handed to the session store to add to theRestorationToken
RestorationToken
each time the restoration token is refreshed. We now need to fetch the token to preserve the passphrase and if it is missing the app will crash (which will likely result in the user being signed out on next launch but if this happened there wouldn't be much we could do app-side to fix it anyway).pusherNotificationClientIdentifier
is generated, as getting it from theClientProxy
through the restoration token is no longer possible, due to the proxy not knowing what the passphrase is.