Skip to content

[LOCKLITE-144] Disable Swagger in production environment#114

Merged
vbetsch merged 5 commits intodevelopfrom
api/fix/144-disable-swagger-prod
Aug 17, 2025
Merged

[LOCKLITE-144] Disable Swagger in production environment#114
vbetsch merged 5 commits intodevelopfrom
api/fix/144-disable-swagger-prod

Conversation

@vbetsch
Copy link
Owner

@vbetsch vbetsch commented Aug 17, 2025

Security tags : OWASP-A05:2021

@vbetsch vbetsch requested a review from Copilot August 17, 2025 22:35
@vbetsch vbetsch self-assigned this Aug 17, 2025
@vbetsch vbetsch added api About endpoints and services security About security labels Aug 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements security measures to disable Swagger documentation endpoints in production environments to prevent API documentation exposure.

  • Adds Next.js middleware to block access to Swagger endpoints in production
  • Returns 404 responses for /api/swagger and /api/docs paths when NODE_ENV is production
  • Allows normal request processing for all other routes and non-production environments

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@vbetsch vbetsch merged commit ad99bb7 into develop Aug 17, 2025
4 checks passed
@vbetsch vbetsch deleted the api/fix/144-disable-swagger-prod branch August 17, 2025 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api About endpoints and services security About security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants