Island: Use UUID for AgentSignals endpoint parameter

This commit is contained in:
Ilija Lazoroski 2022-09-28 16:45:28 +02:00
parent 1a8306af1b
commit 10954e0a6e
1 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import logging
from http import HTTPStatus
from common.types import AgentID
from monkey_island.cc.resources.AbstractResource import AbstractResource
from monkey_island.cc.services import AgentSignalsService
@ -8,7 +9,7 @@ logger = logging.getLogger(__name__)
class AgentSignals(AbstractResource):
urls = ["/api/agent-signals/<string:agent_id>"]
urls = ["/api/agent-signals/<uuid:agent_id>"]
def __init__(
self,
@ -16,6 +17,6 @@ class AgentSignals(AbstractResource):
):
self._agent_signals_service = agent_signals_service
def get(self, agent_id: str):
def get(self, agent_id: AgentID):
agent_signals = self._agent_signals_service.get_signals(agent_id)
return agent_signals.dict(simplify=True), HTTPStatus.OK