diff --git a/monkey/monkey_island/cc/resources/configuration.py b/monkey/monkey_island/cc/resources/configuration.py index 79f1d2a0c..055fe5db1 100644 --- a/monkey/monkey_island/cc/resources/configuration.py +++ b/monkey/monkey_island/cc/resources/configuration.py @@ -1,13 +1,26 @@ +from enum import Enum +from flask import jsonify, request + from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.request_authentication import jwt_required +from monkey_island.cc.repository import FileAgentConfigurationRepository + +class ConfigurationTypeEnum(Enum): + ISLAND = "island" + AGENT = "agent" class Configuration(AbstractResource): - urls = ["/api/configuration"] + urls = ["/api/configuration/"] @jwt_required - def get(self): - pass + def get(self, configuration_type: str): + # we probably still need this because of credential fields, HTTP ports, etc in the config? + if configuration_type == ConfigurationTypeEnum.ISLAND: + pass + elif configuration_type == ConfigurationTypeEnum.AGENT: + configuration = FileAgentConfigurationRepository.get_configuration() + return jsonify(configuration=configuration) @jwt_required def post(self):