Skip to content
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

[PM-15994] Move encryption to km ownership #12576

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

quexten
Copy link
Contributor

@quexten quexten commented Dec 25, 2024

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-15994

📔 Objective

Moves a lot of the remaining crypto domain from platform to km, since km will own the corresponding sdk code in the long term too. (Further, this also cleans up some internal km ownership and file structure in the process).

Specifically transferred:

  • Encrypt service, (interface, implementations, and the service worker).
  • Key Generation service
  • EncString/similar
  • SymmetricCryptoKey
  • Cryptofunctionservice (interface, implementations)

📸 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

Copy link
Contributor

github-actions bot commented Dec 25, 2024

Logo
Checkmarx One – Scan Summary & Detailscddec66d-4a33-4f7d-97a8-9974a91c1e37

Fixed Issues (5)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /libs/tools/generator/components/src/username-generator.component.html: 3
LOW Client_DOM_Open_Redirect /apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts: 155
LOW Client_DOM_Open_Redirect /apps/web/src/app/billing/organizations/payment-method/organization-payment-method.component.ts: 187
LOW Client_DOM_Open_Redirect /apps/web/src/app/billing/shared/payment-method.component.ts: 155
LOW Client_DOM_Open_Redirect /apps/web/src/app/billing/shared/payment-method.component.ts: 183

@quexten quexten changed the title Km/tmp ownership 2 Move encryption to km ownership Dec 25, 2024
@quexten quexten changed the title Move encryption to km ownership [PM-15994] Move encryption to km ownership Dec 25, 2024
Copy link

codecov bot commented Dec 25, 2024

Codecov Report

Attention: Patch coverage is 55.09259% with 97 lines in your changes missing coverage. Please review.

Project coverage is 35.25%. Comparing base (1fc20b5) to head (8428e68).
Report is 3 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
libs/angular/src/services/jslib-services.module.ts 0.00% 8 Missing ⚠️
apps/browser/src/background/main.background.ts 0.00% 7 Missing ⚠️
...c/key-management/crypto/services/encrypt.worker.ts 0.00% 5 Missing ⚠️
apps/browser/src/popup/services/services.module.ts 0.00% 4 Missing ⚠️
...src/services/duckduckgo-message-handler.service.ts 0.00% 4 Missing ⚠️
apps/desktop/src/app/services/services.module.ts 0.00% 3 Missing ⚠️
...b/src/app/tools/send/send-access-file.component.ts 0.00% 3 Missing ⚠️
...-manager/service-accounts/access/access.service.ts 0.00% 3 Missing ⚠️
...ervices/master-password/master-password.service.ts 0.00% 3 Missing ⚠️
...owser/src/background/nativeMessaging.background.ts 0.00% 2 Missing ⚠️
... and 50 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12576   +/-   ##
=======================================
  Coverage   35.25%   35.25%           
=======================================
  Files        2997     2998    +1     
  Lines       90886    90890    +4     
  Branches    16973    16973           
=======================================
+ Hits        32041    32045    +4     
  Misses      56357    56357           
  Partials     2488     2488           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@quexten quexten marked this pull request as ready for review December 25, 2024 12:34
@quexten quexten requested review from a team as code owners December 25, 2024 12:34
JimmyVo16
JimmyVo16 previously approved these changes Dec 26, 2024
jprusik
jprusik previously approved these changes Jan 3, 2025
Copy link
Contributor

@jprusik jprusik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Autofill concerns

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SymmetricCryptoKey
EncString
EncArrayBuffer
EncryptedString
EncryptionType
seem to sometimes use relative imports. If you could please check them that would be appreciated.

@quexten quexten force-pushed the km/tmp-ownership-2 branch from 8a91f82 to d914f60 Compare January 24, 2025 17:17
@quexten quexten marked this pull request as ready for review January 24, 2025 18:37
@quexten
Copy link
Contributor Author

quexten commented Jan 24, 2025

Note: At this point the PR had to be updated to move dependencies to common/key-management/crypto instead of the key-management package to avoid dependency cycles.

@trmartin4
Copy link
Member

@quexten due to the size of this PR, the Auth team has had issues with tooling to properly perform a review. Could you please see if you could reasonably break this up into multiple PRs for review? Perhaps a single service at a time?

@quexten quexten marked this pull request as draft January 28, 2025 17:19
@quexten
Copy link
Contributor Author

quexten commented Jan 28, 2025

@quexten due to the size of this PR, the Auth team has had issues with tooling to properly perform a review. Could you please see if you could reasonably break this up into multiple PRs for review? Perhaps a single service at a time?

I'll look into it. I believe in the first version of this PR it made sense to move all dependencies at once, since we were moving them to a separate package, leading to quite the mess of imports otherwise, but since it retargets the common library now, I think we can break it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants