Implement Monlet MVP stack and UI updates

This commit is contained in:
Stanislav Rossovskii
2026-05-27 10:01:59 +04:00
parent dcea096327
commit edc51e9c59
145 changed files with 15618 additions and 248 deletions

35
server/tests/test_auth.py Normal file
View File

@@ -0,0 +1,35 @@
import pytest
@pytest.mark.asyncio
async def test_health_no_auth(app_client):
r = await app_client.get("/api/v1/health")
assert r.status_code == 200
assert r.json()["status"] == "ok"
@pytest.mark.asyncio
async def test_metrics_no_auth(app_client):
r = await app_client.get("/metrics")
assert r.status_code == 200
@pytest.mark.asyncio
async def test_missing_token_401(app_client):
r = await app_client.get("/api/v1/agents")
assert r.status_code == 401
body = r.json()
assert body["error"]["code"] == "unauthorized"
assert body["error"]["request_id"]
@pytest.mark.asyncio
async def test_wrong_token_401(app_client):
r = await app_client.get("/api/v1/agents", headers={"Authorization": "Bearer nope"})
assert r.status_code == 401
@pytest.mark.asyncio
async def test_valid_token_200(app_client, auth_headers):
r = await app_client.get("/api/v1/agents", headers=auth_headers)
assert r.status_code == 200