[Security Solution][Ingest Manager][Endpoint] Optional ingest manager (#71198)

This commit is contained in:
Madison Caldwell 2020-07-10 18:23:51 -04:00 committed by GitHub
parent 66c531d903
commit e1253ed047
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 15 deletions

View file

@ -11,7 +11,6 @@
"embeddable",
"features",
"home",
"ingestManager",
"taskManager",
"inspector",
"licensing",
@ -21,6 +20,7 @@
],
"optionalPlugins": [
"encryptedSavedObjects",
"ingestManager",
"ml",
"newsfeed",
"security",
@ -33,6 +33,7 @@
"requiredBundles": [
"kibanaUtils",
"esUiShared",
"kibanaReact"
"kibanaReact",
"ingestManager"
]
}

View file

@ -324,10 +324,12 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
public start(core: CoreStart, plugins: StartPlugins) {
KibanaServices.init({ ...core, ...plugins, kibanaVersion: this.kibanaVersion });
plugins.ingestManager.registerPackageConfigComponent(
'endpoint',
ConfigureEndpointPackageConfig
);
if (plugins.ingestManager) {
plugins.ingestManager.registerPackageConfigComponent(
'endpoint',
ConfigureEndpointPackageConfig
);
}
return {};
}

View file

@ -32,7 +32,7 @@ export interface StartPlugins {
data: DataPublicPluginStart;
embeddable: EmbeddableStart;
inspector: InspectorStart;
ingestManager: IngestManagerStart;
ingestManager?: IngestManagerStart;
newsfeed?: NewsfeedStart;
triggers_actions_ui: TriggersActionsStart;
uiActions: UiActionsStart;

View file

@ -8,14 +8,14 @@ import { httpServerMock } from '../../../../../src/core/server/mocks';
import { EndpointAppContextService } from './endpoint_app_context_services';
describe('test endpoint app context services', () => {
// it('should return undefined on getAgentService if dependencies are not enabled', async () => {
// const endpointAppContextService = new EndpointAppContextService();
// expect(endpointAppContextService.getAgentService()).toEqual(undefined);
// });
// it('should return undefined on getManifestManager if dependencies are not enabled', async () => {
// const endpointAppContextService = new EndpointAppContextService();
// expect(endpointAppContextService.getManifestManager()).toEqual(undefined);
// });
it('should return undefined on getAgentService if dependencies are not enabled', async () => {
const endpointAppContextService = new EndpointAppContextService();
expect(endpointAppContextService.getAgentService()).toEqual(undefined);
});
it('should return undefined on getManifestManager if dependencies are not enabled', async () => {
const endpointAppContextService = new EndpointAppContextService();
expect(endpointAppContextService.getManifestManager()).toEqual(undefined);
});
it('should throw error on getScopedSavedObjectsClient if start is not called', async () => {
const endpointAppContextService = new EndpointAppContextService();
expect(() =>