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:
commit
2940cc51e8
|
@ -21,6 +21,7 @@ import {reformatConfig} from '../configuration-components/ReformatHook';
|
||||||
|
|
||||||
const CONFIG_URL = '/api/agent-configuration';
|
const CONFIG_URL = '/api/agent-configuration';
|
||||||
const RESET_URL = '/api/reset-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_LINUX = '/api/file-upload/PBAlinux';
|
||||||
export const API_PBA_WINDOWS = '/api/file-upload/PBAwindows';
|
export const API_PBA_WINDOWS = '/api/file-upload/PBAwindows';
|
||||||
|
|
||||||
|
@ -233,10 +234,12 @@ class ConfigurePageComponent extends AuthComponent {
|
||||||
this.updateConfig();
|
this.updateConfig();
|
||||||
this.props.onStatusChange();
|
this.props.onStatusChange();
|
||||||
}
|
}
|
||||||
).then(() => {
|
)
|
||||||
|
.then(() => {
|
||||||
this.removePBAfile(API_PBA_WINDOWS, this.setPbaFilenameWindows)
|
this.removePBAfile(API_PBA_WINDOWS, this.setPbaFilenameWindows)
|
||||||
this.removePBAfile(API_PBA_LINUX, this.setPbaFilenameLinux)
|
this.removePBAfile(API_PBA_LINUX, this.setPbaFilenameLinux)
|
||||||
});
|
})
|
||||||
|
.then(this.authFetch(CONFIGURED_PROPAGATION_CREDENTIALS_URL, {method: 'DELETE'}));
|
||||||
};
|
};
|
||||||
|
|
||||||
removePBAfile(apiEndpoint, setFilenameFnc) {
|
removePBAfile(apiEndpoint, setFilenameFnc) {
|
||||||
|
|
|
@ -107,6 +107,10 @@ const IslandResetModal = (props: Props) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
return auth.authFetch('/api/clear-simulation-data', {method: 'POST'})
|
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 => {
|
.then(res => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
return auth.authFetch('/api/island-mode', {method: 'POST', body: '{"mode": "unset"}'})
|
return auth.authFetch('/api/island-mode', {method: 'POST', body: '{"mode": "unset"}'})
|
||||||
|
|
Loading…
Reference in New Issue