31ce503c0a
* [xpack/encryptionKeys] use default keys when running from source * add tests for the config schema with different contexts * share the getConfigSchema helper * await promises returned by expect().resolves * tweak test naming * use data-driven tests * fix type error * hide platform dependent config from snapshot
17 lines
511 B
TypeScript
17 lines
511 B
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
*/
|
|
|
|
import Joi from 'joi';
|
|
|
|
export async function getConfigSchema(pluginProvider: any): Promise<Joi.Schema> {
|
|
class Plugin {
|
|
constructor(public readonly options: any) {}
|
|
}
|
|
|
|
const plugin = pluginProvider({ Plugin });
|
|
|
|
return await plugin.options.config(Joi);
|
|
}
|