fix: tighten datasource trigger guards

This commit is contained in:
linkong
2026-04-08 09:33:48 +08:00
parent 2da6ed166b
commit 2d43263b9e
3 changed files with 96 additions and 10 deletions

View File

@@ -90,6 +90,15 @@ async def test_alerts_without_auth():
assert response.status_code == 401
@pytest.mark.asyncio
async def test_datasource_task_status_without_auth():
"""Test datasource task-status endpoint requires authentication"""
transport = ASGITransport(app=app)
async with AsyncClient(transport=transport, base_url="http://test") as client:
response = await client.get("/api/v1/datasources/1/task-status")
assert response.status_code == 401
@pytest.mark.asyncio
async def test_alerts_endpoint_with_auth(auth_headers):
"""Test alerts endpoint with authentication"""