server icon indicating copy to clipboard operation
server copied to clipboard

[PM-19145] refactor organization service.import async

Open BTreston opened this issue 7 months ago â€ĸ 3 comments

đŸŽŸī¸ Tracking

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

📔 Objective

Refactors import method as a command utilizing InviteOrganizationUsersCommand

📸 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

BTreston avatar May 09 '25 18:05 BTreston

Logo Checkmarx One – Scan Summary & Details – 1cb3b67f-97d2-409d-bbb2-b7f4c0641b45

New Issues (2)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 560
detailsMethod PutResetPassword at line 560 of /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs gets a parameter from a user request from ...
ID: LfmkDB43%2FJicpzxsTXfItzusLX0%3D
Attack Vector
MEDIUM CSRF /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 422
detailsMethod BulkConfirm at line 422 of /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs gets a parameter from a user request from model...
ID: c2tn2v%2FGV%2BGjWy7jOD%2FdQzWz7C0%3D
Attack Vector
Fixed Issues (6)

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

Severity Issue Source File / Package
HIGH ~~CVE-2022-37620~~ Npm-html-minifier-4.0.0
MEDIUM ~~CSRF~~ /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 342
MEDIUM ~~CSRF~~ /src/Api/AdminConsole/Controllers/OrganizationUsersController.cs: 466
MEDIUM ~~Use_Of_Hardcoded_Password~~ /src/Core/Constants.cs: 203
LOW ~~CVE-2025-5889~~ Npm-brace-expansion-2.0.1
LOW ~~CVE-2025-5889~~ Npm-brace-expansion-1.1.11

github-actions[bot] avatar May 09 '25 18:05 github-actions[bot]

Codecov Report

Attention: Patch coverage is 67.29323% with 87 lines in your changes missing coverage. Please review.

Project coverage is 48.52%. Comparing base (676f39c) to head (2e4d89c). Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
.../Import/ImportOrganizationUsersAndGroupsCommand.cs 73.00% 46 Missing and 8 partials :warning:
...sers/InviteUsers/InviteOrganizationUsersCommand.cs 0.00% 22 Missing :warning:
...nsole/Public/Controllers/OrganizationController.cs 56.52% 9 Missing and 1 partial :warning:
...ationFeatures/Import/OrganizationUserImportData.cs 85.71% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5800      +/-   ##
==========================================
+ Coverage   48.02%   48.52%   +0.50%     
==========================================
  Files        1727     1732       +5     
  Lines       76401    76594     +193     
  Branches     6843     6837       -6     
==========================================
+ Hits        36691    37170     +479     
+ Misses      38226    37929     -297     
- Partials     1484     1495      +11     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar May 12 '25 19:05 codecov[bot]