Files
Amorend 93c11281a9 fix: register health router in v1 API so /api/v1/health returns 200 (#1572)
* fix: register health router in v1 API so /api/v1/health returns 200

The health endpoint at api/v1/endpoints/health.py was defined but never
included in api/v1/router.py, causing /api/v1/health to return 404 while
/api/health worked fine.

This adds the missing include_router call and a test covering both paths.

Fixes #1561

* fix: exempt /api/v1/health from auth middleware and add auth-enabled tests

When ADMIN_AUTH_ENABLED=true, AuthMiddleware blocks all /api/v1/*
paths not in EXEMPT_PATHS. The newly registered /api/v1/health was
missing from that list, so unauthenticated health probes from load
balancers or monitors would get 401 instead of 200.

Adds /api/v1/health to EXEMPT_PATHS and covers both /api/health and
/api/v1/health under the auth-enabled scenario.

* fix: correct auth-enabled test mock target and add CHANGELOG entry

- Patch api.middlewares.auth.is_auth_enabled instead of src.auth so
  the mock actually reaches AuthMiddleware.dispatch
- Add [Unreleased] entry to docs/CHANGELOG.md

* chore: remove unused import os from test_api_health.py
2026-06-03 20:05:12 +08:00
..