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-14445] TS strict for Key Management Biometrics #13039

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

Conversation

mzieniukbw
Copy link
Contributor

@mzieniukbw mzieniukbw commented Jan 23, 2025

🎟️ Tracking

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

📔 Objective

Due to change on null expectations in state (platform), a lot of code all around had to change to reflect that too, that are already on strict mode too.

Enabled TypeScript strict mode for Key Management biometrics owned code.
Plus small refactoring around secure channel in apps/browser/src/background/nativeMessaging.background.ts to make it easier.

📸 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 Jan 23, 2025

Logo
Checkmarx One – Scan Summary & Details5255f355-bbca-46ec-b02c-8fc7f2548dad

Great job, no security vulnerabilities found in this Pull Request

@mzieniukbw mzieniukbw requested review from a team as code owners January 23, 2025 23:28
@mzieniukbw mzieniukbw requested a review from Jingo88 January 23, 2025 23:28
willmartian
willmartian previously approved these changes Jan 24, 2025
Copy link
Contributor

@willmartian willmartian left a comment

Choose a reason for hiding this comment

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

CL type change looks good; ty!

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 21.56863% with 80 lines in your changes missing coverage. Please review.

Project coverage is 35.03%. Comparing base (ee70c67) to head (bc2faa0).

Files with missing lines Patch % Lines
...owser/src/background/nativeMessaging.background.ts 0.00% 55 Missing ⚠️
.../src/services/biometric-message-handler.service.ts 61.11% 5 Missing and 2 partials ⚠️
...agement/biometrics/main-biometrics-ipc.listener.ts 0.00% 4 Missing ⚠️
...y-management/biometrics/main-biometrics.service.ts 0.00% 4 Missing ⚠️
...gement/biometrics/os-biometrics-windows.service.ts 0.00% 4 Missing ⚠️
...nagement/biometrics/os-biometrics-linux.service.ts 0.00% 3 Missing ⚠️
...common/src/platform/theming/theme-state.service.ts 0.00% 2 Missing ⚠️
...nagement/src/biometrics/biometric-state.service.ts 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13039   +/-   ##
=======================================
  Coverage   35.03%   35.03%           
=======================================
  Files        3034     3034           
  Lines       92647    92681   +34     
  Branches    16861    16891   +30     
=======================================
+ Hits        32458    32472   +14     
- Misses      57729    57747   +18     
- Partials     2460     2462    +2     

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

quexten
quexten previously approved these changes Jan 24, 2025
Copy link
Contributor

@quexten quexten left a comment

Choose a reason for hiding this comment

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

Changes look good from my side for the KM owned biometrics code; I have added some minor suggestions for improvement.

@djsmith85 djsmith85 requested a review from audreyality January 24, 2025 11:04
audreyality

This comment was marked as outdated.

Jingo88
Jingo88 previously approved these changes Jan 27, 2025
audreyality
audreyality previously approved these changes Jan 28, 2025
quexten
quexten previously approved these changes Jan 28, 2025
Copy link
Contributor

@quexten quexten left a comment

Choose a reason for hiding this comment

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

Changes to KM code LGTM!

Jingo88
Jingo88 previously approved these changes Jan 29, 2025
Copy link
Member

@justindbaur justindbaur left a comment

Choose a reason for hiding this comment

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

Platform changes look great overall, happy to have these annotated. Just a couple questions about a couple hopefully unnecessary changes. So that we can avoid everyone having to change their own reference of GlobalState<MyType> to GlobalState<MyType | null>.

libs/common/src/platform/state/state.provider.ts Outdated Show resolved Hide resolved
libs/common/spec/fake-state-provider.ts Outdated Show resolved Hide resolved
willmartian
willmartian previously approved these changes Feb 4, 2025
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.

8 participants