From ed3c369eefd678fb48f033d942868db9d71fd0f6 Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Tue, 14 Jun 2022 12:50:27 +0200 Subject: [PATCH] Island: Rename local-ips resource to ip-addresses --- monkey/monkey_island/cc/app.py | 4 ++-- .../cc/resources/{local_ips.py => ip_addresses.py} | 6 +++--- .../cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) rename monkey/monkey_island/cc/resources/{local_ips.py => ip_addresses.py} (77%) diff --git a/monkey/monkey_island/cc/app.py b/monkey/monkey_island/cc/app.py index 74d51fd2a..9db06d486 100644 --- a/monkey/monkey_island/cc/app.py +++ b/monkey/monkey_island/cc/app.py @@ -27,10 +27,10 @@ from monkey_island.cc.resources.configuration_import import ConfigurationImport from monkey_island.cc.resources.edge import Edge from monkey_island.cc.resources.exploitations.manual_exploitation import ManualExploitation from monkey_island.cc.resources.exploitations.monkey_exploitation import MonkeyExploitation +from monkey_island.cc.resources.ip_addresses import IpAddresses from monkey_island.cc.resources.island_configuration import IslandConfiguration from monkey_island.cc.resources.island_logs import IslandLog from monkey_island.cc.resources.island_mode import IslandMode -from monkey_island.cc.resources.local_ips import LocalIps 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 @@ -172,7 +172,7 @@ def init_api_resources(api: FlaskDIWrapper): api.add_resource(TelemetryFeed) api.add_resource(Log) api.add_resource(IslandLog) - api.add_resource(LocalIps) + api.add_resource(IpAddresses) # API Spec: These two should be the same resource, GET for download and POST for upload api.add_resource(PBAFileDownload) diff --git a/monkey/monkey_island/cc/resources/local_ips.py b/monkey/monkey_island/cc/resources/ip_addresses.py similarity index 77% rename from monkey/monkey_island/cc/resources/local_ips.py rename to monkey/monkey_island/cc/resources/ip_addresses.py index ae99458f9..6f031d24f 100644 --- a/monkey/monkey_island/cc/resources/local_ips.py +++ b/monkey/monkey_island/cc/resources/ip_addresses.py @@ -3,8 +3,8 @@ from monkey_island.cc.resources.request_authentication import jwt_required from monkey_island.cc.services.utils.network_utils import local_ip_addresses -class LocalIps(AbstractResource): - urls = ["/api/island/local-ips"] +class IpAddresses(AbstractResource): + urls = ["/api/island/ip-addresses"] @jwt_required def get(self): @@ -15,4 +15,4 @@ class LocalIps(AbstractResource): """ local_ips = local_ip_addresses() - return {"local_ips": local_ips} + return {"ip_addresses": local_ips} diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js index e09197f14..99f7f92b7 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunOptions.js @@ -9,7 +9,7 @@ import {faExpandArrowsAlt} from '@fortawesome/free-solid-svg-icons'; import RunOnIslandButton from './RunOnIslandButton'; import AWSRunButton from './RunOnAWS/AWSRunButton'; -const LOCAL_IPS_URL = '/api/island/local-ips'; +const IP_ADDRESSES_URL = '/api/island/ip-addresses'; function RunOptions(props) { @@ -21,10 +21,10 @@ function RunOptions(props) { useEffect(() => { if (initialized === false) { - authComponent.authFetch(LOCAL_IPS_URL) + authComponent.authFetch(IP_ADDRESSES_URL) .then(res => res.json()) .then(res => { - let ipAddresses = res.local_ips; + let ipAddresses = res.ip_addresses; setIps(ipAddresses); setInitialized(true); });