Add admin panel, WebSocket support, and API versioning
Introduce an admin portal (React + Nginx), WebSocket routing, and API versioning middleware with `/api/v1/` prefix deprecation. Add master API key authentication, new Prometheus metrics for AI token consumption and active WebSockets, and extend S3 config with a public endpoint URL. Update test paths and fixtures to align with the new routing structure.
This commit is contained in:
@@ -20,7 +20,7 @@ async def test_ai_summarize(async_client: AsyncClient, client_a, auth_headers_a)
|
||||
patch("app.routers.ai.settings.AI_ENABLED", True):
|
||||
|
||||
payload = {"url": "https://example.com", "language": "français"}
|
||||
response = await async_client.post("/ai/summarize", json=payload, headers=auth_headers_a)
|
||||
response = await async_client.post("/api/v1/ai/summarize", json=payload, headers=auth_headers_a)
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -42,7 +42,7 @@ async def test_ai_draft_task(async_client: AsyncClient, client_a, auth_headers_a
|
||||
patch("app.routers.ai.settings.AI_ENABLED", True):
|
||||
|
||||
payload = {"description": "Fix bug", "context": "Backend project"}
|
||||
response = await async_client.post("/ai/draft-task", json=payload, headers=auth_headers_a)
|
||||
response = await async_client.post("/api/v1/ai/draft-task", json=payload, headers=auth_headers_a)
|
||||
|
||||
assert response.status_code == 200
|
||||
data = response.json()
|
||||
@@ -52,6 +52,6 @@ async def test_ai_draft_task(async_client: AsyncClient, client_a, auth_headers_a
|
||||
@pytest.mark.asyncio
|
||||
async def test_ai_disabled(async_client: AsyncClient, client_a, auth_headers_a):
|
||||
with patch("app.routers.ai.settings.AI_ENABLED", False):
|
||||
response = await async_client.post("/ai/draft-task", json={"description": "test"}, headers=auth_headers_a)
|
||||
response = await async_client.post("/api/v1/ai/draft-task", json={"description": "test"}, headers=auth_headers_a)
|
||||
assert response.status_code == 503
|
||||
assert response.json()["detail"] == "AI désactivée"
|
||||
|
||||
Reference in New Issue
Block a user