forked from p15670423/monkey
Island: Use UUID for AgentSignals endpoint parameter
This commit is contained in:
parent
1a8306af1b
commit
10954e0a6e
|
@ -1,6 +1,7 @@
|
||||||
import logging
|
import logging
|
||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
|
||||||
|
from common.types import AgentID
|
||||||
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
from monkey_island.cc.resources.AbstractResource import AbstractResource
|
||||||
from monkey_island.cc.services import AgentSignalsService
|
from monkey_island.cc.services import AgentSignalsService
|
||||||
|
|
||||||
|
@ -8,7 +9,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class AgentSignals(AbstractResource):
|
class AgentSignals(AbstractResource):
|
||||||
urls = ["/api/agent-signals/<string:agent_id>"]
|
urls = ["/api/agent-signals/<uuid:agent_id>"]
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -16,6 +17,6 @@ class AgentSignals(AbstractResource):
|
||||||
):
|
):
|
||||||
self._agent_signals_service = agent_signals_service
|
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)
|
agent_signals = self._agent_signals_service.get_signals(agent_id)
|
||||||
return agent_signals.dict(simplify=True), HTTPStatus.OK
|
return agent_signals.dict(simplify=True), HTTPStatus.OK
|
||||||
|
|
Loading…
Reference in New Issue