Skip to content

Commit

Permalink
[8.x] Delete data when clearing security entity store (elastic#197938) (
Browse files Browse the repository at this point in the history
elastic#198018)

# Backport

This will backport the following commits from `main` to `8.x`:
- [Delete data when clearing security entity store
(elastic#197938)](elastic#197938)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Jared
Burgett","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-28T14:59:01Z","message":"Delete
data when clearing security entity store (elastic#197938)\n\n##
Summary\r\n\r\nFixed a bug where the \"Clear all entities\" button in
the security entity\r\nstore didn't delete data due to a missing query
parameter.","sha":"ffc88107f0f136481662f1fe3d1a19e23319eecd","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","v8.16.0","backport:version","v8.17.0"],"title":"Delete
data when clearing security entity
store","number":197938,"url":"https://github.com/elastic/kibana/pull/197938","mergeCommit":{"message":"Delete
data when clearing security entity store (elastic#197938)\n\n##
Summary\r\n\r\nFixed a bug where the \"Clear all entities\" button in
the security entity\r\nstore didn't delete data due to a missing query
parameter.","sha":"ffc88107f0f136481662f1fe3d1a19e23319eecd"}},"sourceBranch":"main","suggestedTargetBranches":["8.16","8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197938","number":197938,"mergeCommit":{"message":"Delete
data when clearing security entity store (elastic#197938)\n\n##
Summary\r\n\r\nFixed a bug where the \"Clear all entities\" button in
the security entity\r\nstore didn't delete data due to a missing query
parameter.","sha":"ffc88107f0f136481662f1fe3d1a19e23319eecd"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jared Burgett <[email protected]>
  • Loading branch information
kibanamachine and jaredburgettelastic authored Oct 28, 2024
1 parent 9dcb613 commit 0fba9b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ export const useEntityStoreRoutes = () => {
});
};

const deleteEntityEngine = async (entityType: EntityType) => {
const deleteEntityEngine = async (entityType: EntityType, deleteData: boolean) => {
return http.fetch<DeleteEntityEngineResponse>(`/api/entity_store/engines/${entityType}`, {
method: 'DELETE',
query: { data: deleteData },
version: API_VERSIONS.public.v1,
});
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export const useDeleteEntityEngineMutation = (options?: UseMutationOptions<{}>)
const invalidateEntityEngineStatusQuery = useInvalidateEntityEngineStatusQuery();
const { deleteEntityEngine } = useEntityStoreRoutes();
return useMutation<DeleteEntityEngineResponse[]>(
() => Promise.all([deleteEntityEngine('user'), deleteEntityEngine('host')]),
() => Promise.all([deleteEntityEngine('user', true), deleteEntityEngine('host', true)]),
{
...options,
mutationKey: DELETE_ENTITY_ENGINE_STATUS_KEY,
Expand Down

0 comments on commit 0fba9b0

Please sign in to comment.