clients
clients copied to clipboard
[PM-21378] Switch encrypt service to use SDK functions
đī¸ Tracking
https://bitwarden.atlassian.net/browse/PM-21378
đ Objective
Switches all non-deprecated encrypt service functions to use the sdk via PureCrypto.
đ¸ Screenshots
â° Reminders before review
- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team
đĻŽ Reviewer guidelines
- đ (
:+1:) or similar for great changes - đ (
:memo:) or âšī¸ (:information_source:) for notes or general info - â (
:question:) for questions - đ¤ (
:thinking:) or đ (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - đ¨ (
:art:) for suggestions / improvements - â (
:x:) or â ī¸ (:warning:) for more significant problems or concerns needing attention - đą (
:seedling:) or âģī¸ (:recycle:) for future improvements or indications of technical debt - â (
:pick:) for minor or nitpick changes
Codecov Report
Attention: Patch coverage is 62.65060% with 31 lines in your changes missing coverage. Please review.
Project coverage is 37.33%. Comparing base (
8dc97ca) to head (df21017). Report is 1 commits behind head on main.
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## main #14538 +/- ##
==========================================
- Coverage 37.48% 37.33% -0.15%
==========================================
Files 3314 3315 +1
Lines 94426 94233 -193
Branches 14245 14201 -44
==========================================
- Hits 35394 35184 -210
- Misses 57554 57580 +26
+ Partials 1478 1469 -9
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Checkmarx One â Scan Summary & Details â e59ab219-32f0-4538-bda7-8c6909f135d3
Great job, no security vulnerabilities found in this Pull Request
There is some test coverage missing for the new == null cases - see codevov report for details.
@mzieniukbw Added additional tests, ~~but now the coverage CI is failing (showing 0%) again..~~
@mzieniukbw Since you last reviewed I added no significant new code, aside from backporting await SdkLoadService.Ready;. to this. However, I have started dropping a fair bit of now unused code. A second PR will subsequently follow, dropping more code, the second PR will need other codeowners, this one does not.
Follow-up PR is here for reference: https://github.com/bitwarden/clients/pull/15153
Looks like there was a bug in early initalization where the session decryption on browser expected encrypt service to return "null", but the SDK version throws instead. Removing the feature flag caused that code to use the SDK version (where before it seemingly did not), leading to an ususable browser extension after process reload, so this requires a small change in platforms code.
And looks like tools usage on sends accidentally relied on an incorrect behavior of encrypt service. encryptString(null, key) should not return null, but is unsupported, so I added FIXME's, and a temporary workaround for this behavior to catch other cases.
Since this had a lot of changes after approving reviews, noting that this has now passed QA and should be good to merge/review once more!
Note for platform: This adds SDK loading in electron main. This is needed for biometrics to work.
Quality Gate passed
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code