Island: Remove disused MonkeyConfiguration resource
This commit is contained in:
parent
a1601f120f
commit
21a9c4fa14
|
@ -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.local_run import LocalRun
|
||||||
from monkey_island.cc.resources.log import Log
|
from monkey_island.cc.resources.log import Log
|
||||||
from monkey_island.cc.resources.monkey import Monkey
|
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.remote_port_check import RemotePortCheck
|
||||||
from monkey_island.cc.resources.monkey_control.started_on_island import StartedOnIsland
|
from monkey_island.cc.resources.monkey_control.started_on_island import StartedOnIsland
|
||||||
from monkey_island.cc.resources.monkey_control.stop_agent_check import StopAgentCheck
|
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(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(IslandConfiguration, "/api/configuration/island", "/api/configuration/island/")
|
||||||
api.add_resource(ConfigurationExport, "/api/configuration/export")
|
api.add_resource(ConfigurationExport, "/api/configuration/export")
|
||||||
api.add_resource(ConfigurationImport, "/api/configuration/import")
|
api.add_resource(ConfigurationImport, "/api/configuration/import")
|
||||||
|
|
|
@ -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()
|
|
Loading…
Reference in New Issue