fix(api)!: key the health route and keep server internals from user keys

/api/health needs X-Secret-Key but stays outside the rate limit. Only the admin key gets load_errors from /api/services, default error details no longer name the exception class, and a prepare signal replaces aiohttp's Server banner on every response while the CDM routes keep their own.
This commit is contained in:
imSp4rky
2026-11-03 11:53:55 -07:00
parent b6429ecdfd
commit 87ccd6666c
16 changed files with 105 additions and 47 deletions
+3 -3
View File
@@ -24,12 +24,12 @@ def test_services_endpoint(http_session, server_url: str) -> None:
assert isinstance(body["services"], list)
def test_health_does_not_require_secret_key(server_url: str) -> None:
"""Health bypasses auth even when the server runs with a key."""
def test_health_requires_secret_key(server_url: str, secret_key: str) -> None:
"""Health needs the API key like every other route."""
import requests
r = requests.get(f"{server_url}/api/health", timeout=10)
assert r.status_code == 200
assert r.status_code == (401 if secret_key else 200)
def test_unknown_route_returns_404(http_session, server_url: str) -> None: