🔧(backend) add Django setting to disable external API endpoints
Introduce ENABLE_EXTERNAL_API setting (defaults to False) to allow administrators to disable external API endpoints, preventing unintended exposure for self-hosted instances where such endpoints aren't needed or desired.
This commit is contained in:
committed by
aleb_the_flash
parent
69a9a07d21
commit
4c6741c905
@@ -43,12 +43,16 @@ urlpatterns = [
|
||||
]
|
||||
),
|
||||
),
|
||||
path(
|
||||
f"external-api/{settings.EXTERNAL_API_VERSION}/",
|
||||
include(
|
||||
[
|
||||
*external_router.urls,
|
||||
]
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
if settings.EXTERNAL_API_ENABLED:
|
||||
urlpatterns.append(
|
||||
path(
|
||||
f"external-api/{settings.EXTERNAL_API_VERSION}/",
|
||||
include(
|
||||
[
|
||||
*external_router.urls,
|
||||
]
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user