Island: Remove disused MonkeyConfiguration resource

This commit is contained in:
Mike Salvatore 2021-12-02 19:24:02 -05:00
parent a1601f120f
commit 21a9c4fa14
2 changed files with 0 additions and 28 deletions

View File

@ -30,7 +30,6 @@ from monkey_island.cc.resources.island_mode import IslandMode
from monkey_island.cc.resources.local_run import LocalRun
from monkey_island.cc.resources.log import Log
from monkey_island.cc.resources.monkey import Monkey
from monkey_island.cc.resources.monkey_configuration import MonkeyConfiguration
from monkey_island.cc.resources.monkey_control.remote_port_check import RemotePortCheck
from monkey_island.cc.resources.monkey_control.started_on_island import StartedOnIsland
from monkey_island.cc.resources.monkey_control.stop_agent_check import StopAgentCheck
@ -132,7 +131,6 @@ def init_api_resources(api):
)
api.add_resource(IslandMode, "/api/island-mode")
api.add_resource(MonkeyConfiguration, "/api/configuration", "/api/configuration/")
api.add_resource(IslandConfiguration, "/api/configuration/island", "/api/configuration/island/")
api.add_resource(ConfigurationExport, "/api/configuration/export")
api.add_resource(ConfigurationImport, "/api/configuration/import")

View File

@ -1,26 +0,0 @@
import json
import flask_restful
from flask import abort, jsonify, request
from monkey_island.cc.resources.auth.auth import jwt_required
from monkey_island.cc.services.config import ConfigService
class MonkeyConfiguration(flask_restful.Resource):
@jwt_required
def get(self):
return jsonify(
schema=ConfigService.get_config_schema(),
configuration=ConfigService.get_config(False, True),
)
@jwt_required
def post(self):
config_json = json.loads(request.data)
if "reset" in config_json:
ConfigService.reset_config()
else:
if not ConfigService.update_config(config_json, should_encrypt=True):
abort(400)
return self.get()