@cryptotaxi247 / CoPilot / commits / 0a551030

786 active response issue (#787)

* feat: enhance get_supported_active_responses_agent_route to include current user context * fix: reorder import statements for consistency

taylor_socfortress committed Apr 2, 2026 at 11:38 UTC 0a5510301be89f9fa21358fdfa523aa529811344
1 file changed +7 -2
backend/app/active_response/routes/active_response.py
+7 -2
@@ -17,6 +17,7 @@ from app.active_response.schema.active_response import ActiveResponsesSupportedR
17 from app.active_response.schema.active_response import InvokeActiveResponseRequest
18 from app.active_response.schema.active_response import InvokeActiveResponseResponse
19 from app.agents.routes.agents import get_agent
20 +from app.auth.models.users import User
21 from app.auth.utils import AuthHandler
22 from app.connectors.wazuh_manager.utils.universal import send_put_request
23 from app.db.db_session import get_db
@@ -122,11 +123,15 @@ async def get_supported_active_responses_route() -> ActiveResponsesSupportedResp
123 description="Get the list of supported active responses for a specific agent",
124 dependencies=[Security(AuthHandler().require_any_scope("admin", "analyst"))],
125 )
125 -async def get_supported_active_responses_agent_route(agent_id: str, db: AsyncSession = Depends(get_db)) -> ActiveResponsesSupportedResponse:
126 +async def get_supported_active_responses_agent_route(
127 + agent_id: str,
128 + current_user: User = Depends(AuthHandler().get_current_user),
129 + db: AsyncSession = Depends(get_db),
130 +) -> ActiveResponsesSupportedResponse:
131 """
132 Get the list of supported active responses for a specific agent
133 """
129 - response = await get_agent(agent_id, db)
134 + response = await get_agent(agent_id, current_user, db)
135 agent = response.agents[0] if response.agents else None
136 logger.info(f"Agent: {agent.os if agent else 'None'}")
137 if agent and agent.os: