mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
feat(api): add dynamic server URL configuration to OpenAPI schema
Add a new postprocessing hook 'add_api_servers' that dynamically configures the servers array in the OpenAPI specification based on the request environment. This hook: - Detects the current environment (local, staging, or production) from the request host - Adds the current server URL as the primary option - Includes production (https://api.prowler.com) as a fallback option when generating from non-production environments - Enables users to toggle between local and production servers in Mintlify's API playground via a dropdown Server detection logic: - localhost/127.0.0.1 → "Local Development Server" - hosts with 'dev' or 'staging' → "Development/Staging API" - api.prowler.com → "Prowler Cloud API" This enables the "Try it out" feature in Mintlify documentation and allows testing against different environments without modifying the spec.
This commit is contained in:
@@ -25722,5 +25722,15 @@
|
||||
"name": "Mute Rules",
|
||||
"description": "Endpoints for simple mute rules management. These can be used as an alternative to the Mutelist Processor if you need to mute specific findings across your tenant with a specific reason."
|
||||
}
|
||||
],
|
||||
"servers": [
|
||||
{
|
||||
"url": "http://localhost:8080",
|
||||
"description": "Local Development Server"
|
||||
},
|
||||
{
|
||||
"url": "https://api.prowler.com",
|
||||
"description": "Prowler Cloud API (Production)"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user