Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(api): reconcile guards with the reopened case surface

Alexandru Mateescu26e1becd37b2
diff --git a/services/api/app/api/v1/endpoints/approvals.py b/services/api/app/api/v1/endpoints/approvals.py
index efbf96ef3..08bc5be14 100644
--- a/services/api/app/api/v1/endpoints/approvals.py
+++ b/services/api/app/api/v1/endpoints/approvals.py
@@ -329,7 +329,7 @@ async def _dispatch_decision(
"user_id": str(user.user_id),
"tenant_id": str(user.tenant_id),
"email": getattr(user, "email", None),
- "roles": [user.role] if getattr(user, "role", None) else [],
+ "roles": [role] if role else (list(getattr(user, "roles", []) or []) if not role else []),
"permissions": permissions,
}
diff --git a/services/api/tests/api/v1/endpoints/test_alerts_detail_envelope.py b/services/api/tests/api/v1/endpoints/test_alerts_detail_envelope.py
index 112400e2d..10c58c8cf 100644
--- a/services/api/tests/api/v1/endpoints/test_alerts_detail_envelope.py
+++ b/services/api/tests/api/v1/endpoints/test_alerts_detail_envelope.py
@@ -229,6 +229,8 @@ class TestAlertDetailResponseContract:
"related_entities",
"mini_timeline",
"recommended_actions",
+ "raw_event",
+ "wazuh_locator",
}
def test_defaults_are_safe_when_rail_fields_missing(self) -> None: