From cca4cf9df2a6e8ee5ba333590396e048dba541cc Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Fri, 23 Sep 2022 13:52:43 +0530 Subject: [PATCH] Island: Implement AgentSignals resource's GET --- monkey/monkey_island/cc/resources/agent_signals.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/monkey/monkey_island/cc/resources/agent_signals.py b/monkey/monkey_island/cc/resources/agent_signals.py index b2abba820..2b4439231 100644 --- a/monkey/monkey_island/cc/resources/agent_signals.py +++ b/monkey/monkey_island/cc/resources/agent_signals.py @@ -6,6 +6,7 @@ from flask import request from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic from monkey_island.cc.resources.AbstractResource import AbstractResource +from monkey_island.cc.services import AgentSignalsService logger = logging.getLogger(__name__) @@ -16,8 +17,10 @@ class AgentSignals(AbstractResource): def __init__( self, island_event_queue: IIslandEventQueue, + agent_signals_service: AgentSignalsService, ): self._island_event_queue = island_event_queue + self._agent_signals_service = agent_signals_service def post(self): try: @@ -35,5 +38,5 @@ class AgentSignals(AbstractResource): return {}, HTTPStatus.NO_CONTENT def get(self, agent_id: str): - # TODO: return AgentSignals - return {}, HTTPStatus.OK + agent_signals = self._agent_signals_service.get_signals(agent_id) + return agent_signals.dict(), HTTPStatus.OK