Skip to content

[PM-31942] Implement File persistence service (pt. 2)#19962

Draft
lastbestdev wants to merge 12 commits intodirt/api-service/pm-31942from
dirt/file-persistence/pm-31942
Draft

[PM-31942] Implement File persistence service (pt. 2)#19962
lastbestdev wants to merge 12 commits intodirt/api-service/pm-31942from
dirt/file-persistence/pm-31942

Conversation

@lastbestdev
Copy link
Copy Markdown
Contributor

Hold/update base to main after #19922 merges

🎟️ Tracking

Part 2 of https://bitwarden.atlassian.net/browse/PM-31942

📔 Objective

Implements the persistence logic for saving and loading Access Intelligence report files. Includes unit tests.

📸 Screenshots

N/A

…b or server self host. add report data from file to the accessreport data model
… api-service branch

Use AccessReportCreateApi (instead of AccessReportApi) for the createReport$ request,
and cast metrics to Record<string, number> to match the updateSummaryData$ signature
from the dirt/api-service/pm-31942 abstraction.
…and Direct

Replace the Azure/Direct branch with a single fileUploadService.upload call using
result.fileUploadType. For Direct uploads, postDirect delegates to uploadReportFile$
on the API service.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 3, 2026

Codecov Report

❌ Patch coverage is 81.72043% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 46.54%. Comparing base (5a638c6) to head (180d3b4).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ons/api/default-access-intelligence-api.service.ts 0.00% 7 Missing ⚠️
...ons/persistence/file-report-persistence.service.ts 90.90% 6 Missing and 1 partial ⚠️
...ess-intelligence/models/data/access-report.data.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                      @@
##           dirt/api-service/pm-31942   #19962      +/-   ##
=============================================================
+ Coverage                      46.48%   46.54%   +0.05%     
=============================================================
  Files                           3871     3871              
  Lines                         115374   115335      -39     
  Branches                       17569    17557      -12     
=============================================================
+ Hits                           53630    53681      +51     
+ Misses                         59293    59196      -97     
- Partials                        2451     2458       +7     

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Logo
Checkmarx One – Scan Summary & Detailsdc92503e-6fcd-417e-aed7-15ccf876bc89


