[SIEM] Removed configuration pattern per suggestion from code review (#35974)

* Tested basics of application to make sure nothing is broken
* https://github.com/elastic/ingest-dev/issues/421
This commit is contained in:
Frank Hassanabad 2019-05-21 19:03:28 -06:00 committed by GitHub
parent 371efd9bb1
commit d959ee4b9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 26 deletions

View file

@ -4,12 +4,11 @@
* you may not use this file except in compliance with the Elastic License.
*/
import JoiNamespace from 'joi';
import { resolve } from 'path';
import { Server } from 'hapi';
import { i18n } from '@kbn/i18n';
import { getConfigSchema, initServerWithKibana } from './server/kibana.index';
import { initServerWithKibana } from './server/kibana.index';
export const APP_ID = 'siem';
export const APP_NAME = 'SIEM';
@ -55,9 +54,6 @@ export function siem(kibana: any) {
},
},
},
config(Joi: typeof JoiNamespace) {
return getConfigSchema(Joi);
},
init(server: Server) {
initServerWithKibana(server);
},

View file

@ -6,7 +6,6 @@
import { i18n } from '@kbn/i18n';
import { Server } from 'hapi';
import JoiNamespace from 'joi';
import { initServer } from './init_server';
import { compose } from './lib/compose/kibana';
@ -64,23 +63,3 @@ export const initServerWithKibana = (kbnServer: Server) => {
},
});
};
export const getConfigSchema = (Joi: typeof JoiNamespace) => {
const DefaultSourceConfigSchema = Joi.object({});
const AppRootConfigSchema = Joi.object({
enabled: Joi.boolean().default(true),
query: Joi.object({
partitionSize: Joi.number(),
partitionFactor: Joi.number(),
}).default(),
sources: Joi.object()
.keys({
default: DefaultSourceConfigSchema,
})
.pattern(/.*/, DefaultSourceConfigSchema)
.default(),
}).default();
return AppRootConfigSchema;
};