Island: Use RepositoryService in ResetAgentConfiguration resource

This commit is contained in:
Mike Salvatore 2022-07-13 09:05:15 -04:00
parent 5283864c09
commit 826d409dd2
1 changed files with 4 additions and 4 deletions

View File

@ -2,22 +2,22 @@ from http import HTTPStatus
from flask import make_response from flask import make_response
from monkey_island.cc.repository import IAgentConfigurationRepository
from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.AbstractResource import AbstractResource
from monkey_island.cc.resources.request_authentication import jwt_required from monkey_island.cc.resources.request_authentication import jwt_required
from monkey_island.cc.services import RepositoryService
class ResetAgentConfiguration(AbstractResource): class ResetAgentConfiguration(AbstractResource):
urls = ["/api/reset-agent-configuration"] urls = ["/api/reset-agent-configuration"]
def __init__(self, agent_configuration_repository: IAgentConfigurationRepository): def __init__(self, repository_service: RepositoryService):
self._agent_configuration_repository = agent_configuration_repository self._repository_service = repository_service
@jwt_required @jwt_required
def post(self): def post(self):
""" """
Reset the agent configuration to its default values Reset the agent configuration to its default values
""" """
self._agent_configuration_repository.reset_to_default() self._repository_service.reset_agent_configuration()
return make_response({}, HTTPStatus.OK) return make_response({}, HTTPStatus.OK)