Skip to content

feat: add Helmet security headers - #250

Open
mikemikimike wants to merge 1 commit into
trustflow-protocol:mainfrom
mikemikimike:fix/add-helmet
Open

feat: add Helmet security headers#250
mikemikimike wants to merge 1 commit into
trustflow-protocol:mainfrom
mikemikimike:fix/add-helmet

Conversation

@mikemikimike

Copy link
Copy Markdown

Description

Closes #210

Add Helmet security headers to the NestJS API, including a Swagger-compatible Content Security Policy.

Implementation

  • Add helmet as a backend dependency.
  • Apply Helmet before other middleware with CSP rules allowing the local Swagger UI assets and HTTPS connections.
  • Add an HTTP smoke test for standard security headers.

Compatibility

API routes remain unchanged. Swagger remains able to load its inline assets under the configured CSP.

Testing

  • npm test -- --runInBand security-headers.spec.ts — 1 passed.
  • npm run build — passed.
  • git diff --check — passed.

Limitations

Repository-wide lint/format checks inherit existing CRLF/Prettier baseline errors across unrelated files.

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.

Add Helmet security headers middleware

1 participant