Skip to content

test(backend): cover request logger secret redaction and priority routing - #2212

Open
DeepDev69x3 wants to merge 1 commit into
LabsCrypt:mainfrom
DeepDev69x3:test/request-logger-secret-redaction-2094
Open

DeepDev69x3 wants to merge 1 commit into
LabsCrypt:mainfrom
DeepDev69x3:test/request-logger-secret-redaction-2094

Conversation

@DeepDev69x3

Copy link
Copy Markdown

Summary of Changes

  • Adds comprehensive, deterministic unit test coverage for requestLogger in backend/src/middleware/__tests__/requestLogger.spec.ts.
  • Verifies that sensitive request headers (authorization, cookie, set-cookie) and request bodies (passwords, PINs, PII) are strictly omitted from logged HTTP access payloads.
  • Verifies priority status routing across status thresholds (2xx logs at http, 4xx logs at warn, 5xx logs at error).
  • Verifies custom requestId extraction and graceful fallback when IP or user-agent headers are absent.

Closes #2094

…ting

- Adds deterministic tests verifying requestLogger never logs authorization headers, cookies, or request bodies
- Covers 2xx (http), 4xx (warn), and 5xx (error) log priority dispatching
- Tests custom requestId propagation and graceful handling of missing IP or userAgent

Closes LabsCrypt#2094
@github-actions github-actions Bot added the security:malware-suspected Automated malware indicator found in a pull request label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Malware detection scan flagged this pull request

The scan found 1 indicator(s) in the PR diff. This PR is blocked until a maintainer reviews the flagged files.

  • backend/src/middleware/__tests__/requestLogger.spec.ts — hidden-appended-config-payload (high)

This is an automated triage signal; maintainers must verify whether the finding is malicious or intentional.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security:malware-suspected Automated malware indicator found in a pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[test] Cover request logger secret redaction

1 participant