diff --git a/monkey/monkey_island/cc/resources/propagation_credentials.py b/monkey/monkey_island/cc/resources/propagation_credentials.py index f1ae01c81..a017d2625 100644 --- a/monkey/monkey_island/cc/resources/propagation_credentials.py +++ b/monkey/monkey_island/cc/resources/propagation_credentials.py @@ -30,7 +30,6 @@ class PropagationCredentials(AbstractResource): def put(self, collection=None): credentials = [Credentials.from_mapping(c) for c in request.json] - if collection == _configured_collection: self._credentials_repository.remove_configured_credentials() self._credentials_repository.save_configured_credentials(credentials) @@ -40,15 +39,3 @@ class PropagationCredentials(AbstractResource): return {}, HTTPStatus.NOT_FOUND return {}, HTTPStatus.NO_CONTENT - - def delete(self, collection=None): - if collection == _configured_collection: - self._credentials_repository.remove_configured_credentials() - elif collection == _stolen_collection: - self._credentials_repository.remove_stolen_credentials() - elif collection is None: - self._credentials_repository.remove_all_credentials() - else: - return {}, HTTPStatus.NOT_FOUND - - return {}, HTTPStatus.NO_CONTENT diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index bb1d1a281..c7561eb4b 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -252,7 +252,7 @@ class ConfigurePageComponent extends AuthComponent { this.props.onStatusChange(); } ) - .then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'DELETE'})) ; + .then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'PUT', body: '[]'})) ; }; sendPbaRemoveRequest(apiEndpoint) { diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/IslandResetModal.tsx b/monkey/monkey_island/cc/ui/src/components/ui-components/IslandResetModal.tsx index c744c869a..639ee2c19 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/IslandResetModal.tsx +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/IslandResetModal.tsx @@ -109,7 +109,7 @@ const IslandResetModal = (props: Props) => { }}) .then(res => { if (res.status === 200) { - return auth.authFetch('/api/propagation-credentials/configured-credentials', {method: 'DELETE'}) + return auth.authFetch('/api/propagation-credentials/configured-credentials', {method: 'PUT', body:'[]'}) }}) .then(res => { if (res.status === 200) {