-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EDR Workflows] Deprecate public endpoint/suggestions api endpoint in…
… favour of an internal one (#194832) New internal GET `/internal/api/endpoint/suggestions/{suggestion_type}` route. Current public GET `/api/endpoint/suggestions/{suggestion_type}` route is set to deprecated. UI uses now the internal GET `/internal/api/endpoint/suggestions/{suggestion_type}` api route --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
ca1d375
commit ef4755a
Showing
13 changed files
with
91 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...lugins/security_solution/public/management/pages/event_filters/service/api_client.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import type { HttpSetup } from '@kbn/core-http-browser'; | ||
import { EventFiltersApiClient } from './api_client'; | ||
import { coreMock } from '@kbn/core/public/mocks'; | ||
import { SUGGESTIONS_INTERNAL_ROUTE } from '../../../../../common/endpoint/constants'; | ||
import { resolvePathVariables } from '../../../../common/utils/resolve_path_variables'; | ||
|
||
describe('EventFiltersApiClient', () => { | ||
let fakeHttpServices: jest.Mocked<HttpSetup>; | ||
let eventFiltersApiClient: EventFiltersApiClient; | ||
|
||
beforeAll(() => { | ||
fakeHttpServices = coreMock.createStart().http as jest.Mocked<HttpSetup>; | ||
eventFiltersApiClient = new EventFiltersApiClient(fakeHttpServices); | ||
}); | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
|
||
it('should call the SUGGESTIONS_INTERNAL_ROUTE with correct URL and body', async () => { | ||
await eventFiltersApiClient.getSuggestions({ | ||
field: 'host.name', | ||
query: 'test', | ||
}); | ||
|
||
expect(fakeHttpServices.post).toHaveBeenCalledWith( | ||
resolvePathVariables(SUGGESTIONS_INTERNAL_ROUTE, { suggestion_type: 'eventFilters' }), | ||
{ | ||
version: '1', | ||
body: JSON.stringify({ | ||
field: 'host.name', | ||
query: 'test', | ||
}), | ||
} | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters