Protect private API routes and scope agent data

This commit is contained in:
Hamza Ayed
2026-10-03 00:34:49 +03:00
parent 1c1f662850
commit b0cd825838
17 changed files with 313 additions and 95 deletions
@@ -5,7 +5,6 @@ from uuid import UUID
from unittest.mock import patch
from fastapi import HTTPException
from fastapi.testclient import TestClient
# Importing the API initializes its SQLite schema. Keep this test process isolated
# from the real local conversation database.
@@ -13,12 +12,13 @@ _TEST_DATA_DIR = tempfile.TemporaryDirectory(prefix="sovereignai-api-tests-")
os.environ["SOVEREIGNAI_DATA_DIR"] = _TEST_DATA_DIR.name
from app.main import app
from tests.api_client import authenticated_client
class ApiErrorContractTests(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.client = TestClient(app)
cls.client = authenticated_client(app)
def test_health_response_has_correlation_id(self) -> None:
response = self.client.get("/health")