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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

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 & Detailsd260ab42-1fff-40c2-a5de-7f6146976c40

Fixed Issues

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /libs/vault/src/components/download-attachment/download-attachment.component.ts: 29
MEDIUM Client_Privacy_Violation /libs/vault/src/components/download-attachment/download-attachment.component.ts: 29
LOW Client_DOM_Open_Redirect /apps/browser/src/auth/popup/login-via-auth-request-v1.component.ts: 53
LOW Client_DOM_Open_Redirect /apps/desktop/src/auth/login/login-via-auth-request-v1.component.ts: 63
LOW Client_DOM_Open_Redirect /apps/browser/src/auth/popup/login-via-auth-request-v1.component.ts: 53
LOW Client_DOM_Open_Redirect /apps/desktop/src/auth/login/login-via-auth-request-v1.component.ts: 63
LOW Client_DOM_Open_Redirect /apps/browser/src/vault/popup/components/vault/attachments.component.ts: 37

@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 46.19883% with 92 lines in your changes missing coverage. Please review.

Project coverage is 33.80%. Comparing base (0619ef5) to head (ce56512).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/browser/src/background/main.background.ts 0.00% 5 Missing ⚠️
libs/angular/src/services/jslib-services.module.ts 0.00% 5 Missing ⚠️
...mmon/src/key-management/services/encrypt.worker.ts 0.00% 5 Missing ⚠️
apps/desktop/src/app/services/services.module.ts 0.00% 3 Missing ⚠️
...ervices/master-password/master-password.service.ts 0.00% 3 Missing ⚠️
...ices/multithread-encrypt.service.implementation.ts 0.00% 3 Missing ⚠️
apps/browser/src/popup/services/services.module.ts 0.00% 2 Missing ⚠️
...pps/desktop/src/app/accounts/settings.component.ts 0.00% 2 Missing ⚠️
.../src/services/biometric-message-handler.service.ts 0.00% 2 Missing ⚠️
...src/services/duckduckgo-message-handler.service.ts 0.00% 2 Missing ⚠️
... and 58 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12576      +/-   ##
==========================================
+ Coverage   33.78%   33.80%   +0.01%     
==========================================
  Files        2912     2919       +7     
  Lines       90693    90608      -85     
  Branches    17151    17152       +1     
==========================================
- Hits        30641    30630      -11     
+ Misses      57666    57591      -75     
- Partials     2386     2387       +1     

☔ 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
@@ -1,6 +1,6 @@
// FIXME: Update this file to be type safe and remove this and next line
// @ts-strict-ignore
import { EncString } from "../../platform/models/domain/enc-string";
import { EncString } from "../../../../key-management/src/cryptography/domain/enc-string";
Copy link
Member

Choose a reason for hiding this comment

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

⚠️ This reference should use @bitwarden/key-management. There's several like it. Please review the PR for all instances.

import { OrgKey } from "@bitwarden/common/types/key";

import { EncString } from "../../../../../key-management/src/cryptography/domain/enc-string";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use @bitwarden/key-management instead of relative pathing?

import {
EncString,
EncryptedString,
} from "../../../../key-management/src/cryptography/domain/enc-string";
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use @bitwarden/key-management instead of relative pathing?

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

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.

6 participants