New Issues (32) Checkmarx found the following issues in this Pull Request
# Severity Issue Source File / Package Checkmarx Insight
1 HIGH Absolute_Path_Traversal /apps/cli/src/oss-serve-configurator.ts: 328
detailsMethod Lambda at line 328 of /apps/cli/src/oss-serve-configurator.ts gets dynamic data from the query element. This element’s value then flows ...
Attack Vector
2 HIGH Absolute_Path_Traversal /apps/cli/src/oss-serve-configurator.ts: 360
detailsMethod Lambda at line 360 of /apps/cli/src/oss-serve-configurator.ts gets dynamic data from the query element. This element’s value then flows ...
Attack Vector
3 HIGH Absolute_Path_Traversal /apps/cli/src/oss-serve-configurator.ts: 328
detailsMethod Lambda at line 328 of /apps/cli/src/oss-serve-configurator.ts gets dynamic data from the query element. This element’s value then flows ...
Attack Vector
4 HIGH Absolute_Path_Traversal /apps/cli/src/oss-serve-configurator.ts: 360
detailsMethod Lambda at line 360 of /apps/cli/src/oss-serve-configurator.ts gets dynamic data from the query element. This element’s value then flows ...
Attack Vector
5 HIGH Client_DOM_XSS /apps/web/src/connectors/redirect.ts: 6
detailsThe method Lambda embeds untrusted data in generated output with href, at line 16 of /apps/web/src/connectors/redirect.ts. This untrusted data is...
Attack Vector
6 HIGH Relative_Path_Traversal /apps/cli/src/oss-serve-configurator.ts: 397
detailsMethod Lambda at line 397 of /apps/cli/src/oss-serve-configurator.ts gets dynamic data from the query element. This element’s value then flows ...
Attack Vector
7 HIGH Relative_Path_Traversal /apps/cli/src/oss-serve-configurator.ts: 397
detailsMethod Lambda at line 397 of /apps/cli/src/oss-serve-configurator.ts gets dynamic data from the query element. This element’s value then flows ...
Attack Vector
8 HIGH SSRF /libs/common/src/services/api.service.ts: 1325
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1270. How...
Attack Vector
9 HIGH SSRF /libs/common/src/services/api.service.ts: 1324
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1241. How...
Attack Vector
10 HIGH SSRF /libs/common/src/services/api.service.ts: 1325
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1241. How...
Attack Vector
11 HIGH SSRF /libs/common/src/services/api.service.ts: 1327
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1270. How...
Attack Vector
12 HIGH SSRF /libs/common/src/services/api.service.ts: 1335
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1270. How...
Attack Vector
13 HIGH SSRF /libs/common/src/services/api.service.ts: 1328
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1270. How...
Attack Vector
14 HIGH SSRF /libs/common/src/services/api.service.ts: 1327
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1241. How...
Attack Vector
15 HIGH SSRF /libs/common/src/services/api.service.ts: 1335
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1241. How...
Attack Vector
16 HIGH SSRF /libs/common/src/services/api.service.ts: 1328
detailsThe application sends a request to a remote server, for some resource, using createRequest in /libs/common/src/services/api.service.ts:1241. How...
Attack Vector
17 MEDIUM Client_DOM_Open_Redirect /apps/web/src/connectors/redirect.ts: 6
detailsThe potentially tainted value provided by href in /apps/web/src/connectors/redirect.ts at line 6 is used as a destination URL by href in /apps/web...
Attack Vector
18 MEDIUM Client_DOM_Open_Redirect /apps/desktop/src/auth/scripts/duo.js: 277
detailsThe potentially tainted value provided by substring in /apps/desktop/src/auth/scripts/duo.js at line 277 is used as a destination URL by open in /...
Attack Vector
19 MEDIUM HttpOnly_Cookie_Flag_Not_Set /apps/desktop/src/platform/services/server-communication-config/default-server-communication-config.service.ts: 71
detailsThe web application's getCookies method creates a cookie cookies, at line 71 of /apps/desktop/src/platform/services/server-communication-config/d...
Attack Vector
20 MEDIUM HttpOnly_Cookie_Flag_Not_Set /apps/web/src/connectors/sso.ts: 37
detailsThe web application's initiateBrowserSso method creates a cookie cookie, at line 37 of /apps/web/src/connectors/sso.ts, and returns it in the resp...
Attack Vector
21 MEDIUM Insecure_Storage_of_Sensitive_Data /apps/cli/src/commands/get.command.ts: 403
detailsThe application takes sensitive, personal data cipher, found at line 403 of /apps/cli/src/commands/get.command.ts, and stores it in an unprotecte...
Attack Vector
22 MEDIUM Insecure_Storage_of_Sensitive_Data /apps/cli/src/commands/get.command.ts: 402
detailsThe application takes sensitive, personal data cipherService, found at line 402 of /apps/cli/src/commands/get.command.ts, and stores it in an unp...
Attack Vector
23 MEDIUM Insecure_Storage_of_Sensitive_Data /apps/cli/src/tools/export.command.ts: 76
detailsThe application takes sensitive, personal data password, found at line 76 of /apps/cli/src/tools/export.command.ts, and stores it in an unprotect...
Attack Vector
24 MEDIUM Insecure_Storage_of_Sensitive_Data /apps/cli/src/commands/get.command.ts: 387
detailsThe application takes sensitive, personal data cipher, found at line 387 of /apps/cli/src/commands/get.command.ts, and stores it in an unprotecte...
Attack Vector
25 MEDIUM Insecure_Storage_of_Sensitive_Data /apps/cli/src/tools/export.command.ts: 81
detailsThe application takes sensitive, personal data password, found at line 81 of /apps/cli/src/tools/export.command.ts, and stores it in an unprotect...
Attack Vector
26 MEDIUM Missing_HSTS_Header /apps/cli/src/auth/commands/login.command.ts: 571
detailsThe web-application does not define an HSTS header, leaving it vulnerable to attack.
Attack Vector
27 MEDIUM SSL_Verification_Bypass /scripts/reverse-proxy-emulator/index.ts: 219
details/scripts/reverse-proxy-emulator/index.ts relies HTTPS requests, in . The rejectUnauthorized parameter, at line 219, effectively disables verifi...
Attack Vector
28 MEDIUM SSL_Verification_Bypass /scripts/reverse-proxy-emulator/index.ts: 301
details/scripts/reverse-proxy-emulator/index.ts relies HTTPS requests, in Lambda. The rejectUnauthorized parameter, at line 301, effectively disables ...
Attack Vector
29 LOW Angular_Usage_of_Unsafe_DOM_Sanitizer /libs/components/src/svg/svg.component.ts: 29
detailsUsage of an unsafe class bypassSecurityTrustHtml, which overrides output sanitization, was found at /libs/components/src/svg/svg.component.ts in ...
Attack Vector
30 LOW Angular_Usage_of_Unsafe_DOM_Sanitizer /apps/desktop/src/app/components/avatar.component.ts: 96
detailsUsage of an unsafe class bypassSecurityTrustResourceUrl, which overrides output sanitization, was found at /apps/desktop/src/app/components/avatar...
Attack Vector
31 LOW Client_Use_Of_Iframe_Without_Sandbox /apps/browser/src/autofill/overlay/inline-menu/pages/menu-container/autofill-inline-menu-container.ts: 107
detailsThe application employs an HTML iframe at whose contents are not properly sandboxed
Attack Vector
32 LOW Missing_CSP_Header /apps/cli/src/auth/commands/login.command.ts: 571
detailsA Content Security Policy is not explicitly defined within the web-application.
Attack Vector

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 3, 2026

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