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

Vault Strict Typing cleanup #12512

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

Conversation

nick-livefront
Copy link
Collaborator

📔 Objective

Another round of cleaning up some of the strict types in libs/vault

  • Added ! to required inputs as stated in the decision document
  • Added ! within the CipherForm stories, these are a constant object for the stories so they're always defined.
  • Used an empty string for toast title to match the needed type
    • Maybe this should be made optional?
  • Used default values or guards where needed/made sense.

🦮 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

- Add null default value for class properties
- Enforce that the userId is passed
- noticeState$ can return null
- refactor title to be a string rather than null
- add guard to exit early on submit but also solves removing null/undefined from typing
- add bang for required types
- add default values for null types
- add bang for required types
- refactor title to be an empty string
@nick-livefront nick-livefront requested a review from a team as a code owner December 20, 2024 17:39
@@ -52,7 +50,7 @@ export class CopyCipherFieldDirective implements OnChanges {
@HostListener("click")
async copy() {
const value = this.getValueToCopy();
await this.copyCipherFieldService.copy(value, this.action, this.cipher);
await this.copyCipherFieldService.copy(value ?? "", this.action, this.cipher);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

❓ Should this throw an error rather than use a default value? I couldn't decide

Copy link
Contributor

github-actions bot commented Dec 20, 2024

Logo
Checkmarx One – Scan Summary & Detailsadb2698b-d74b-4478-bca7-c6ad8aa5ee30

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1166 Attack Vector
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 130 Attack Vector
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 86 Attack Vector
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 38 Attack Vector
MEDIUM Client_Privacy_Violation /apps/web/src/app/auth/lock.component.ts: 20 Attack Vector
MEDIUM Client_Privacy_Violation /apps/web/src/app/auth/lock.component.ts: 20 Attack Vector
MEDIUM Client_Privacy_Violation /apps/desktop/src/auth/lock.component.html: 32 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 130
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 86
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 38
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1253
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1166
MEDIUM Client_Privacy_Violation /apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts: 1166

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 33.68%. Comparing base (6ad35e0) to head (3460ea1).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ault/src/components/copy-cipher-field.directive.ts 0.00% 2 Missing ⚠️
...ault/src/components/password-reprompt.component.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12512      +/-   ##
==========================================
+ Coverage   33.60%   33.68%   +0.08%     
==========================================
  Files        2925     2921       -4     
  Lines       91455    91050     -405     
  Branches    17384    17255     -129     
==========================================
- Hits        30730    30667      -63     
+ Misses      58308    57996     -312     
+ Partials     2417     2387      -30     

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

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.

1 participant