M10: harden knowledge trust and telemetry
This commit is contained in:
@@ -65,3 +65,22 @@ def test_logout_invalidates_session(ops_client):
|
||||
def test_logout_without_a_session_is_safe(client):
|
||||
response = client.post("/api/v1/demo/logout")
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
def test_demo_reset_preserves_integration_telemetry(ops_client, client):
|
||||
from app.core.config import get_settings
|
||||
|
||||
settings = get_settings()
|
||||
probe = client.get(
|
||||
"/api/v1/integrations/mcp/operations-summary",
|
||||
headers={
|
||||
"X-Service-Token": settings.mcp_hub_service_token,
|
||||
"X-Client-Id": "reset-probe",
|
||||
},
|
||||
)
|
||||
assert probe.status_code == 200
|
||||
assert ops_client.post("/api/v1/demo/reset").status_code == 200
|
||||
|
||||
assert client.post("/api/v1/demo/login", json={"role": "operations_manager"}).status_code == 200
|
||||
events = client.get("/api/v1/audit", params={"action": "mcp_tool_request"}).json()
|
||||
assert any(event["actor_label"] == "reset-probe" for event in events)
|
||||
|
||||
Reference in New Issue
Block a user