From b834bfe7f7a6beb9d501f85b1005b341b61852e6 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Mon, 12 Sep 2022 13:19:59 +0200 Subject: [PATCH] Island: Publish RESET_AGENT_CONFIGURATION from endpoint --- .../cc/resources/reset_agent_configuration.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/monkey/monkey_island/cc/resources/reset_agent_configuration.py b/monkey/monkey_island/cc/resources/reset_agent_configuration.py index 36b49820e..04de3bedc 100644 --- a/monkey/monkey_island/cc/resources/reset_agent_configuration.py +++ b/monkey/monkey_island/cc/resources/reset_agent_configuration.py @@ -2,22 +2,22 @@ from http import HTTPStatus from flask import make_response +from monkey_island.cc.event_queue import IIslandEventQueue, IslandEventTopic from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.request_authentication import jwt_required -from monkey_island.cc.services import RepositoryService class ResetAgentConfiguration(AbstractResource): urls = ["/api/reset-agent-configuration"] - def __init__(self, repository_service: RepositoryService): - self._repository_service = repository_service + def __init__(self, event_queue: IIslandEventQueue): + self._event_queue = event_queue @jwt_required def post(self): """ Reset the agent configuration to its default values """ - self._repository_service.reset_agent_configuration() + self._event_queue.publish(IslandEventTopic.RESET_AGENT_CONFIGURATION) return make_response({}, HTTPStatus.OK)