From 5e19abbe5411f1ba75fb93415b7e9eb7f69913f8 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 22 Jul 2022 08:48:17 -0400 Subject: [PATCH] Island: Add some comments/TODOs to /api/island-mode --- monkey/monkey_island/cc/resources/island_mode.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/resources/island_mode.py b/monkey/monkey_island/cc/resources/island_mode.py index 3273f150e..84f30c4ce 100644 --- a/monkey/monkey_island/cc/resources/island_mode.py +++ b/monkey/monkey_island/cc/resources/island_mode.py @@ -12,12 +12,12 @@ logger = logging.getLogger(__name__) class IslandMode(AbstractResource): - # API Spec: Instead of POST, this could just be PATCH urls = ["/api/island-mode"] def __init__(self, island_mode_service: IslandModeService): self._island_mode_service = island_mode_service + # API Spec: Instead of POST, this should be PUT @jwt_required def post(self): try: @@ -26,6 +26,9 @@ class IslandMode(AbstractResource): self._island_mode_service.set_mode(mode) + # TODO: Do any of these returns need a body and make_response? What happens if we just + # return the response code? + # API Spec: This should be 204 (NO CONTENT) return make_response({}, 200) except (AttributeError, json.decoder.JSONDecodeError): return make_response({}, 400)