-
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.
Preliminary refactoring: folder restructuring and creating API hooks
- Loading branch information
Showing
1,175 changed files
with
4,110 additions
and
5,032 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
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/security_solution/common/detection_engine/fleet_integrations/api/urls.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,11 @@ | ||
/* | ||
* 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 { INTERNAL_DETECTION_ENGINE_URL as INTERNAL_URL } from '../../../constants'; | ||
|
||
export const GET_INSTALLED_INTEGRATIONS_URL = | ||
`${INTERNAL_URL}/fleet/integrations/installed` as const; |
11 changes: 11 additions & 0 deletions
11
x-pack/plugins/security_solution/common/detection_engine/fleet_integrations/index.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,11 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './api/get_installed_integrations/response_schema'; | ||
export * from './api/urls'; | ||
|
||
export * from './model/installed_integrations'; |
File renamed without changes.
Empty file.
Empty file.
Empty file.
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
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
35 changes: 35 additions & 0 deletions
35
.../security_solution/public/detection_engine/fleet_integrations/api/__mocks__/api_client.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,35 @@ | ||
/* | ||
* 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 { GetInstalledIntegrationsResponse } from '../../../../../common/detection_engine/fleet_integrations'; | ||
import type { | ||
FetchInstalledIntegrationsArgs, | ||
IFleetIntegrationsApiClient, | ||
} from '../api_client_interface'; | ||
|
||
export const fleetIntegrationsApi: jest.Mocked<IFleetIntegrationsApiClient> = { | ||
fetchInstalledIntegrations: jest | ||
.fn<Promise<GetInstalledIntegrationsResponse>, [FetchInstalledIntegrationsArgs]>() | ||
.mockResolvedValue({ | ||
installed_integrations: [ | ||
{ | ||
package_name: 'atlassian_bitbucket', | ||
package_title: 'Atlassian Bitbucket', | ||
package_version: '1.0.1', | ||
integration_name: 'audit', | ||
integration_title: 'Audit Logs', | ||
is_enabled: true, | ||
}, | ||
{ | ||
package_name: 'system', | ||
package_title: 'System', | ||
package_version: '1.6.4', | ||
is_enabled: true, | ||
}, | ||
], | ||
}), | ||
}; |
8 changes: 8 additions & 0 deletions
8
...ugins/security_solution/public/detection_engine/fleet_integrations/api/__mocks__/index.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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './api_client'; |
33 changes: 33 additions & 0 deletions
33
...ck/plugins/security_solution/public/detection_engine/fleet_integrations/api/api_client.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,33 @@ | ||
/* | ||
* 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 { GetInstalledIntegrationsResponse } from '../../../../common/detection_engine/fleet_integrations'; | ||
import { GET_INSTALLED_INTEGRATIONS_URL } from '../../../../common/detection_engine/fleet_integrations'; | ||
import { KibanaServices } from '../../../common/lib/kibana'; | ||
|
||
import type { | ||
FetchInstalledIntegrationsArgs, | ||
IFleetIntegrationsApiClient, | ||
} from './api_client_interface'; | ||
|
||
export const fleetIntegrationsApi: IFleetIntegrationsApiClient = { | ||
fetchInstalledIntegrations: ( | ||
args: FetchInstalledIntegrationsArgs | ||
): Promise<GetInstalledIntegrationsResponse> => { | ||
const { packages, signal } = args; | ||
|
||
return http().fetch<GetInstalledIntegrationsResponse>(GET_INSTALLED_INTEGRATIONS_URL, { | ||
method: 'GET', | ||
query: { | ||
packages: packages?.sort()?.join(','), | ||
}, | ||
signal, | ||
}); | ||
}, | ||
}; | ||
|
||
const http = () => KibanaServices.get().http; |
30 changes: 30 additions & 0 deletions
30
.../security_solution/public/detection_engine/fleet_integrations/api/api_client_interface.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,30 @@ | ||
/* | ||
* 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 { GetInstalledIntegrationsResponse } from '../../../../common/detection_engine/fleet_integrations'; | ||
|
||
export interface IFleetIntegrationsApiClient { | ||
/** | ||
* Fetch all installed integrations. | ||
* @throws An error if response is not OK | ||
*/ | ||
fetchInstalledIntegrations( | ||
args: FetchInstalledIntegrationsArgs | ||
): Promise<GetInstalledIntegrationsResponse>; | ||
} | ||
|
||
export interface FetchInstalledIntegrationsArgs { | ||
/** | ||
* Array of Fleet packages to filter for. | ||
*/ | ||
packages?: string[]; | ||
|
||
/** | ||
* Optional signal for cancelling the request. | ||
*/ | ||
signal?: AbortSignal; | ||
} |
9 changes: 9 additions & 0 deletions
9
x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/api/index.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,9 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './api_client_interface'; | ||
export * from './api_client'; |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/security_solution/public/detection_engine/fleet_integrations/index.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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export * from './api'; |
Empty file.
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
Oops, something went wrong.