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-16231] Improved SDK referencing #12475

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

Conversation

coroiu
Copy link
Contributor

@coroiu coroiu commented Dec 19, 2024

🎟️ Tracking

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

📔 Objective

Currently the DefaultSdkService forcibly clears all sdk instances when creating new ones. This can lead to a situation where a downstream observable is still using the older instances when it gets cleared. This introduces a wrapper class around the instance which will wait for the instance to no longer be in use before clearing it

📸 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 19, 2024

Logo
Checkmarx One – Scan Summary & Details45b91ed5-327e-44c7-a3c5-b4fd7f8d2e59

New Issues (4)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
CRITICAL CVE-2025-0762 Npm-electron-34.0.0 Vulnerable Package
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/org-at-risk-apps-dialog.component.html: 15
detailsMethod at line 15 of /bitwarden_license/bit-web/src/app/tools/access-intelligence/org-at-risk-apps-dialog.component.html sends user information ou...
Attack Vector
MEDIUM Client_Privacy_Violation /bitwarden_license/bit-web/src/app/tools/access-intelligence/org-at-risk-members-dialog.component.html: 15
detailsMethod at line 15 of /bitwarden_license/bit-web/src/app/tools/access-intelligence/org-at-risk-members-dialog.component.html sends user information...
Attack Vector
MEDIUM Missing_HSTS_Header /libs/common/src/services/api.service.ts: 243
detailsThe web-application does not define an HSTS header, leaving it vulnerable to attack.
Attack Vector
Fixed Issues (8)

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

Severity Issue Source File / Package
MEDIUM Angular_Improper_Type_Pipe_Usage /apps/browser/src/autofill/popup/fido2/fido2-use-browser-link.component.html: 1
MEDIUM Client_Privacy_Violation /libs/tools/generator/components/src/username-generator.component.html: 3
MEDIUM Client_Privacy_Violation /libs/vault/src/components/totp-countdown/totp-countdown.component.ts: 17
MEDIUM Client_Privacy_Violation /libs/vault/src/components/totp-countdown/totp-countdown.component.ts: 16
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/organizations/payment-method/organization-payment-method.component.ts: 187
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/shared/payment-method.component.ts: 183

Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 35.32%. Comparing base (70ea75d) to head (0754748).
Report is 5 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...n/src/platform/services/sdk/default-sdk.service.ts 85.71% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #12475   +/-   ##
=======================================
  Coverage   35.32%   35.32%           
=======================================
  Files        2998     2997    -1     
  Lines       90922    90975   +53     
  Branches    16979    16983    +4     
=======================================
+ Hits        32114    32141   +27     
- Misses      56316    56342   +26     
  Partials     2492     2492           

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

@coroiu coroiu changed the title Improved SDK referencing [PM-16231] Improved SDK referencing Jan 9, 2025
coroiu and others added 9 commits January 9, 2025 14:08
* feat: add custom eslint rule

* feat: check for `UsingRequired` instead of hardcoding `Rc`

* chore: move package to libs

* wip: add tests. Tests work when run from same folder but not from root

* fix: add dependencies to renovate

* fix: add empty ts file to avoid typechecking throwing errors

* fix: tests not running from root

* chore: remove unecessary config

* fix: linting
* WIP flat config for eslint

* Add rxjs

* Configure vscode to use flat config

* Fix some new linting errors

* Remove directory overrides of .eslintrc

* Remove explicit dependencies on typescript-eslint/ and @angular-eslint/

* Add missing rules

* Add rxjs recommended rules

* Add storybook and enabled rxjs-angular rule

* Add buildNoRestrictedImports helper

* Ignore platform import restrictions

* Remove unused ignores

* feat: migrate rules over to .mjs and flat config

* feat: implement support for .mjs tests

* chore: remove old package approach

* chore: update package-lock

* fix: add empty TS file to stop errors

* chore: clean up comments

---------

Co-authored-by: Hinton <[email protected]>
@coroiu coroiu marked this pull request as ready for review January 29, 2025 09:04
@coroiu coroiu requested a review from a team as a code owner January 29, 2025 09:04
@coroiu coroiu requested a review from justindbaur January 29, 2025 09:04
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