mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
[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:
parent
371efd9bb1
commit
d959ee4b9e
2 changed files with 1 additions and 26 deletions
|
@ -4,12 +4,11 @@
|
||||||
* you may not use this file except in compliance with the Elastic License.
|
* you may not use this file except in compliance with the Elastic License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import JoiNamespace from 'joi';
|
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import { Server } from 'hapi';
|
import { Server } from 'hapi';
|
||||||
|
|
||||||
import { i18n } from '@kbn/i18n';
|
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_ID = 'siem';
|
||||||
export const APP_NAME = '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) {
|
init(server: Server) {
|
||||||
initServerWithKibana(server);
|
initServerWithKibana(server);
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
import { i18n } from '@kbn/i18n';
|
import { i18n } from '@kbn/i18n';
|
||||||
import { Server } from 'hapi';
|
import { Server } from 'hapi';
|
||||||
import JoiNamespace from 'joi';
|
|
||||||
|
|
||||||
import { initServer } from './init_server';
|
import { initServer } from './init_server';
|
||||||
import { compose } from './lib/compose/kibana';
|
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;
|
|
||||||
};
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue