Merge pull request #2084 from guardicore/1965-delete-configured-creds-on-config-reset

Use DELETE /api/propagation-credentials/configured-credentials
This commit is contained in:
Mike Salvatore 2022-07-13 09:46:42 -04:00 committed by GitHub
commit 2940cc51e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View File

@ -21,6 +21,7 @@ import {reformatConfig} from '../configuration-components/ReformatHook';
const CONFIG_URL = '/api/agent-configuration';
const RESET_URL = '/api/reset-agent-configuration';
const CONFIGURED_PROPAGATION_CREDENTIALS_URL = '/api/propagation-credentials/configured-credentials';
export const API_PBA_LINUX = '/api/file-upload/PBAlinux';
export const API_PBA_WINDOWS = '/api/file-upload/PBAwindows';
@ -233,10 +234,12 @@ class ConfigurePageComponent extends AuthComponent {
this.updateConfig();
this.props.onStatusChange();
}
).then(() => {
)
.then(() => {
this.removePBAfile(API_PBA_WINDOWS, this.setPbaFilenameWindows)
this.removePBAfile(API_PBA_LINUX, this.setPbaFilenameLinux)
});
})
.then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'DELETE'}));
};
removePBAfile(apiEndpoint, setFilenameFnc) {

View File

@ -107,6 +107,10 @@ const IslandResetModal = (props: Props) => {
if (res.status === 200) {
return auth.authFetch('/api/clear-simulation-data', {method: 'POST'})
}})
.then(res => {
if (res.status === 200) {
return auth.authFetch('/api/propagation-credentials/configured-credentials', {method: 'DELETE'})
}})
.then(res => {
if (res.status === 200) {
return auth.authFetch('/api/island-mode', {method: 'POST', body: '{"mode": "unset"}'})