Skip to content

Commit 6845d79

Browse files
committed
Remove exceptionListClient service from EndpointAppContextService
1 parent 8d3fadd commit 6845d79

File tree

4 files changed

+1
-16
lines changed

4 files changed

+1
-16
lines changed

x-pack/plugins/security_solution/server/endpoint/endpoint_app_context_services.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,10 @@ import {
1212
import { AgentService, IngestManagerStartContract } from '../../../ingest_manager/server';
1313
import { getPackagePolicyCreateCallback } from './ingest_integration';
1414
import { ManifestManager } from './services/artifacts';
15-
import { ExceptionListClient } from '../../../lists/server';
1615

1716
export type EndpointAppContextServiceStartContract = Partial<
1817
Pick<IngestManagerStartContract, 'agentService'>
1918
> & {
20-
exceptionsListService: ExceptionListClient;
2119
logger: Logger;
2220
manifestManager?: ManifestManager;
2321
registerIngestCallback?: IngestManagerStartContract['registerExternalCallback'];
@@ -32,11 +30,9 @@ export class EndpointAppContextService {
3230
private agentService: AgentService | undefined;
3331
private manifestManager: ManifestManager | undefined;
3432
private savedObjectsStart: SavedObjectsServiceStart | undefined;
35-
private exceptionsListService: ExceptionListClient | undefined;
3633

3734
public start(dependencies: EndpointAppContextServiceStartContract) {
3835
this.agentService = dependencies.agentService;
39-
this.exceptionsListService = dependencies.exceptionsListService;
4036
this.manifestManager = dependencies.manifestManager;
4137
this.savedObjectsStart = dependencies.savedObjectsStart;
4238

@@ -54,13 +50,6 @@ export class EndpointAppContextService {
5450
return this.agentService;
5551
}
5652

57-
public getExceptionsList() {
58-
if (!this.exceptionsListService) {
59-
throw new Error('exceptionsListService not set');
60-
}
61-
return this.exceptionsListService;
62-
}
63-
6453
public getManifestManager(): ManifestManager | undefined {
6554
return this.manifestManager;
6655
}

x-pack/plugins/security_solution/server/endpoint/mocks.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
import { ManifestManager } from './services/artifacts/manifest_manager/manifest_manager';
2222
import { getManifestManagerMock } from './services/artifacts/manifest_manager/manifest_manager.mock';
2323
import { EndpointAppContext } from './types';
24-
import { listMock } from '../../../lists/server/mocks';
2524

2625
/**
2726
* Creates a mocked EndpointAppContext.
@@ -59,7 +58,6 @@ export const createMockEndpointAppContextServiceStartContract = (): jest.Mocked<
5958
> => {
6059
return {
6160
agentService: createMockAgentService(),
62-
exceptionsListService: listMock.getExceptionListClient(),
6361
logger: loggingSystemMock.create().get('mock_endpoint_app_context'),
6462
savedObjectsStart: savedObjectsServiceMock.createStartContract(),
6563
manifestManager: getManifestManagerMock(),

x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/handlers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ export const getTrustedAppsDeleteRouteHandler = (
3232
const logger = endpointAppContext.logFactory.get('trusted_apps');
3333

3434
return async (context, req, res) => {
35-
const exceptionsListService = endpointAppContext.service.getExceptionsList();
36-
3735
try {
36+
const exceptionsListService = exceptionListClientFromContext(context);
3837
const { id } = req.params;
3938
const response = await exceptionsListService.deleteExceptionListItem({
4039
id,

x-pack/plugins/security_solution/server/plugin.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
307307

308308
this.endpointAppContextService.start({
309309
agentService: plugins.ingestManager?.agentService,
310-
exceptionsListService: this.lists!.getExceptionListClient(savedObjectsClient, 'kibana'),
311310
logger: this.logger,
312311
manifestManager,
313312
registerIngestCallback,

0 commit comments

Comments
 (0)