From 2c0206b470870876a76121631d54e73cb610969a Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 29 Sep 2021 20:35:05 -0600 Subject: [PATCH 01/20] Update docs to remove references to settings. --- docs/dev-tools/console/console.asciidoc | 10 ------ docs/settings/apm-settings.asciidoc | 4 --- docs/settings/dev-settings.asciidoc | 34 ------------------- docs/settings/fleet-settings.asciidoc | 3 -- .../general-infra-logs-ui-settings.asciidoc | 4 --- docs/settings/graph-settings.asciidoc | 12 ------- docs/settings/ml-settings.asciidoc | 26 -------------- docs/settings/monitoring-settings.asciidoc | 7 ---- docs/settings/settings-xkb.asciidoc | 3 -- docs/settings/url-drilldown-settings.asciidoc | 4 --- docs/setup/settings.asciidoc | 23 ++++--------- docs/user/plugins.asciidoc | 17 ---------- 12 files changed, 6 insertions(+), 141 deletions(-) delete mode 100644 docs/settings/dev-settings.asciidoc delete mode 100644 docs/settings/graph-settings.asciidoc delete mode 100644 docs/settings/ml-settings.asciidoc diff --git a/docs/dev-tools/console/console.asciidoc b/docs/dev-tools/console/console.asciidoc index f29ddb1a600db..48fe936dd2db5 100644 --- a/docs/dev-tools/console/console.asciidoc +++ b/docs/dev-tools/console/console.asciidoc @@ -129,13 +129,3 @@ image::dev-tools/console/images/console-settings.png["Console Settings", width=6 For a list of available keyboard shortcuts, click *Help*. - -[float] -[[console-settings]] -=== Disable Console - -deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -If you don’t want to use *Console*, you can disable it by setting `console.enabled` -to `false` in your `kibana.yml` configuration file. Changing this setting -causes the server to regenerate assets on the next startup, -which might cause a delay before pages start being served. diff --git a/docs/settings/apm-settings.asciidoc b/docs/settings/apm-settings.asciidoc index fc20685885df7..ac6f813ba3a86 100644 --- a/docs/settings/apm-settings.asciidoc +++ b/docs/settings/apm-settings.asciidoc @@ -40,10 +40,6 @@ Changing these settings may disable features of the APM App. [cols="2*<"] |=== -| `xpack.apm.enabled` {ess-icon} - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] - Set to `false` to disable the APM app. Defaults to `true`. - | `xpack.apm.maxServiceEnvironments` {ess-icon} | Maximum number of unique service environments recognized by the UI. Defaults to `100`. diff --git a/docs/settings/dev-settings.asciidoc b/docs/settings/dev-settings.asciidoc deleted file mode 100644 index bcf4420cdadca..0000000000000 --- a/docs/settings/dev-settings.asciidoc +++ /dev/null @@ -1,34 +0,0 @@ -[role="xpack"] -[[dev-settings-kb]] -=== Development tools settings in {kib} -++++ -Development tools settings -++++ - -You do not need to configure any settings to use the development tools in {kib}. -They are enabled by default. - -[float] -[[grok-settings]] -==== Grok Debugger settings - -`xpack.grokdebugger.enabled` {ess-icon}:: -deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Set to `true` to enable the <>. Defaults to `true`. - - -[float] -[[profiler-settings]] -==== {searchprofiler} settings - -`xpack.searchprofiler.enabled`:: -deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Set to `true` to enable the <>. Defaults to `true`. - -[float] -[[painless_lab-settings]] -==== Painless Lab settings - -`xpack.painless_lab.enabled`:: -deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -When set to `true`, enables the <>. Defaults to `true`. diff --git a/docs/settings/fleet-settings.asciidoc b/docs/settings/fleet-settings.asciidoc index f6f5b4a79fb6d..f0dfeb619bb38 100644 --- a/docs/settings/fleet-settings.asciidoc +++ b/docs/settings/fleet-settings.asciidoc @@ -20,9 +20,6 @@ See the {fleet-guide}/index.html[{fleet}] docs for more information. [cols="2*<"] |=== -| `xpack.fleet.enabled` {ess-icon} - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] - Set to `true` (default) to enable {fleet}. | `xpack.fleet.agents.enabled` {ess-icon} | Set to `true` (default) to enable {fleet}. |=== diff --git a/docs/settings/general-infra-logs-ui-settings.asciidoc b/docs/settings/general-infra-logs-ui-settings.asciidoc index 1e6dcf012206b..d56c38f120170 100644 --- a/docs/settings/general-infra-logs-ui-settings.asciidoc +++ b/docs/settings/general-infra-logs-ui-settings.asciidoc @@ -1,8 +1,4 @@ -`xpack.infra.enabled`:: -deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Set to `false` to disable the Logs and Metrics app plugin {kib}. Defaults to `true`. - `xpack.infra.sources.default.logAlias`:: Index pattern for matching indices that contain log data. Defaults to `filebeat-*,kibana_sample_data_logs*`. To match multiple wildcard patterns, use a comma to separate the names, with no space after the comma. For example, `logstash-app1-*,default-logs-*`. diff --git a/docs/settings/graph-settings.asciidoc b/docs/settings/graph-settings.asciidoc deleted file mode 100644 index 793a8aae73158..0000000000000 --- a/docs/settings/graph-settings.asciidoc +++ /dev/null @@ -1,12 +0,0 @@ -[role="xpack"] -[[graph-settings-kb]] -=== Graph settings in {kib} -++++ -Graph settings -++++ - -You do not need to configure any settings to use the {graph-features}. - -`xpack.graph.enabled` {ess-icon}:: -deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Set to `false` to disable the {graph-features}. diff --git a/docs/settings/ml-settings.asciidoc b/docs/settings/ml-settings.asciidoc deleted file mode 100644 index e67876c76df0d..0000000000000 --- a/docs/settings/ml-settings.asciidoc +++ /dev/null @@ -1,26 +0,0 @@ -[role="xpack"] -[[ml-settings-kb]] -=== Machine learning settings in {kib} -++++ -Machine learning settings -++++ - -You do not need to configure any settings to use {kib} {ml-features}. They are -enabled by default. - -[[general-ml-settings-kb]] -==== General {ml} settings - -`xpack.ml.enabled` {ess-icon}:: -deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Set to `true` (default) to enable {kib} {ml-features}. + -+ -If set to `false` in `kibana.yml`, the {ml} icon is hidden in this {kib} -instance. If `xpack.ml.enabled` is set to `true` in `elasticsearch.yml`, however, -you can still use the {ml} APIs. To disable {ml} entirely, refer to -{ref}/ml-settings.html[{es} {ml} settings]. - -[[advanced-ml-settings-kb]] -==== Advanced {ml} settings - -Refer to <>. diff --git a/docs/settings/monitoring-settings.asciidoc b/docs/settings/monitoring-settings.asciidoc index 03c11007c64c4..d8bc26b7b3987 100644 --- a/docs/settings/monitoring-settings.asciidoc +++ b/docs/settings/monitoring-settings.asciidoc @@ -31,13 +31,6 @@ For more information, see [cols="2*<"] |=== -| `monitoring.enabled` - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] - Set to `true` (default) to enable the {monitor-features} in {kib}. Unlike the - <> setting, when this setting is `false`, the - monitoring back-end does not run and {kib} stats are not sent to the monitoring - cluster. - | `monitoring.ui.ccs.enabled` | Set to `true` (default) to enable {ref}/modules-cross-cluster-search.html[cross-cluster search] of your monitoring data. The {ref}/modules-remote-clusters.html#remote-cluster-settings[`remote_cluster_client`] role must exist on each node. diff --git a/docs/settings/settings-xkb.asciidoc b/docs/settings/settings-xkb.asciidoc index 1bd38578750d7..64f97525ed747 100644 --- a/docs/settings/settings-xkb.asciidoc +++ b/docs/settings/settings-xkb.asciidoc @@ -13,11 +13,8 @@ For more {kib} configuration settings, see <>. include::alert-action-settings.asciidoc[] include::apm-settings.asciidoc[] include::banners-settings.asciidoc[] -include::dev-settings.asciidoc[] -include::graph-settings.asciidoc[] include::infrastructure-ui-settings.asciidoc[] include::logs-ui-settings.asciidoc[] -include::ml-settings.asciidoc[] include::reporting-settings.asciidoc[] include::spaces-settings.asciidoc[] include::task-manager-settings.asciidoc[] diff --git a/docs/settings/url-drilldown-settings.asciidoc b/docs/settings/url-drilldown-settings.asciidoc index ca414d4f650e9..702829ec34dcc 100644 --- a/docs/settings/url-drilldown-settings.asciidoc +++ b/docs/settings/url-drilldown-settings.asciidoc @@ -8,10 +8,6 @@ Configure the URL drilldown settings in your `kibana.yml` configuration file. [cols="2*<"] |=== -| [[url-drilldown-enabled]] `url_drilldown.enabled` - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] - When `true`, enables URL drilldowns on your {kib} instance. - | [[external-URL-policy]] `externalUrl.policy` | Configures the external URL policies. URL drilldowns respect the global *External URL* service, which you can use to deny or allow external URLs. By default all external URLs are allowed. diff --git a/docs/setup/settings.asciidoc b/docs/setup/settings.asciidoc index 48bf5fe2cd7b3..16fa8eb734204 100644 --- a/docs/setup/settings.asciidoc +++ b/docs/setup/settings.asciidoc @@ -20,11 +20,12 @@ configuration using `${MY_ENV_VAR}` syntax. [cols="2*<"] |=== -| `console.enabled:` - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Toggling this causes the server to regenerate assets on the next startup, -which may cause a delay before pages start being served. -Set to `false` to disable Console. *Default: `true`* +| `csp.rules:` + | deprecated:[7.14.0,"In 8.0 and later, this setting will no longer be supported."] +A https://w3c.github.io/webappsec-csp/[Content Security Policy] template +that disables certain unnecessary and potentially insecure capabilities in +the browser. It is strongly recommended that you keep the default CSP rules +that ship with {kib}. | `csp.script_src:` | Add sources for the https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src[Content Security Policy `script-src` directive]. @@ -688,15 +689,6 @@ sources and images. When false, Vega can only get data from {es}. *Default: `fal `exploreDataInChart.enabled` | Enables you to view the underlying documents in a data series from a dashboard panel. *Default: `false`* -| `xpack.license_management.enabled` - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Set this value to false to disable the License Management UI. -*Default: `true`* - -| `xpack.rollup.enabled:` - | deprecated:[7.16.0,"In 8.0 and later, this setting will no longer be supported."] -Set this value to false to disable the Rollup UI. *Default: true* - | `i18n.locale` {ess-icon} | Set this value to change the {kib} interface language. Valid locales are: `en`, `zh-CN`, `ja-JP`. *Default: `en`* @@ -706,14 +698,11 @@ Valid locales are: `en`, `zh-CN`, `ja-JP`. *Default: `en`* include::{kib-repo-dir}/settings/alert-action-settings.asciidoc[] include::{kib-repo-dir}/settings/apm-settings.asciidoc[] include::{kib-repo-dir}/settings/banners-settings.asciidoc[] -include::{kib-repo-dir}/settings/dev-settings.asciidoc[] -include::{kib-repo-dir}/settings/graph-settings.asciidoc[] include::{kib-repo-dir}/settings/fleet-settings.asciidoc[] include::{kib-repo-dir}/settings/i18n-settings.asciidoc[] include::{kib-repo-dir}/settings/logging-settings.asciidoc[] include::{kib-repo-dir}/settings/logs-ui-settings.asciidoc[] include::{kib-repo-dir}/settings/infrastructure-ui-settings.asciidoc[] -include::{kib-repo-dir}/settings/ml-settings.asciidoc[] include::{kib-repo-dir}/settings/monitoring-settings.asciidoc[] include::{kib-repo-dir}/settings/reporting-settings.asciidoc[] include::secure-settings.asciidoc[] diff --git a/docs/user/plugins.asciidoc b/docs/user/plugins.asciidoc index c604526d6c933..36f7ce8eb49ed 100644 --- a/docs/user/plugins.asciidoc +++ b/docs/user/plugins.asciidoc @@ -145,23 +145,6 @@ You can also remove a plugin manually by deleting the plugin's subdirectory unde NOTE: Removing a plugin will result in an "optimize" run which will delay the next start of {kib}. -[float] -[[disable-plugin]] -== Disable plugins - -deprecated:[7.16.0,"In 8.0 and later, this setting will only be supported for a subset of plugins that have opted in to the behavior."] - -Use the following command to disable a plugin: - -[source,shell] ------------ -./bin/kibana --.enabled=false <1> ------------ - -NOTE: Disabling or enabling a plugin will result in an "optimize" run which will delay the start of {kib}. - -<1> You can find a plugin's plugin ID as the value of the `name` property in the plugin's `kibana.json` file. - [float] [[configure-plugin-manager]] == Configure the plugin manager From a9ad5a1d8f90ef57f7382744a5cec94d74f2bf0b Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 29 Sep 2021 21:10:25 -0600 Subject: [PATCH 02/20] Remove explicit 'enabled' settings from plugins. --- src/plugins/console/server/config.ts | 8 +------ x-pack/plugins/apm/server/index.ts | 9 +------ x-pack/plugins/cases/server/config.ts | 1 - x-pack/plugins/cases/server/index.ts | 3 +-- x-pack/plugins/cases/server/plugin.ts | 11 --------- x-pack/plugins/cloud/server/config.ts | 2 -- .../server/config.ts | 1 - .../cross_cluster_replication/server/index.ts | 1 - .../server/config.test.ts | 5 ---- .../encrypted_saved_objects/server/config.ts | 1 - .../encrypted_saved_objects/server/index.ts | 1 - .../__mocks__/routerDependencies.mock.ts | 1 - .../plugins/enterprise_search/server/index.ts | 2 -- x-pack/plugins/fleet/server/index.ts | 4 +--- x-pack/plugins/graph/config.ts | 1 - x-pack/plugins/graph/server/index.ts | 1 - .../server/config.ts | 1 - .../server/index.ts | 1 - .../plugins/index_management/server/config.ts | 14 ----------- .../plugins/index_management/server/index.ts | 9 +------ x-pack/plugins/infra/server/plugin.ts | 2 -- x-pack/plugins/lens/config.ts | 14 ----------- x-pack/plugins/lens/server/index.ts | 9 +------ .../license_management/server/config.ts | 1 - .../license_management/server/index.ts | 1 - x-pack/plugins/lists/server/config.mock.ts | 1 - x-pack/plugins/lists/server/config.ts | 1 - x-pack/plugins/lists/server/index.ts | 1 - .../server/services/lists/list_client.mock.ts | 1 - x-pack/plugins/logstash/server/index.ts | 10 +------- x-pack/plugins/maps/config.ts | 2 -- x-pack/plugins/maps/server/index.ts | 4 +--- x-pack/plugins/maps/server/plugin.ts | 9 ------- .../plugins/metrics_entities/server/config.ts | 14 ----------- .../plugins/metrics_entities/server/index.ts | 7 +----- x-pack/plugins/monitoring/public/plugin.ts | 2 +- .../plugins/monitoring/server/config.test.ts | 1 - x-pack/plugins/monitoring/server/config.ts | 1 - .../plugins/monitoring/server/deprecations.ts | 2 -- x-pack/plugins/monitoring/server/index.ts | 1 - x-pack/plugins/observability/server/index.ts | 2 -- x-pack/plugins/osquery/public/plugin.ts | 24 ------------------- x-pack/plugins/osquery/server/config.ts | 1 - x-pack/plugins/osquery/server/index.ts | 2 -- x-pack/plugins/osquery/server/plugin.ts | 4 ---- .../plugins/remote_clusters/server/config.ts | 2 -- x-pack/plugins/rollup/server/config.ts | 14 ----------- x-pack/plugins/rollup/server/index.ts | 8 +------ x-pack/plugins/rule_registry/server/config.ts | 6 +---- .../saved_objects_tagging/server/config.ts | 2 -- .../security_solution/server/config.ts | 1 - .../plugins/security_solution/server/index.ts | 3 +-- .../routes/__mocks__/index.ts | 1 - .../plugins/snapshot_restore/server/config.ts | 1 - .../plugins/snapshot_restore/server/index.ts | 1 - .../plugins/snapshot_restore/server/plugin.ts | 4 ---- x-pack/plugins/timelines/public/index.ts | 6 ++--- x-pack/plugins/timelines/public/plugin.ts | 12 +--------- x-pack/plugins/timelines/server/config.ts | 14 ----------- x-pack/plugins/timelines/server/index.ts | 10 +------- .../upgrade_assistant/common/config.ts | 1 - .../plugins/upgrade_assistant/server/index.ts | 1 - 62 files changed, 17 insertions(+), 264 deletions(-) delete mode 100644 x-pack/plugins/index_management/server/config.ts delete mode 100644 x-pack/plugins/lens/config.ts delete mode 100644 x-pack/plugins/metrics_entities/server/config.ts delete mode 100644 x-pack/plugins/rollup/server/config.ts delete mode 100644 x-pack/plugins/timelines/server/config.ts diff --git a/src/plugins/console/server/config.ts b/src/plugins/console/server/config.ts index 6d667fed081e8..5c060e46d1080 100644 --- a/src/plugins/console/server/config.ts +++ b/src/plugins/console/server/config.ts @@ -15,7 +15,6 @@ import { MAJOR_VERSION } from '../common/constants'; const kibanaVersion = new SemVer(MAJOR_VERSION); const baseSettings = { - enabled: schema.boolean({ defaultValue: true }), ssl: schema.object({ verify: schema.boolean({ defaultValue: false }) }, {}), }; @@ -66,10 +65,5 @@ export type ConfigType7x = TypeOf; export const config: PluginConfigDescriptor = { schema: kibanaVersion.major < 8 ? configSchema7x : configSchema, - deprecations: ({ deprecate, unused }) => [ - deprecate('enabled', '8.0.0'), - deprecate('proxyFilter', '8.0.0'), - deprecate('proxyConfig', '8.0.0'), - unused('ssl'), - ], + deprecations: ({ deprecate, unused }) => [unused('ssl')], }; diff --git a/x-pack/plugins/apm/server/index.ts b/x-pack/plugins/apm/server/index.ts index abf9b3f5fb774..1ed54be0271dd 100644 --- a/x-pack/plugins/apm/server/index.ts +++ b/x-pack/plugins/apm/server/index.ts @@ -17,7 +17,6 @@ import { APMPlugin } from './plugin'; // All options should be documented in the APM configuration settings: https://github.com/elastic/kibana/blob/master/docs/settings/apm-settings.asciidoc // and be included on cloud allow list unless there are specific reasons not to const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), serviceMapEnabled: schema.boolean({ defaultValue: true }), serviceMapFingerprintBucketSize: schema.number({ defaultValue: 100 }), serviceMapTraceIdBucketSize: schema.number({ defaultValue: 65 }), @@ -60,13 +59,7 @@ const configSchema = schema.object({ // plugin config export const config: PluginConfigDescriptor = { - deprecations: ({ - deprecate, - renameFromRoot, - deprecateFromRoot, - unusedFromRoot, - }) => [ - deprecate('enabled', '8.0.0'), + deprecations: ({ renameFromRoot, deprecateFromRoot, unusedFromRoot }) => [ renameFromRoot( 'apm_oss.transactionIndices', 'xpack.apm.indices.transaction' diff --git a/x-pack/plugins/cases/server/config.ts b/x-pack/plugins/cases/server/config.ts index 7a81c47937a6c..bbda9fa7a32ae 100644 --- a/x-pack/plugins/cases/server/config.ts +++ b/x-pack/plugins/cases/server/config.ts @@ -8,7 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const ConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), markdownPlugins: schema.object({ lens: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/cases/server/index.ts b/x-pack/plugins/cases/server/index.ts index ad76724eb49f7..5e433b46b80e5 100644 --- a/x-pack/plugins/cases/server/index.ts +++ b/x-pack/plugins/cases/server/index.ts @@ -15,8 +15,7 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { markdownPlugins: true, }, - deprecations: ({ deprecate, renameFromRoot }) => [ - deprecate('enabled', '8.0.0'), + deprecations: ({ renameFromRoot }) => [ renameFromRoot('xpack.case.enabled', 'xpack.cases.enabled'), ], }; diff --git a/x-pack/plugins/cases/server/plugin.ts b/x-pack/plugins/cases/server/plugin.ts index c04e495889a74..bef8d45bd86f6 100644 --- a/x-pack/plugins/cases/server/plugin.ts +++ b/x-pack/plugins/cases/server/plugin.ts @@ -15,7 +15,6 @@ import { } from '../../actions/server'; import { APP_ID, ENABLE_CASE_CONNECTOR } from '../common'; -import { ConfigType } from './config'; import { initCaseApi } from './routes/api'; import { createCaseCommentSavedObjectType, @@ -34,10 +33,6 @@ import { SpacesPluginStart } from '../../spaces/server'; import { PluginStartContract as FeaturesPluginStart } from '../../features/server'; import { LensServerPluginSetup } from '../../lens/server'; -function createConfig(context: PluginInitializerContext) { - return context.config.get(); -} - export interface PluginsSetup { security?: SecurityPluginSetup; actions: ActionsPluginSetup; @@ -76,12 +71,6 @@ export class CasePlugin { } public setup(core: CoreSetup, plugins: PluginsSetup) { - const config = createConfig(this.initializerContext); - - if (!config.enabled) { - return; - } - this.securityPluginSetup = plugins.security; this.lensEmbeddableFactory = plugins.lens.lensEmbeddableFactory; diff --git a/x-pack/plugins/cloud/server/config.ts b/x-pack/plugins/cloud/server/config.ts index 2cc413178c3ae..109987cd72d44 100644 --- a/x-pack/plugins/cloud/server/config.ts +++ b/x-pack/plugins/cloud/server/config.ts @@ -29,7 +29,6 @@ const fullStoryConfigSchema = schema.object({ }); const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), id: schema.maybe(schema.string()), apm: schema.maybe(apmConfigSchema), cname: schema.maybe(schema.string()), @@ -52,6 +51,5 @@ export const config: PluginConfigDescriptor = { organization_url: true, full_story: true, }, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, }; diff --git a/x-pack/plugins/cross_cluster_replication/server/config.ts b/x-pack/plugins/cross_cluster_replication/server/config.ts index 50cca903f8a2b..a24b21f22fb7e 100644 --- a/x-pack/plugins/cross_cluster_replication/server/config.ts +++ b/x-pack/plugins/cross_cluster_replication/server/config.ts @@ -8,7 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/cross_cluster_replication/server/index.ts b/x-pack/plugins/cross_cluster_replication/server/index.ts index a6a3ec0fe5753..b1803950614d8 100644 --- a/x-pack/plugins/cross_cluster_replication/server/index.ts +++ b/x-pack/plugins/cross_cluster_replication/server/index.ts @@ -17,5 +17,4 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/encrypted_saved_objects/server/config.test.ts b/x-pack/plugins/encrypted_saved_objects/server/config.test.ts index 1cc5f7974cb13..ea22446d289ae 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/config.test.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/config.test.ts @@ -11,7 +11,6 @@ describe('config schema', () => { it('generates proper defaults', () => { expect(ConfigSchema.validate({})).toMatchInlineSnapshot(` Object { - "enabled": true, "encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "keyRotation": Object { "decryptionOnlyKeys": Array [], @@ -21,7 +20,6 @@ describe('config schema', () => { expect(ConfigSchema.validate({}, { dist: false })).toMatchInlineSnapshot(` Object { - "enabled": true, "encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "keyRotation": Object { "decryptionOnlyKeys": Array [], @@ -32,7 +30,6 @@ describe('config schema', () => { expect(ConfigSchema.validate({ encryptionKey: 'z'.repeat(32) }, { dist: true })) .toMatchInlineSnapshot(` Object { - "enabled": true, "encryptionKey": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", "keyRotation": Object { "decryptionOnlyKeys": Array [], @@ -42,7 +39,6 @@ describe('config schema', () => { expect(ConfigSchema.validate({}, { dist: true })).toMatchInlineSnapshot(` Object { - "enabled": true, "keyRotation": Object { "decryptionOnlyKeys": Array [], }, @@ -61,7 +57,6 @@ describe('config schema', () => { ) ).toMatchInlineSnapshot(` Object { - "enabled": true, "encryptionKey": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "keyRotation": Object { "decryptionOnlyKeys": Array [ diff --git a/x-pack/plugins/encrypted_saved_objects/server/config.ts b/x-pack/plugins/encrypted_saved_objects/server/config.ts index fc86336d44836..2cf7c12f95d55 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/config.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/config.ts @@ -12,7 +12,6 @@ export type ConfigType = TypeOf; export const ConfigSchema = schema.object( { - enabled: schema.boolean({ defaultValue: true }), encryptionKey: schema.conditional( schema.contextRef('dist'), true, diff --git a/x-pack/plugins/encrypted_saved_objects/server/index.ts b/x-pack/plugins/encrypted_saved_objects/server/index.ts index b765f1fcaf6fa..d462f06939f6b 100644 --- a/x-pack/plugins/encrypted_saved_objects/server/index.ts +++ b/x-pack/plugins/encrypted_saved_objects/server/index.ts @@ -17,7 +17,6 @@ export type { IsMigrationNeededPredicate } from './create_migration'; export const config: PluginConfigDescriptor = { schema: ConfigSchema, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; export const plugin = (initializerContext: PluginInitializerContext) => new EncryptedSavedObjectsPlugin(initializerContext); diff --git a/x-pack/plugins/enterprise_search/server/__mocks__/routerDependencies.mock.ts b/x-pack/plugins/enterprise_search/server/__mocks__/routerDependencies.mock.ts index 08be1a134ae02..1bd47c94a84b7 100644 --- a/x-pack/plugins/enterprise_search/server/__mocks__/routerDependencies.mock.ts +++ b/x-pack/plugins/enterprise_search/server/__mocks__/routerDependencies.mock.ts @@ -19,7 +19,6 @@ export const mockRequestHandler = { }; export const mockConfig = { - enabled: true, host: 'http://localhost:3002', accessCheckTimeout: 5000, accessCheckTimeoutWarning: 300, diff --git a/x-pack/plugins/enterprise_search/server/index.ts b/x-pack/plugins/enterprise_search/server/index.ts index dae584a883bd7..6d8a16fd6844a 100644 --- a/x-pack/plugins/enterprise_search/server/index.ts +++ b/x-pack/plugins/enterprise_search/server/index.ts @@ -16,7 +16,6 @@ export const plugin = (initializerContext: PluginInitializerContext) => { export const configSchema = schema.object({ host: schema.maybe(schema.string()), - enabled: schema.boolean({ defaultValue: true }), accessCheckTimeout: schema.number({ defaultValue: 5000 }), accessCheckTimeoutWarning: schema.number({ defaultValue: 300 }), ssl: schema.object({ @@ -37,5 +36,4 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { host: true, }, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/fleet/server/index.ts b/x-pack/plugins/fleet/server/index.ts index cc754b87686e6..9ce361503ddf3 100644 --- a/x-pack/plugins/fleet/server/index.ts +++ b/x-pack/plugins/fleet/server/index.ts @@ -43,8 +43,7 @@ export const config: PluginConfigDescriptor = { epm: true, agents: true, }, - deprecations: ({ deprecate, renameFromRoot, unused, unusedFromRoot }) => [ - deprecate('enabled', '8.0.0'), + deprecations: ({ renameFromRoot, unused, unusedFromRoot }) => [ // Fleet plugin was named ingestManager before renameFromRoot('xpack.ingestManager.enabled', 'xpack.fleet.enabled'), renameFromRoot('xpack.ingestManager.registryUrl', 'xpack.fleet.registryUrl'), @@ -103,7 +102,6 @@ export const config: PluginConfigDescriptor = { }, ], schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), registryUrl: schema.maybe(schema.uri({ scheme: ['http', 'https'] })), registryProxyUrl: schema.maybe(schema.uri({ scheme: ['http', 'https'] })), agents: schema.object({ diff --git a/x-pack/plugins/graph/config.ts b/x-pack/plugins/graph/config.ts index d1a84246172b7..44cd9cb32e263 100644 --- a/x-pack/plugins/graph/config.ts +++ b/x-pack/plugins/graph/config.ts @@ -8,7 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), savePolicy: schema.oneOf( [ schema.literal('none'), diff --git a/x-pack/plugins/graph/server/index.ts b/x-pack/plugins/graph/server/index.ts index 528e122da9a4d..10ddca631a898 100644 --- a/x-pack/plugins/graph/server/index.ts +++ b/x-pack/plugins/graph/server/index.ts @@ -18,5 +18,4 @@ export const config: PluginConfigDescriptor = { savePolicy: true, }, schema: configSchema, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/index_lifecycle_management/server/config.ts b/x-pack/plugins/index_lifecycle_management/server/config.ts index f3fdf59cec55b..10a6af24ea920 100644 --- a/x-pack/plugins/index_lifecycle_management/server/config.ts +++ b/x-pack/plugins/index_lifecycle_management/server/config.ts @@ -8,7 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/index_lifecycle_management/server/index.ts b/x-pack/plugins/index_lifecycle_management/server/index.ts index 1f8b01913fd3e..e90518dbfa357 100644 --- a/x-pack/plugins/index_lifecycle_management/server/index.ts +++ b/x-pack/plugins/index_lifecycle_management/server/index.ts @@ -17,5 +17,4 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/index_management/server/config.ts b/x-pack/plugins/index_management/server/config.ts deleted file mode 100644 index 0a314c7654b16..0000000000000 --- a/x-pack/plugins/index_management/server/config.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; - -export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), -}); - -export type IndexManagementConfig = TypeOf; diff --git a/x-pack/plugins/index_management/server/index.ts b/x-pack/plugins/index_management/server/index.ts index 14b67e2ffd581..d5aebd3934dcf 100644 --- a/x-pack/plugins/index_management/server/index.ts +++ b/x-pack/plugins/index_management/server/index.ts @@ -5,20 +5,13 @@ * 2.0. */ -import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; +import { PluginInitializerContext } from 'src/core/server'; import { IndexMgmtServerPlugin } from './plugin'; -import { configSchema } from './config'; export const plugin = (context: PluginInitializerContext) => new IndexMgmtServerPlugin(context); -export const config: PluginConfigDescriptor = { - schema: configSchema, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], -}; - /** @public */ export { Dependencies } from './types'; export { IndexManagementPluginSetup } from './plugin'; export { Index, LegacyTemplateSerialized } from '../common'; -export { IndexManagementConfig } from './config'; diff --git a/x-pack/plugins/infra/server/plugin.ts b/x-pack/plugins/infra/server/plugin.ts index b77b81cf41ee1..d1ea60dd23dfc 100644 --- a/x-pack/plugins/infra/server/plugin.ts +++ b/x-pack/plugins/infra/server/plugin.ts @@ -43,7 +43,6 @@ import { RulesService } from './services/rules'; export const config: PluginConfigDescriptor = { schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), inventory: schema.object({ compositeSize: schema.number({ defaultValue: 2000 }), }), @@ -68,7 +67,6 @@ export const config: PluginConfigDescriptor = { }) ), }), - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; export type InfraConfig = TypeOf; diff --git a/x-pack/plugins/lens/config.ts b/x-pack/plugins/lens/config.ts deleted file mode 100644 index 56e97d1be7b80..0000000000000 --- a/x-pack/plugins/lens/config.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; - -export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), -}); - -export type ConfigSchema = TypeOf; diff --git a/x-pack/plugins/lens/server/index.ts b/x-pack/plugins/lens/server/index.ts index e2117506e9b72..a87cd3b2d5fad 100644 --- a/x-pack/plugins/lens/server/index.ts +++ b/x-pack/plugins/lens/server/index.ts @@ -8,19 +8,12 @@ // TODO: https://github.com/elastic/kibana/issues/110891 /* eslint-disable @kbn/eslint/no_export_all */ -import { PluginInitializerContext, PluginConfigDescriptor } from 'kibana/server'; +import { PluginInitializerContext } from 'kibana/server'; import { LensServerPlugin } from './plugin'; export type { LensServerPluginSetup } from './plugin'; export * from './plugin'; export * from './migrations/types'; -import { configSchema, ConfigSchema } from '../config'; - -export const config: PluginConfigDescriptor = { - schema: configSchema, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], -}; - export const plugin = (initializerContext: PluginInitializerContext) => new LensServerPlugin(initializerContext); diff --git a/x-pack/plugins/license_management/server/config.ts b/x-pack/plugins/license_management/server/config.ts index 0e4de29b718be..0bdedea309b14 100644 --- a/x-pack/plugins/license_management/server/config.ts +++ b/x-pack/plugins/license_management/server/config.ts @@ -8,7 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/license_management/server/index.ts b/x-pack/plugins/license_management/server/index.ts index e78ffe07b50c0..7a24845c981e9 100644 --- a/x-pack/plugins/license_management/server/index.ts +++ b/x-pack/plugins/license_management/server/index.ts @@ -17,5 +17,4 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/lists/server/config.mock.ts b/x-pack/plugins/lists/server/config.mock.ts index e7c4a4ecee4ab..98d59ef1c2a4d 100644 --- a/x-pack/plugins/lists/server/config.mock.ts +++ b/x-pack/plugins/lists/server/config.mock.ts @@ -21,7 +21,6 @@ export const getConfigMock = (): Partial => ({ }); export const getConfigMockDecoded = (): ConfigType => ({ - enabled: true, importBufferSize: IMPORT_BUFFER_SIZE, importTimeout: IMPORT_TIMEOUT, listIndex: LIST_INDEX, diff --git a/x-pack/plugins/lists/server/config.ts b/x-pack/plugins/lists/server/config.ts index c19639944b1b6..0bb070da05137 100644 --- a/x-pack/plugins/lists/server/config.ts +++ b/x-pack/plugins/lists/server/config.ts @@ -8,7 +8,6 @@ import { TypeOf, schema } from '@kbn/config-schema'; export const ConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), importBufferSize: schema.number({ defaultValue: 1000, min: 1 }), importTimeout: schema.duration({ defaultValue: '5m', diff --git a/x-pack/plugins/lists/server/index.ts b/x-pack/plugins/lists/server/index.ts index 7e1283927aa86..772a8cbe7ec35 100644 --- a/x-pack/plugins/lists/server/index.ts +++ b/x-pack/plugins/lists/server/index.ts @@ -20,7 +20,6 @@ export { ExceptionListClient } from './services/exception_lists/exception_list_c export type { ListPluginSetup, ListsApiRequestHandlerContext } from './types'; export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: ConfigSchema, }; export const plugin = (initializerContext: PluginInitializerContext): ListPlugin => diff --git a/x-pack/plugins/lists/server/services/lists/list_client.mock.ts b/x-pack/plugins/lists/server/services/lists/list_client.mock.ts index 08c14534ac345..f33e6bcbb1143 100644 --- a/x-pack/plugins/lists/server/services/lists/list_client.mock.ts +++ b/x-pack/plugins/lists/server/services/lists/list_client.mock.ts @@ -66,7 +66,6 @@ export class ListClientMock extends ListClient { export const getListClientMock = (): ListClient => { const mock = new ListClientMock({ config: { - enabled: true, importBufferSize: IMPORT_BUFFER_SIZE, importTimeout: IMPORT_TIMEOUT, listIndex: LIST_INDEX, diff --git a/x-pack/plugins/logstash/server/index.ts b/x-pack/plugins/logstash/server/index.ts index 33f3777297f63..2d2ad27bb2fd1 100644 --- a/x-pack/plugins/logstash/server/index.ts +++ b/x-pack/plugins/logstash/server/index.ts @@ -5,15 +5,7 @@ * 2.0. */ -import { schema } from '@kbn/config-schema'; -import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; +import { PluginInitializerContext } from 'src/core/server'; import { LogstashPlugin } from './plugin'; export const plugin = (context: PluginInitializerContext) => new LogstashPlugin(context); - -export const config: PluginConfigDescriptor = { - schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - }), - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], -}; diff --git a/x-pack/plugins/maps/config.ts b/x-pack/plugins/maps/config.ts index 3dcae8f94e844..10e7ee75fcecf 100644 --- a/x-pack/plugins/maps/config.ts +++ b/x-pack/plugins/maps/config.ts @@ -8,13 +8,11 @@ import { schema, TypeOf } from '@kbn/config-schema'; export interface MapsConfigType { - enabled: boolean; showMapsInspectorAdapter: boolean; preserveDrawingBuffer: boolean; } export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), // flag used in functional testing showMapsInspectorAdapter: schema.boolean({ defaultValue: false }), // flag used in functional testing diff --git a/x-pack/plugins/maps/server/index.ts b/x-pack/plugins/maps/server/index.ts index bfb8745c4ba6f..e00951610bbed 100644 --- a/x-pack/plugins/maps/server/index.ts +++ b/x-pack/plugins/maps/server/index.ts @@ -17,13 +17,11 @@ export const config: PluginConfigDescriptor = { // exposeToBrowser specifies kibana.yml settings to expose to the browser // the value `true` in this context signals configuration is exposed to browser exposeToBrowser: { - enabled: true, showMapsInspectorAdapter: true, preserveDrawingBuffer: true, }, schema: configSchema, - deprecations: ({ deprecate }) => [ - deprecate('enabled', '8.0.0'), + deprecations: () => [ ( completeConfig: Record, rootPath: string, diff --git a/x-pack/plugins/maps/server/plugin.ts b/x-pack/plugins/maps/server/plugin.ts index 88e3dd6096654..8768580089f31 100644 --- a/x-pack/plugins/maps/server/plugin.ts +++ b/x-pack/plugins/maps/server/plugin.ts @@ -138,15 +138,6 @@ export class MapsPlugin implements Plugin { const { usageCollection, home, licensing, features, mapsEms } = plugins; const mapsEmsConfig = mapsEms.config; const config$ = this._initializerContext.config.create(); - const currentConfig = this._initializerContext.config.get(); - - // @ts-ignore - const mapsEnabled = currentConfig.enabled; - // TODO: Consider dynamic way to disable maps app on config change - if (!mapsEnabled) { - this._logger.warn('Maps app disabled by configuration'); - return; - } let isEnterprisePlus = false; let lastLicenseId: string | undefined; diff --git a/x-pack/plugins/metrics_entities/server/config.ts b/x-pack/plugins/metrics_entities/server/config.ts deleted file mode 100644 index 31be256611803..0000000000000 --- a/x-pack/plugins/metrics_entities/server/config.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { TypeOf, schema } from '@kbn/config-schema'; - -export const ConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: false }), -}); - -export type ConfigType = TypeOf; diff --git a/x-pack/plugins/metrics_entities/server/index.ts b/x-pack/plugins/metrics_entities/server/index.ts index c8f9d81347bdb..e61dc8b7dc642 100644 --- a/x-pack/plugins/metrics_entities/server/index.ts +++ b/x-pack/plugins/metrics_entities/server/index.ts @@ -5,18 +5,13 @@ * 2.0. */ -import { PluginConfigDescriptor, PluginInitializerContext } from '../../../../src/core/server'; +import { PluginInitializerContext } from '../../../../src/core/server'; -import { ConfigSchema } from './config'; import { MetricsEntitiesPlugin } from './plugin'; // This exports static code and TypeScript types, // as well as, Kibana Platform `plugin()` initializer. -export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], - schema: ConfigSchema, -}; export const plugin = (initializerContext: PluginInitializerContext): MetricsEntitiesPlugin => { return new MetricsEntitiesPlugin(initializerContext); }; diff --git a/x-pack/plugins/monitoring/public/plugin.ts b/x-pack/plugins/monitoring/public/plugin.ts index aee5072947531..4f9b1bac83ab1 100644 --- a/x-pack/plugins/monitoring/public/plugin.ts +++ b/x-pack/plugins/monitoring/public/plugin.ts @@ -57,7 +57,7 @@ export class MonitoringPlugin }); const monitoring = this.initializerContext.config.get(); - if (!monitoring.ui.enabled || !monitoring.enabled) { + if (!monitoring.ui.enabled) { return false; } diff --git a/x-pack/plugins/monitoring/server/config.test.ts b/x-pack/plugins/monitoring/server/config.test.ts index f4604903e0068..8dd1866c274c9 100644 --- a/x-pack/plugins/monitoring/server/config.test.ts +++ b/x-pack/plugins/monitoring/server/config.test.ts @@ -40,7 +40,6 @@ describe('config schema', () => { }, "enabled": true, }, - "enabled": true, "kibana": Object { "collection": Object { "enabled": true, diff --git a/x-pack/plugins/monitoring/server/config.ts b/x-pack/plugins/monitoring/server/config.ts index ddbfd480a9f4e..7b66b35d658cc 100644 --- a/x-pack/plugins/monitoring/server/config.ts +++ b/x-pack/plugins/monitoring/server/config.ts @@ -22,7 +22,6 @@ export const monitoringElasticsearchConfigSchema = elasticsearchConfigSchema.ext }); export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), debug_mode: schema.boolean({ defaultValue: false }), diff --git a/x-pack/plugins/monitoring/server/deprecations.ts b/x-pack/plugins/monitoring/server/deprecations.ts index 3072e024450d0..7c3d3e3baf58a 100644 --- a/x-pack/plugins/monitoring/server/deprecations.ts +++ b/x-pack/plugins/monitoring/server/deprecations.ts @@ -18,12 +18,10 @@ import { CLUSTER_ALERTS_ADDRESS_CONFIG_KEY } from '../common/constants'; * @return {Array} array of rename operations and callback function for rename logging */ export const deprecations = ({ - deprecate, rename, renameFromRoot, }: ConfigDeprecationFactory): ConfigDeprecation[] => { return [ - deprecate('enabled', '8.0.0'), // This order matters. The "blanket rename" needs to happen at the end renameFromRoot('xpack.monitoring.max_bucket_size', 'monitoring.ui.max_bucket_size'), renameFromRoot('xpack.monitoring.min_interval_seconds', 'monitoring.ui.min_interval_seconds'), diff --git a/x-pack/plugins/monitoring/server/index.ts b/x-pack/plugins/monitoring/server/index.ts index 97e572d15327c..63cc61e503917 100644 --- a/x-pack/plugins/monitoring/server/index.ts +++ b/x-pack/plugins/monitoring/server/index.ts @@ -20,7 +20,6 @@ export const config: PluginConfigDescriptor> = { schema: configSchema, deprecations, exposeToBrowser: { - enabled: true, ui: true, kibana: true, }, diff --git a/x-pack/plugins/observability/server/index.ts b/x-pack/plugins/observability/server/index.ts index 53c3ecb23546c..1e811e0a5278c 100644 --- a/x-pack/plugins/observability/server/index.ts +++ b/x-pack/plugins/observability/server/index.ts @@ -24,7 +24,6 @@ export const config: PluginConfigDescriptor = { unsafe: true, }, schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), annotations: schema.object({ enabled: schema.boolean({ defaultValue: true }), index: schema.string({ defaultValue: 'observability-annotations' }), @@ -34,7 +33,6 @@ export const config: PluginConfigDescriptor = { cases: schema.object({ enabled: schema.boolean({ defaultValue: false }) }), }), }), - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; export type ObservabilityConfig = TypeOf; diff --git a/x-pack/plugins/osquery/public/plugin.ts b/x-pack/plugins/osquery/public/plugin.ts index 8555997d61787..86a1f89f738b6 100644 --- a/x-pack/plugins/osquery/public/plugin.ts +++ b/x-pack/plugins/osquery/public/plugin.ts @@ -37,18 +37,6 @@ export class OsqueryPlugin implements Plugin(); - - if (!config.enabled) { - return {}; - } - const storage = this.storage; const kibanaVersion = this.kibanaVersion; // Register an application into the side navigation menu @@ -78,18 +66,6 @@ export class OsqueryPlugin implements Plugin(); - - if (!config.enabled) { - return {}; - } - if (plugins.fleet) { const { registerExtension } = plugins.fleet; diff --git a/x-pack/plugins/osquery/server/config.ts b/x-pack/plugins/osquery/server/config.ts index 3ec9213ae6d60..1fd4b5dbe5ac2 100644 --- a/x-pack/plugins/osquery/server/config.ts +++ b/x-pack/plugins/osquery/server/config.ts @@ -8,7 +8,6 @@ import { TypeOf, schema } from '@kbn/config-schema'; export const ConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), actionEnabled: schema.boolean({ defaultValue: false }), savedQueries: schema.boolean({ defaultValue: true }), packs: schema.boolean({ defaultValue: false }), diff --git a/x-pack/plugins/osquery/server/index.ts b/x-pack/plugins/osquery/server/index.ts index 385515c285093..5deec805cc282 100644 --- a/x-pack/plugins/osquery/server/index.ts +++ b/x-pack/plugins/osquery/server/index.ts @@ -10,10 +10,8 @@ import { OsqueryPlugin } from './plugin'; import { ConfigSchema, ConfigType } from './config'; export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: ConfigSchema, exposeToBrowser: { - enabled: true, actionEnabled: true, savedQueries: true, packs: true, diff --git a/x-pack/plugins/osquery/server/plugin.ts b/x-pack/plugins/osquery/server/plugin.ts index ff8483fdb385a..420fc429f97f4 100644 --- a/x-pack/plugins/osquery/server/plugin.ts +++ b/x-pack/plugins/osquery/server/plugin.ts @@ -205,10 +205,6 @@ export class OsqueryPlugin implements Plugin; export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { ui: true, diff --git a/x-pack/plugins/rollup/server/config.ts b/x-pack/plugins/rollup/server/config.ts deleted file mode 100644 index d20b317422107..0000000000000 --- a/x-pack/plugins/rollup/server/config.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { schema, TypeOf } from '@kbn/config-schema'; - -export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), -}); - -export type RollupConfig = TypeOf; diff --git a/x-pack/plugins/rollup/server/index.ts b/x-pack/plugins/rollup/server/index.ts index e77e0e6f15d72..948153e4ed51b 100644 --- a/x-pack/plugins/rollup/server/index.ts +++ b/x-pack/plugins/rollup/server/index.ts @@ -5,14 +5,8 @@ * 2.0. */ -import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; +import { PluginInitializerContext } from 'src/core/server'; import { RollupPlugin } from './plugin'; -import { configSchema, RollupConfig } from './config'; export const plugin = (pluginInitializerContext: PluginInitializerContext) => new RollupPlugin(pluginInitializerContext); - -export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], - schema: configSchema, -}; diff --git a/x-pack/plugins/rule_registry/server/config.ts b/x-pack/plugins/rule_registry/server/config.ts index f112a99e59eaa..078498864f8e8 100644 --- a/x-pack/plugins/rule_registry/server/config.ts +++ b/x-pack/plugins/rule_registry/server/config.ts @@ -9,12 +9,8 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { PluginConfigDescriptor } from 'src/core/server'; export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate, unused }) => [ - deprecate('enabled', '8.0.0'), - unused('unsafe.indexUpgrade.enabled'), - ], + deprecations: ({ deprecate, unused }) => [unused('unsafe.indexUpgrade.enabled')], schema: schema.object({ - enabled: schema.boolean({ defaultValue: true }), write: schema.object({ enabled: schema.boolean({ defaultValue: false }), }), diff --git a/x-pack/plugins/saved_objects_tagging/server/config.ts b/x-pack/plugins/saved_objects_tagging/server/config.ts index 183779aa6f229..9d676576a03c3 100644 --- a/x-pack/plugins/saved_objects_tagging/server/config.ts +++ b/x-pack/plugins/saved_objects_tagging/server/config.ts @@ -9,14 +9,12 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { PluginConfigDescriptor } from 'kibana/server'; const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), cache_refresh_interval: schema.duration({ defaultValue: '15m' }), }); export type SavedObjectsTaggingConfigType = TypeOf; export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { cache_refresh_interval: true, diff --git a/x-pack/plugins/security_solution/server/config.ts b/x-pack/plugins/security_solution/server/config.ts index bc5b43c6d25fd..e0b8ad883f4a2 100644 --- a/x-pack/plugins/security_solution/server/config.ts +++ b/x-pack/plugins/security_solution/server/config.ts @@ -17,7 +17,6 @@ import { UnderlyingLogClient } from './lib/detection_engine/rule_execution_log/t const allowedExperimentalValues = getExperimentalAllowedValues(); export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), maxRuleImportExportSize: schema.number({ defaultValue: 10000 }), maxRuleImportPayloadBytes: schema.number({ defaultValue: 10485760 }), maxTimelineImportExportSize: schema.number({ defaultValue: 10000 }), diff --git a/x-pack/plugins/security_solution/server/index.ts b/x-pack/plugins/security_solution/server/index.ts index b72a21c0da643..7e3da726f6ebe 100644 --- a/x-pack/plugins/security_solution/server/index.ts +++ b/x-pack/plugins/security_solution/server/index.ts @@ -20,8 +20,7 @@ export const config: PluginConfigDescriptor = { enableExperimental: true, }, schema: configSchema, - deprecations: ({ deprecate, renameFromRoot }) => [ - deprecate('enabled', '8.0.0'), + deprecations: ({ renameFromRoot }) => [ renameFromRoot('xpack.siem.enabled', 'xpack.securitySolution.enabled'), renameFromRoot( 'xpack.siem.maxRuleImportExportSize', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts index 2f401d27813ac..8417115fb1896 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/__mocks__/index.ts @@ -16,7 +16,6 @@ import { UnderlyingLogClient } from '../../rule_execution_log/types'; export { requestMock, requestContextMock, responseMock, serverMock }; export const createMockConfig = (): ConfigType => ({ - enabled: true, [SIGNALS_INDEX_KEY]: DEFAULT_SIGNALS_INDEX, maxRuleImportExportSize: 10000, maxRuleImportPayloadBytes: 10485760, diff --git a/x-pack/plugins/snapshot_restore/server/config.ts b/x-pack/plugins/snapshot_restore/server/config.ts index f0ca416ef2032..ce5eff832756e 100644 --- a/x-pack/plugins/snapshot_restore/server/config.ts +++ b/x-pack/plugins/snapshot_restore/server/config.ts @@ -8,7 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), slm_ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/snapshot_restore/server/index.ts b/x-pack/plugins/snapshot_restore/server/index.ts index e10bffd6073d2..d85d03923df1f 100644 --- a/x-pack/plugins/snapshot_restore/server/index.ts +++ b/x-pack/plugins/snapshot_restore/server/index.ts @@ -12,7 +12,6 @@ import { configSchema, SnapshotRestoreConfig } from './config'; export const plugin = (ctx: PluginInitializerContext) => new SnapshotRestoreServerPlugin(ctx); export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { slm_ui: true, diff --git a/x-pack/plugins/snapshot_restore/server/plugin.ts b/x-pack/plugins/snapshot_restore/server/plugin.ts index 4414e3735959b..ce01aa25c97d8 100644 --- a/x-pack/plugins/snapshot_restore/server/plugin.ts +++ b/x-pack/plugins/snapshot_restore/server/plugin.ts @@ -34,10 +34,6 @@ export class SnapshotRestoreServerPlugin implements Plugin ): void { const pluginConfig = this.context.config.get(); - if (!pluginConfig.enabled) { - return; - } - const router = http.createRouter(); this.license.setup( diff --git a/x-pack/plugins/timelines/public/index.ts b/x-pack/plugins/timelines/public/index.ts index 800f1958f9c94..70f7185e9c486 100644 --- a/x-pack/plugins/timelines/public/index.ts +++ b/x-pack/plugins/timelines/public/index.ts @@ -10,8 +10,6 @@ import { createContext } from 'react'; -import { PluginInitializerContext } from '../../../../src/core/public'; - import { TimelinesPlugin } from './plugin'; import type { StatefulEventContextType } from './types'; export * as tGridActions from './store/t_grid/actions'; @@ -63,8 +61,8 @@ export { StatefulFieldsBrowser } from './components/t_grid/toolbar/fields_browse export { useStatusBulkActionItems } from './hooks/use_status_bulk_action_items'; // This exports static code and TypeScript types, // as well as, Kibana Platform `plugin()` initializer. -export function plugin(initializerContext: PluginInitializerContext) { - return new TimelinesPlugin(initializerContext); +export function plugin() { + return new TimelinesPlugin(); } export const StatefulEventContext = createContext(null); diff --git a/x-pack/plugins/timelines/public/plugin.ts b/x-pack/plugins/timelines/public/plugin.ts index acb7b26d0cf84..2151ff0bc5e9b 100644 --- a/x-pack/plugins/timelines/public/plugin.ts +++ b/x-pack/plugins/timelines/public/plugin.ts @@ -8,12 +8,7 @@ import { Store } from 'redux'; import { Storage } from '../../../../src/plugins/kibana_utils/public'; -import type { - CoreSetup, - Plugin, - PluginInitializerContext, - CoreStart, -} from '../../../../src/core/public'; +import type { CoreSetup, Plugin, CoreStart } from '../../../../src/core/public'; import type { LastUpdatedAtProps, LoadingPanelProps, FieldBrowserProps } from './components'; import { getLastUpdatedLazy, @@ -32,17 +27,12 @@ import { useAddToTimeline, useAddToTimelineSensor } from './hooks/use_add_to_tim import { getHoverActions } from './components/hover_actions'; export class TimelinesPlugin implements Plugin { - constructor(private readonly initializerContext: PluginInitializerContext) {} private _store: Store | undefined; private _storage = new Storage(localStorage); public setup(core: CoreSetup) {} public start(core: CoreStart, { data }: TimelinesStartPlugins): TimelinesUIStart { - const config = this.initializerContext.config.get<{ enabled: boolean }>(); - if (!config.enabled) { - return {} as TimelinesUIStart; - } return { getHoverActions: () => { return getHoverActions(this._store); diff --git a/x-pack/plugins/timelines/server/config.ts b/x-pack/plugins/timelines/server/config.ts deleted file mode 100644 index 958c673333873..0000000000000 --- a/x-pack/plugins/timelines/server/config.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { TypeOf, schema } from '@kbn/config-schema'; - -export const ConfigSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), -}); - -export type ConfigType = TypeOf; diff --git a/x-pack/plugins/timelines/server/index.ts b/x-pack/plugins/timelines/server/index.ts index 229a257d8f549..ef18226a0e60c 100644 --- a/x-pack/plugins/timelines/server/index.ts +++ b/x-pack/plugins/timelines/server/index.ts @@ -5,17 +5,9 @@ * 2.0. */ -import { PluginInitializerContext, PluginConfigDescriptor } from '../../../../src/core/server'; +import { PluginInitializerContext } from '../../../../src/core/server'; import { TimelinesPlugin } from './plugin'; -import { ConfigSchema, ConfigType } from './config'; -export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], - schema: ConfigSchema, - exposeToBrowser: { - enabled: true, - }, -}; export function plugin(initializerContext: PluginInitializerContext) { return new TimelinesPlugin(initializerContext); } diff --git a/x-pack/plugins/upgrade_assistant/common/config.ts b/x-pack/plugins/upgrade_assistant/common/config.ts index e74fe5cc1bf16..bce28e55ba913 100644 --- a/x-pack/plugins/upgrade_assistant/common/config.ts +++ b/x-pack/plugins/upgrade_assistant/common/config.ts @@ -8,7 +8,6 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ - enabled: schema.boolean({ defaultValue: true }), /* * This will default to true up until the last minor before the next major. * In readonly mode, the user will not be able to perform any actions in the UI diff --git a/x-pack/plugins/upgrade_assistant/server/index.ts b/x-pack/plugins/upgrade_assistant/server/index.ts index 5591276b2fa34..6981b6f93da13 100644 --- a/x-pack/plugins/upgrade_assistant/server/index.ts +++ b/x-pack/plugins/upgrade_assistant/server/index.ts @@ -14,7 +14,6 @@ export const plugin = (ctx: PluginInitializerContext) => { }; export const config: PluginConfigDescriptor = { - deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { readonly: true, From ce8e195783eb66135a1f36d05814e8114125e1e1 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 29 Sep 2021 21:31:18 -0600 Subject: [PATCH 03/20] Remove docker env vars. --- .../resources/base/bin/kibana-docker | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker index 4a8f9df4c4044..a27e33eb67f77 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker @@ -23,7 +23,6 @@ kibana_vars=( apm_oss.sourcemapIndices apm_oss.spanIndices apm_oss.transactionIndices - console.enabled console.proxyConfig console.proxyFilter csp.strict @@ -66,7 +65,6 @@ kibana_vars=( elasticsearch.username enterpriseSearch.accessCheckTimeout enterpriseSearch.accessCheckTimeoutWarning - enterpriseSearch.enabled enterpriseSearch.host externalUrl.policy i18n.locale @@ -102,7 +100,6 @@ kibana_vars=( migrations.scrollDuration migrations.skip monitoring.cluster_alerts.email_notifications.email_address - monitoring.enabled monitoring.kibana.collection.enabled monitoring.kibana.collection.interval monitoring.ui.container.elasticsearch.enabled @@ -185,7 +182,6 @@ kibana_vars=( tilemap.options.minZoom tilemap.options.subdomains tilemap.url - url_drilldown.enabled vega.enableExternalUrls vis_type_vega.enableExternalUrls xpack.actions.allowedHosts @@ -210,7 +206,6 @@ kibana_vars=( xpack.alerts.healthCheck.interval xpack.alerts.invalidateApiKeysTask.interval xpack.alerts.invalidateApiKeysTask.removalDelay - xpack.apm.enabled xpack.apm.indices.error xpack.apm.indices.metric xpack.apm.indices.onboarding @@ -230,7 +225,6 @@ kibana_vars=( xpack.banners.placement xpack.banners.textColor xpack.banners.textContent - xpack.canvas.enabled xpack.code.disk.thresholdEnabled xpack.code.disk.watermarkLow xpack.code.indexRepoFrequencyMs @@ -262,14 +256,10 @@ kibana_vars=( xpack.fleet.agents.fleet_server.hosts xpack.fleet.agents.kibana.host xpack.fleet.agents.tlsCheckDisabled - xpack.fleet.enabled xpack.fleet.packages xpack.fleet.registryUrl xpack.graph.canEditDrillDownUrls - xpack.graph.enabled xpack.graph.savePolicy - xpack.grokdebugger.enabled - xpack.infra.enabled xpack.infra.query.partitionFactor xpack.infra.query.partitionSize xpack.infra.sources.default.fields.container @@ -282,13 +272,9 @@ kibana_vars=( xpack.infra.sources.default.metricAlias xpack.ingestManager.fleet.tlsCheckDisabled xpack.ingestManager.registryUrl - xpack.license_management.enabled - xpack.maps.enabled - xpack.ml.enabled xpack.observability.annotations.index xpack.observability.unsafe.alertingExperience.enabled xpack.observability.unsafe.cases.enabled - xpack.painless_lab.enabled xpack.reporting.capture.browser.autoDownload xpack.reporting.capture.browser.chromium.disableSandbox xpack.reporting.capture.browser.chromium.inspect @@ -334,9 +320,7 @@ kibana_vars=( xpack.reporting.queue.timeout xpack.reporting.roles.allow xpack.reporting.roles.enabled - xpack.rollup.enabled xpack.ruleRegistry.write.enabled - xpack.searchprofiler.enabled xpack.security.audit.appender.fileName xpack.security.audit.appender.layout.highlight xpack.security.audit.appender.layout.pattern From d7a2516a864e89fa8dd066ba928a24b06186b251 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 29 Sep 2021 22:14:32 -0600 Subject: [PATCH 04/20] Update config service to stop implicitly adding an 'enabled' config. --- .../kbn-config/src/config_service.test.ts | 86 +++---------------- packages/kbn-config/src/config_service.ts | 44 +--------- packages/kbn-config/src/deprecation/types.ts | 4 +- 3 files changed, 19 insertions(+), 115 deletions(-) diff --git a/packages/kbn-config/src/config_service.test.ts b/packages/kbn-config/src/config_service.test.ts index 4a8164b100626..aafc9556e89e3 100644 --- a/packages/kbn-config/src/config_service.test.ts +++ b/packages/kbn-config/src/config_service.test.ts @@ -261,42 +261,6 @@ test('correctly passes context', async () => { expect(await value$.pipe(first()).toPromise()).toMatchSnapshot(); }); -test('handles enabled path, but only marks the enabled path as used', async () => { - const initialConfig = { - pid: { - enabled: true, - file: '/some/file.pid', - }, - }; - - const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); - const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); - - const isEnabled = await configService.isEnabledAtPath('pid'); - expect(isEnabled).toBe(true); - - const unusedPaths = await configService.getUnusedPaths(); - expect(unusedPaths).toEqual(['pid.file']); -}); - -test('handles enabled path when path is array', async () => { - const initialConfig = { - pid: { - enabled: true, - file: '/some/file.pid', - }, - }; - - const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); - const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); - - const isEnabled = await configService.isEnabledAtPath(['pid']); - expect(isEnabled).toBe(true); - - const unusedPaths = await configService.getUnusedPaths(); - expect(unusedPaths).toEqual(['pid.file']); -}); - test('handles disabled path and marks config as used', async () => { const initialConfig = { pid: { @@ -308,6 +272,14 @@ test('handles disabled path and marks config as used', async () => { const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); + configService.setSchema( + 'pid', + schema.object({ + enabled: schema.boolean({ defaultValue: false }), + file: schema.string(), + }) + ); + const isEnabled = await configService.isEnabledAtPath('pid'); expect(isEnabled).toBe(false); @@ -338,7 +310,7 @@ test('does not throw if schema does not define "enabled" schema', async () => { expect(value.enabled).toBe(undefined); }); -test('treats config as enabled if config path is not present in config', async () => { +test('treats config as enabled if config path is not present in schema', async () => { const initialConfig = {}; const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); @@ -351,10 +323,10 @@ test('treats config as enabled if config path is not present in config', async ( expect(unusedPaths).toEqual([]); }); -test('read "enabled" even if its schema is not present', async () => { +test('does not read "enabled" if its schema is not present', async () => { const initialConfig = { foo: { - enabled: true, + enabled: false, // should be ignored as it is not in schema }, }; @@ -365,38 +337,6 @@ test('read "enabled" even if its schema is not present', async () => { expect(isEnabled).toBe(true); }); -test('logs deprecation if schema is not present and "enabled" is used', async () => { - const initialConfig = { - foo: { - enabled: true, - }, - }; - - const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); - const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); - - await configService.isEnabledAtPath('foo'); - expect(configService.getHandledDeprecatedConfigs()).toMatchInlineSnapshot(` - Array [ - Array [ - "foo", - Array [ - Object { - "configPath": "foo.enabled", - "correctiveActions": Object { - "manualSteps": Array [ - "Remove \\"foo.enabled\\" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.", - ], - }, - "message": "Configuring \\"foo.enabled\\" is deprecated and will be removed in 8.0.0.", - "title": "Setting \\"foo.enabled\\" is deprecated", - }, - ], - ], - ] - `); -}); - test('allows plugins to specify "enabled" flag via validation schema', async () => { const initialConfig = {}; @@ -425,7 +365,7 @@ test('allows plugins to specify "enabled" flag via validation schema', async () expect(await configService.isEnabledAtPath('baz')).toBe(true); }); -test('does not throw during validation is every schema is valid', async () => { +test('does not throw during validation if every schema is valid', async () => { const rawConfig = getRawConfigProvider({ stringKey: 'foo', numberKey: 42 }); const configService = new ConfigService(rawConfig, defaultEnv, logger); @@ -435,7 +375,7 @@ test('does not throw during validation is every schema is valid', async () => { await expect(configService.validate()).resolves.toBeUndefined(); }); -test('throws during validation is any schema is invalid', async () => { +test('throws during validation if any schema is invalid', async () => { const rawConfig = getRawConfigProvider({ stringKey: 123, numberKey: 42 }); const configService = new ConfigService(rawConfig, defaultEnv, logger); diff --git a/packages/kbn-config/src/config_service.ts b/packages/kbn-config/src/config_service.ts index 458acac953497..34293ebfc9b65 100644 --- a/packages/kbn-config/src/config_service.ts +++ b/packages/kbn-config/src/config_service.ts @@ -173,46 +173,17 @@ export class ConfigService { ? await this.atPath<{ enabled?: boolean }>(path).pipe(first()).toPromise() : undefined; - const enabledPath = createPluginEnabledPath(path); - const config = await this.config$.pipe(first()).toPromise(); - - // if plugin hasn't got a config schema, we try to read "enabled" directly - const isEnabled = validatedConfig?.enabled ?? config.get(enabledPath); - - // if we implicitly added an `enabled` config to a plugin without a schema, - // we log a deprecation warning, as this will not be supported in 8.0 - if (validatedConfig?.enabled === undefined && isEnabled !== undefined) { - const deprecationPath = pathToString(enabledPath); - const deprecatedConfigDetails: DeprecatedConfigDetails = { - configPath: deprecationPath, - title: `Setting "${deprecationPath}" is deprecated`, - message: `Configuring "${deprecationPath}" is deprecated and will be removed in 8.0.0.`, - correctiveActions: { - manualSteps: [ - `Remove "${deprecationPath}" from the Kibana config file, CLI flag, or environment variable (in Docker only) before upgrading to 8.0.0.`, - ], - }, - }; - this.deprecationLog.warn(deprecatedConfigDetails.message); - this.markDeprecatedConfigAsHandled(namespace, deprecatedConfigDetails); - } - - // not declared. consider that plugin is enabled by default - if (isEnabled === undefined) { - return true; - } + const isDisabled = validatedConfig?.enabled === false; - if (isEnabled === false) { + if (isDisabled) { // If the plugin is _not_ enabled, we mark the entire plugin path as // handled, as it's expected that it won't be used. this.markAsHandled(path); return false; } - // If plugin enabled we mark the enabled path as handled, as we for example - // can have plugins that don't have _any_ config except for this field, and - // therefore have no reason to try to get the config. - this.markAsHandled(enabledPath); + // If validatedConfig.enabled is undefined or explicitly set to true, + // we consider the plugin is enabled. return true; } @@ -286,13 +257,6 @@ export class ConfigService { } } -const createPluginEnabledPath = (configPath: string | string[]) => { - if (Array.isArray(configPath)) { - return configPath.concat('enabled'); - } - return `${configPath}.enabled`; -}; - const pathToString = (path: ConfigPath) => (Array.isArray(path) ? path.join('.') : path); /** diff --git a/packages/kbn-config/src/deprecation/types.ts b/packages/kbn-config/src/deprecation/types.ts index f5bb240f5cc43..7b1eb4a0ea6c1 100644 --- a/packages/kbn-config/src/deprecation/types.ts +++ b/packages/kbn-config/src/deprecation/types.ts @@ -106,7 +106,7 @@ export interface ConfigDeprecationCommand { * * @example * ```typescript - * const provider: ConfigDeprecationProvider = ({ rename, unused }) => [ + * const provider: ConfigDeprecationProvider = ({ deprecate, rename, unused }) => [ * deprecate('deprecatedKey', '8.0.0'), * rename('oldKey', 'newKey'), * unused('deprecatedKey'), @@ -164,7 +164,7 @@ export interface ConfigDeprecationFactory { * @example * Log a deprecation warning indicating 'myplugin.deprecatedKey' should be removed by `8.0.0` * ```typescript - * const provider: ConfigDeprecationProvider = ({ deprecate }) => [ + * const provider: ConfigDeprecationProvider = ({ deprecateFromRoot }) => [ * deprecateFromRoot('deprecatedKey', '8.0.0'), * ] * ``` From e83aaaf3963bd4ef7cd4f05534b79bec0da2989e Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 30 Sep 2021 11:32:02 -0600 Subject: [PATCH 05/20] Remove functional_vis_wizard test suite. --- x-pack/scripts/functional_tests.js | 1 - .../test/functional_vis_wizard/apps/index.ts | 16 --------- .../apps/visualization_wizard.ts | 35 ------------------- x-pack/test/functional_vis_wizard/config.ts | 29 --------------- .../ftr_provider_context.d.ts | 13 ------- 5 files changed, 94 deletions(-) delete mode 100644 x-pack/test/functional_vis_wizard/apps/index.ts delete mode 100644 x-pack/test/functional_vis_wizard/apps/visualization_wizard.ts delete mode 100644 x-pack/test/functional_vis_wizard/config.ts delete mode 100644 x-pack/test/functional_vis_wizard/ftr_provider_context.d.ts diff --git a/x-pack/scripts/functional_tests.js b/x-pack/scripts/functional_tests.js index f7b978c2b58bd..6cb80d6d4b74d 100644 --- a/x-pack/scripts/functional_tests.js +++ b/x-pack/scripts/functional_tests.js @@ -21,7 +21,6 @@ const alwaysImportedTests = [ require.resolve('../test/functional_embedded/config.ts'), require.resolve('../test/functional_cors/config.ts'), require.resolve('../test/functional_enterprise_search/without_host_configured.config.ts'), - require.resolve('../test/functional_vis_wizard/config.ts'), require.resolve('../test/saved_object_tagging/functional/config.ts'), require.resolve('../test/usage_collection/config.ts'), require.resolve('../test/fleet_functional/config.ts'), diff --git a/x-pack/test/functional_vis_wizard/apps/index.ts b/x-pack/test/functional_vis_wizard/apps/index.ts deleted file mode 100644 index b5073206d863e..0000000000000 --- a/x-pack/test/functional_vis_wizard/apps/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrProviderContext } from '../ftr_provider_context'; - -export default function ({ loadTestFile }: FtrProviderContext) { - describe('Visualization Wizard', function () { - this.tags('ciGroup4'); - - loadTestFile(require.resolve('./visualization_wizard')); - }); -} diff --git a/x-pack/test/functional_vis_wizard/apps/visualization_wizard.ts b/x-pack/test/functional_vis_wizard/apps/visualization_wizard.ts deleted file mode 100644 index 2dc7533468db4..0000000000000 --- a/x-pack/test/functional_vis_wizard/apps/visualization_wizard.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import expect from '@kbn/expect'; -import { FtrProviderContext } from '../ftr_provider_context'; - -export default function ({ getService, getPageObjects }: FtrProviderContext) { - const esArchiver = getService('esArchiver'); - const PageObjects = getPageObjects(['visualize']); - - describe('lens and maps disabled', function () { - before(async function () { - await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional'); - await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/visualize/default'); - }); - - after(async function () { - await esArchiver.unload('x-pack/test/functional/es_archives/logstash_functional'); - await esArchiver.unload('x-pack/test/functional/es_archives/visualize/default'); - }); - - it('should not display lens and maps cards', async function () { - await PageObjects.visualize.navigateToNewVisualization(); - const expectedChartTypes = ['Custom visualization', 'TSVB']; - - // find all the chart types and make sure that maps and lens cards are not there - const chartTypes = (await PageObjects.visualize.getPromotedVisTypes()).sort(); - expect(chartTypes).to.eql(expectedChartTypes); - }); - }); -} diff --git a/x-pack/test/functional_vis_wizard/config.ts b/x-pack/test/functional_vis_wizard/config.ts deleted file mode 100644 index 523b59b6ccd1c..0000000000000 --- a/x-pack/test/functional_vis_wizard/config.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrConfigProviderContext } from '@kbn/test'; - -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const xPackFunctionalConfig = await readConfigFile(require.resolve('../functional/config')); - - return { - // default to the xpack functional config - ...xPackFunctionalConfig.getAll(), - testFiles: [require.resolve('./apps')], - junit: { - reportName: 'X-Pack Visualization Wizard Tests with Lens and Maps disabled', - }, - kbnTestServer: { - ...xPackFunctionalConfig.get('kbnTestServer'), - serverArgs: [ - ...xPackFunctionalConfig.get('kbnTestServer.serverArgs'), - '--xpack.lens.enabled=false', - '--xpack.maps.enabled=false', - ], - }, - }; -} diff --git a/x-pack/test/functional_vis_wizard/ftr_provider_context.d.ts b/x-pack/test/functional_vis_wizard/ftr_provider_context.d.ts deleted file mode 100644 index ab1e999222808..0000000000000 --- a/x-pack/test/functional_vis_wizard/ftr_provider_context.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { GenericFtrProviderContext } from '@kbn/test'; -import { pageObjects } from '../functional/page_objects'; -import { services } from '../functional/services'; - -export type FtrProviderContext = GenericFtrProviderContext; -export { pageObjects }; From 767b35885c8a4eb49f46a4928d6fcc0b358c34bd Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 30 Sep 2021 12:36:11 -0600 Subject: [PATCH 06/20] Remove old configuration from api_integration test config. --- x-pack/test/api_integration/config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/api_integration/config.ts b/x-pack/test/api_integration/config.ts index 9721a1827caf3..3690f661c621c 100644 --- a/x-pack/test/api_integration/config.ts +++ b/x-pack/test/api_integration/config.ts @@ -28,7 +28,6 @@ export async function getApiIntegrationConfig({ readConfigFile }: FtrConfigProvi '--map.proxyElasticMapsServiceInMaps=true', '--xpack.security.session.idleTimeout=3600000', // 1 hour '--telemetry.optIn=true', - '--xpack.fleet.enabled=true', '--xpack.fleet.agents.pollingRequestTimeout=5000', // 5 seconds '--xpack.data_enhanced.search.sessions.enabled=true', // enable WIP send to background UI '--xpack.data_enhanced.search.sessions.notTouchedTimeout=15s', // shorten notTouchedTimeout for quicker testing From 2607fe86dcd3464d3b043fd90cb6301544151892 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 30 Sep 2021 12:36:39 -0600 Subject: [PATCH 07/20] Remove old configuration from case_api_integration test config. --- x-pack/test/case_api_integration/common/config.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/x-pack/test/case_api_integration/common/config.ts b/x-pack/test/case_api_integration/common/config.ts index e6fda129eaa16..2658472a7b84d 100644 --- a/x-pack/test/case_api_integration/common/config.ts +++ b/x-pack/test/case_api_integration/common/config.ts @@ -93,8 +93,6 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) .isDirectory() ); - const casesConfig = ['--xpack.cases.enabled=true']; - return { testFiles: testFiles ? testFiles : [require.resolve('../tests/common')], servers, @@ -117,7 +115,6 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...xPackApiIntegrationTestsConfig.get('kbnTestServer'), serverArgs: [ ...xPackApiIntegrationTestsConfig.get('kbnTestServer.serverArgs'), - ...casesConfig, `--xpack.actions.allowedHosts=${JSON.stringify(['localhost', 'some.non.existent.com'])}`, `--xpack.actions.enabledActionTypes=${JSON.stringify(enabledActionTypes)}`, '--xpack.eventLog.logEntries=true', From 5b636287e51e10fb6f81b4dc05fe0003c29ed569 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 30 Sep 2021 12:37:15 -0600 Subject: [PATCH 08/20] Remove disable-able plugins from detection_engine_api_integration test config. --- .../detection_engine_api_integration/basic/config.ts | 1 - .../detection_engine_api_integration/common/config.ts | 9 ++------- .../security_and_spaces/config.ts | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/x-pack/test/detection_engine_api_integration/basic/config.ts b/x-pack/test/detection_engine_api_integration/basic/config.ts index ead53d3fef129..0c5c7d1649f84 100644 --- a/x-pack/test/detection_engine_api_integration/basic/config.ts +++ b/x-pack/test/detection_engine_api_integration/basic/config.ts @@ -9,7 +9,6 @@ import { createTestConfig } from '../common/config'; // eslint-disable-next-line import/no-default-export export default createTestConfig('basic', { - disabledPlugins: [], license: 'basic', ssl: true, }); diff --git a/x-pack/test/detection_engine_api_integration/common/config.ts b/x-pack/test/detection_engine_api_integration/common/config.ts index eee1f0be5ba37..4fdb23d010ea2 100644 --- a/x-pack/test/detection_engine_api_integration/common/config.ts +++ b/x-pack/test/detection_engine_api_integration/common/config.ts @@ -11,7 +11,6 @@ import { services } from './services'; interface CreateTestConfigOptions { license: string; - disabledPlugins?: string[]; ssl?: boolean; } @@ -33,7 +32,7 @@ const enabledActionTypes = [ ]; export function createTestConfig(name: string, options: CreateTestConfigOptions) { - const { license = 'trial', disabledPlugins = [], ssl = false } = options; + const { license = 'trial', ssl = false } = options; return async ({ readConfigFile }: FtrConfigProviderContext) => { const xPackApiIntegrationTestsConfig = await readConfigFile( @@ -58,10 +57,7 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) ...xPackApiIntegrationTestsConfig.get('esTestCluster'), license, ssl, - serverArgs: [ - `xpack.license.self_generated.type=${license}`, - `xpack.security.enabled=${!disabledPlugins.includes('security')}`, - ], + serverArgs: [`xpack.license.self_generated.type=${license}`], }, kbnTestServer: { ...xPackApiIntegrationTestsConfig.get('kbnTestServer'), @@ -74,7 +70,6 @@ export function createTestConfig(name: string, options: CreateTestConfigOptions) 'testing_ignored.constant', '/testing_regex*/', ])}`, // See tests within the file "ignore_fields.ts" which use these values in "alertIgnoreFields" - ...disabledPlugins.map((key) => `--xpack.${key}.enabled=false`), ...(ssl ? [ `--elasticsearch.hosts=${servers.elasticsearch.protocol}://${servers.elasticsearch.hostname}:${servers.elasticsearch.port}`, diff --git a/x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts b/x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts index 8b7e43945c8a2..78203525b887a 100644 --- a/x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts +++ b/x-pack/test/detection_engine_api_integration/security_and_spaces/config.ts @@ -9,7 +9,6 @@ import { createTestConfig } from '../common/config'; // eslint-disable-next-line import/no-default-export export default createTestConfig('security_and_spaces', { - disabledPlugins: [], license: 'trial', ssl: true, }); From 09c893a3353177979a91ec110bd835f6fd743924 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 30 Sep 2021 12:37:37 -0600 Subject: [PATCH 09/20] Remove old configuration from fleet_functional test config. --- x-pack/test/fleet_functional/config.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/x-pack/test/fleet_functional/config.ts b/x-pack/test/fleet_functional/config.ts index b68fd08b7890f..27fc522f03a36 100644 --- a/x-pack/test/fleet_functional/config.ts +++ b/x-pack/test/fleet_functional/config.ts @@ -29,10 +29,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { }, kbnTestServer: { ...xpackFunctionalConfig.get('kbnTestServer'), - serverArgs: [ - ...xpackFunctionalConfig.get('kbnTestServer.serverArgs'), - '--xpack.fleet.enabled=true', - ], + serverArgs: [...xpackFunctionalConfig.get('kbnTestServer.serverArgs')], }, layout: { fixedHeaderHeight: 200, From 00e6489ef47817fd4f917c6d95c87d3a49ab8139 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 30 Sep 2021 12:39:38 -0600 Subject: [PATCH 10/20] Remove old configuration from plugin_functional test config. --- x-pack/test/plugin_functional/config.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/test/plugin_functional/config.ts b/x-pack/test/plugin_functional/config.ts index 7033836285e3c..8f3c5be04a8bc 100644 --- a/x-pack/test/plugin_functional/config.ts +++ b/x-pack/test/plugin_functional/config.ts @@ -48,7 +48,6 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { KIBANA_ROOT, 'test/plugin_functional/plugins/core_provider_plugin' )}`, - '--xpack.timelines.enabled=true', ...plugins.map((pluginDir) => `--plugin-path=${resolve(__dirname, 'plugins', pluginDir)}`), ], }, From 10d10678cfc61c0d83b9166d230c848886e02fbc Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 30 Sep 2021 12:40:06 -0600 Subject: [PATCH 11/20] Remove old configuration from saved_objects_field_count test config. --- x-pack/test/saved_objects_field_count/config.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/x-pack/test/saved_objects_field_count/config.ts b/x-pack/test/saved_objects_field_count/config.ts index 8144bac35ec7b..7967b6c4f3b9c 100644 --- a/x-pack/test/saved_objects_field_count/config.ts +++ b/x-pack/test/saved_objects_field_count/config.ts @@ -26,14 +26,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { kbnTestServer: { ...kibanaCommonTestsConfig.get('kbnTestServer'), - serverArgs: [ - ...kibanaCommonTestsConfig.get('kbnTestServer.serverArgs'), - // Enable plugins that are disabled by default to include their metrics - // TODO: Find a way to automatically enable all discovered plugins - '--xpack.fleet.enabled=true', - '--xpack.lists.enabled=true', - '--xpack.securitySolution.enabled=true', - ], + serverArgs: [...kibanaCommonTestsConfig.get('kbnTestServer.serverArgs')], }, }; } From aef646bd548c556f7858cb9076fc5d9ad82119b4 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Fri, 1 Oct 2021 16:25:03 -0600 Subject: [PATCH 12/20] Try removing the top-level monitoring/enterpriseSearch configs from FTR. --- test/functional/config.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/functional/config.js b/test/functional/config.js index 97b3d85a8e243..e0195c4dadc8d 100644 --- a/test/functional/config.js +++ b/test/functional/config.js @@ -46,9 +46,7 @@ export default async function ({ readConfigFile }) { // to be re-enabled once kibana/issues/102552 is completed '--xpack.security.enabled=false', - '--monitoring.enabled=false', '--xpack.reporting.enabled=false', - '--enterpriseSearch.enabled=false', ], }, From 8b19bcdf6aaf2933c47404c01dca6130832d3b4d Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Tue, 5 Oct 2021 14:37:43 -0600 Subject: [PATCH 13/20] Add 8.0 breaking changes docs. --- docs/migration/migrate_8_0.asciidoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/migration/migrate_8_0.asciidoc b/docs/migration/migrate_8_0.asciidoc index dc6754fba1ffc..8ba7911f65f15 100644 --- a/docs/migration/migrate_8_0.asciidoc +++ b/docs/migration/migrate_8_0.asciidoc @@ -42,6 +42,15 @@ for example, `logstash-*`. *Impact:* Users who relied on changing these settings to achieve multitenancy should use *Spaces*, cross-cluster replication, or cross-cluster search instead. To migrate to *Spaces*, users are encouraged to use saved object management to export their saved objects from a tenant into the default tenant in a space. Improvements are planned to improve on this workflow. See https://github.com/elastic/kibana/issues/82020 for more details. +// tag::notable-breaking-changes[] +[float] +==== Disabling most plugins with the `{plugin_name}.enabled` setting is no longer supported +*Details:* The ability for most plugins to be disabled using the `{plugin_name}.enabled` config option has been removed. + +*Impact:* Some plugins, such as `telemetry`, `newsfeed`, `reporting`, and the various `vis_type` plugins will continue to support this setting, however the rest of the plugins that ship with Kibana will not. By default, any newly created plugins will not support this configuration unless it is explicitly added to the plugin's `configSchema`. + +If you are currently using one of these settings in your Kibana config, please remove it before upgrading to 8.0. If you were using these settings to control user access to certain Kibana applications, we recommend leveraging Feature Controls instead. + [float] ==== Legacy browsers are now rejected by default *Details:* `csp.strict` is now enabled by default, so Kibana will fail to load for older, legacy browsers that do not enforce basic Content Security Policy protections - notably Internet Explorer 11. From ed6bf9dd11464a8e7ad56a6caa4d5c2b5949227d Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 7 Oct 2021 14:26:36 -0600 Subject: [PATCH 14/20] Fix error handling for plugins without config schemas. --- .../kbn-config/src/config_service.test.ts | 48 +++++++++++++++++-- packages/kbn-config/src/config_service.ts | 19 +++++--- 2 files changed, 57 insertions(+), 10 deletions(-) diff --git a/packages/kbn-config/src/config_service.test.ts b/packages/kbn-config/src/config_service.test.ts index aafc9556e89e3..03744792258c2 100644 --- a/packages/kbn-config/src/config_service.test.ts +++ b/packages/kbn-config/src/config_service.test.ts @@ -323,18 +323,58 @@ test('treats config as enabled if config path is not present in schema', async ( expect(unusedPaths).toEqual([]); }); -test('does not read "enabled" if its schema is not present', async () => { +test('throws if reading "enabled" when it is not present in the schema', async () => { const initialConfig = { foo: { - enabled: false, // should be ignored as it is not in schema + enabled: false, }, }; const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); - const isEnabled = await configService.isEnabledAtPath('foo'); - expect(isEnabled).toBe(true); + configService.setSchema( + 'foo', + schema.object({ + bar: schema.maybe(schema.string()), + }) + ); + + expect( + async () => await configService.isEnabledAtPath('foo') + ).rejects.toThrowErrorMatchingInlineSnapshot( + `"[config validation of [foo].enabled]: definition for this key is missing"` + ); +}); + +test('throws if reading "enabled" when no schema exists', async () => { + const initialConfig = { + foo: { + enabled: false, + }, + }; + + const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); + const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); + + expect( + async () => await configService.isEnabledAtPath('foo') + ).rejects.toThrowErrorMatchingInlineSnapshot(`"No validation schema has been defined for [foo]"`); +}); + +test('throws if reading any config value when no schema exists', async () => { + const initialConfig = { + foo: { + whatever: 'hi', + }, + }; + + const rawConfigProvider = rawConfigServiceMock.create({ rawConfig: initialConfig }); + const configService = new ConfigService(rawConfigProvider, defaultEnv, logger); + + expect( + async () => await configService.isEnabledAtPath('foo') + ).rejects.toThrowErrorMatchingInlineSnapshot(`"No validation schema has been defined for [foo]"`); }); test('allows plugins to specify "enabled" flag via validation schema', async () => { diff --git a/packages/kbn-config/src/config_service.ts b/packages/kbn-config/src/config_service.ts index 34293ebfc9b65..08e16a9d2f44b 100644 --- a/packages/kbn-config/src/config_service.ts +++ b/packages/kbn-config/src/config_service.ts @@ -168,22 +168,29 @@ export class ConfigService { public async isEnabledAtPath(path: ConfigPath) { const namespace = pathToString(path); + const hasSchema = this.schemas.has(namespace); - const validatedConfig = this.schemas.has(namespace) + const config = await this.config$.pipe(first()).toPromise(); + if (!hasSchema && config.has(path)) { + // Throw if there is no schema, but a config exists at the path. + throw new Error(`No validation schema has been defined for [${namespace}]`); + } + + const validatedConfig = hasSchema ? await this.atPath<{ enabled?: boolean }>(path).pipe(first()).toPromise() : undefined; const isDisabled = validatedConfig?.enabled === false; - if (isDisabled) { - // If the plugin is _not_ enabled, we mark the entire plugin path as - // handled, as it's expected that it won't be used. + // If the plugin is explicitly disabled, we mark the entire plugin + // path as handled, as it's expected that it won't be used. this.markAsHandled(path); return false; } - // If validatedConfig.enabled is undefined or explicitly set to true, - // we consider the plugin is enabled. + // If the schema exists and the config is explicitly set to true, + // _or_ if the `enabled` config is undefined, then we treat the + // plugin as enabled. return true; } From 1acd6030a899ed85093fefd41eb786d9b5c46e0f Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Sat, 9 Oct 2021 14:17:04 -0600 Subject: [PATCH 15/20] Fix plugin service jest tests. --- src/core/server/plugins/plugins_service.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/server/plugins/plugins_service.test.ts b/src/core/server/plugins/plugins_service.test.ts index d45e7f9bf0bd0..17fa39022f0c6 100644 --- a/src/core/server/plugins/plugins_service.test.ts +++ b/src/core/server/plugins/plugins_service.test.ts @@ -1066,6 +1066,10 @@ describe('PluginsService', () => { describe('plugin initialization', () => { beforeEach(() => { + jest + .spyOn(configService, 'isEnabledAtPath') + .mockImplementation((path) => Promise.resolve(!path.includes('disabled'))); + mockDiscover.mockReturnValue({ error$: from([]), plugin$: from([ From d838308a9703224e2d32d9ad813475d8b844faa2 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Sun, 10 Oct 2021 14:55:09 -0600 Subject: [PATCH 16/20] Remove unnecessary configPath entries from x-pack test plugins. --- .../common/fixtures/plugins/aad/kibana.json | 1 - .../common/fixtures/plugins/actions_simulators/kibana.json | 1 - .../common/fixtures/plugins/alerts/kibana.json | 1 - .../common/fixtures/plugins/alerts_restricted/kibana.json | 1 - .../common/fixtures/plugins/task_manager_fixture/kibana.json | 1 - .../common/fixtures/plugins/cases_client_user/kibana.json | 1 - .../common/fixtures/plugins/observability/kibana.json | 1 - .../common/fixtures/plugins/security_solution/kibana.json | 1 - .../fixtures/plugins/alerts/kibana.json | 1 - .../functional_with_es_ssl/fixtures/plugins/alerts/kibana.json | 1 - x-pack/test/plugin_api_integration/plugins/event_log/kibana.json | 1 - .../plugins/sample_task_plugin/kibana.json | 1 - .../plugin_api_perf/plugins/task_manager_performance/kibana.json | 1 - 13 files changed, 13 deletions(-) diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json index 016ba8eee281c..7dea652f7f9bb 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["taskManager", "encryptedSavedObjects"], "optionalPlugins": ["spaces"], "server": true, diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json index db7372d66b793..5a76689f96d38 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["actions", "features", "encryptedSavedObjects"], "server": true, "ui": false diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json index 63777d0c26629..22ccd552762f5 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["taskManager", "features", "actions", "alerting", "encryptedSavedObjects"], "optionalPlugins": ["security", "spaces"], "server": true, diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json index f12f8c3c205aa..206acd533b266 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["taskManager", "features", "actions", "alerting"], "optionalPlugins": ["spaces"], "server": true, diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json index 6d21226db4994..8adfa8d57e72b 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["taskManager"], "server": true, "ui": false diff --git a/x-pack/test/case_api_integration/common/fixtures/plugins/cases_client_user/kibana.json b/x-pack/test/case_api_integration/common/fixtures/plugins/cases_client_user/kibana.json index 22312e27bb1d3..c8ccea36bd6c3 100644 --- a/x-pack/test/case_api_integration/common/fixtures/plugins/cases_client_user/kibana.json +++ b/x-pack/test/case_api_integration/common/fixtures/plugins/cases_client_user/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["features", "cases"], "optionalPlugins": ["security", "spaces"], "server": true, diff --git a/x-pack/test/case_api_integration/common/fixtures/plugins/observability/kibana.json b/x-pack/test/case_api_integration/common/fixtures/plugins/observability/kibana.json index afc0cd39734e3..783a9b60e22a6 100644 --- a/x-pack/test/case_api_integration/common/fixtures/plugins/observability/kibana.json +++ b/x-pack/test/case_api_integration/common/fixtures/plugins/observability/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["features", "cases"], "optionalPlugins": ["security", "spaces"], "server": true, diff --git a/x-pack/test/case_api_integration/common/fixtures/plugins/security_solution/kibana.json b/x-pack/test/case_api_integration/common/fixtures/plugins/security_solution/kibana.json index 8368ed83efaa1..a0d33c9ec09e8 100644 --- a/x-pack/test/case_api_integration/common/fixtures/plugins/security_solution/kibana.json +++ b/x-pack/test/case_api_integration/common/fixtures/plugins/security_solution/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["features", "cases"], "optionalPlugins": ["security", "spaces"], "server": true, diff --git a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/kibana.json b/x-pack/test/functional_execution_context/fixtures/plugins/alerts/kibana.json index 7a51160f20041..0537e12718dc5 100644 --- a/x-pack/test/functional_execution_context/fixtures/plugins/alerts/kibana.json +++ b/x-pack/test/functional_execution_context/fixtures/plugins/alerts/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["features", "alerting"], "server": true, "ui": false diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json index 717fe9966be39..8c798aa3fbe0a 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/kibana.json @@ -3,7 +3,6 @@ "owner": { "name": "Alerting Services", "githubTeam": "kibana-alerting-services" }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["alerting", "triggersActionsUi", "features"], "server": true, "ui": true diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json b/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json index 7ba0617010112..42cfa0f766e3e 100644 --- a/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json +++ b/x-pack/test/plugin_api_integration/plugins/event_log/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["eventLog"], "server": true, "ui": false diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json index 7a9fd345739a0..0171004f1c7b5 100644 --- a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/kibana.json @@ -6,7 +6,6 @@ }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["taskManager"], "server": true, "ui": false diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json index 1cc106fd95b36..995427773ad92 100644 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/kibana.json @@ -3,7 +3,6 @@ "owner": { "name": "Alerting Services", "githubTeam": "kibana-alerting-services" }, "version": "1.0.0", "kibanaVersion": "kibana", - "configPath": ["xpack"], "requiredPlugins": ["taskManager"], "server": true, "ui": false From 32ac98d7a4e14661052151b58542bae96710dc9f Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Sun, 10 Oct 2021 15:21:33 -0600 Subject: [PATCH 17/20] Avoid mocking isEnabledAtPath in jest test. --- .../server/plugins/plugins_service.test.ts | 64 +++++++++++-------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/src/core/server/plugins/plugins_service.test.ts b/src/core/server/plugins/plugins_service.test.ts index 17fa39022f0c6..0c077d732c67b 100644 --- a/src/core/server/plugins/plugins_service.test.ts +++ b/src/core/server/plugins/plugins_service.test.ts @@ -1066,36 +1066,46 @@ describe('PluginsService', () => { describe('plugin initialization', () => { beforeEach(() => { - jest - .spyOn(configService, 'isEnabledAtPath') - .mockImplementation((path) => Promise.resolve(!path.includes('disabled'))); + const prebootPlugins = [ + createPlugin('plugin-1-preboot', { + type: PluginType.preboot, + path: 'path-1-preboot', + version: 'version-1', + }), + createPlugin('plugin-2-preboot', { + type: PluginType.preboot, + path: 'path-2-preboot', + version: 'version-2', + }), + ]; + const standardPlugins = [ + createPlugin('plugin-1-standard', { + path: 'path-1-standard', + version: 'version-1', + }), + createPlugin('plugin-2-standard', { + path: 'path-2-standard', + version: 'version-2', + }), + ]; + + for (const plugin of [...prebootPlugins, ...standardPlugins]) { + jest.doMock( + join(plugin.path, 'server'), + () => ({ + config: { + schema: schema.object({ + enabled: schema.maybe(schema.boolean({ defaultValue: true })), + }), + }, + }), + { virtual: true } + ); + } mockDiscover.mockReturnValue({ error$: from([]), - plugin$: from([ - createPlugin('plugin-1-preboot', { - type: PluginType.preboot, - path: 'path-1-preboot', - version: 'version-1', - configPath: 'plugin1_preboot', - }), - createPlugin('plugin-1-standard', { - path: 'path-1-standard', - version: 'version-1', - configPath: 'plugin1_standard', - }), - createPlugin('plugin-2-preboot', { - type: PluginType.preboot, - path: 'path-2-preboot', - version: 'version-2', - configPath: 'plugin2_preboot', - }), - createPlugin('plugin-2-standard', { - path: 'path-2-standard', - version: 'version-2', - configPath: 'plugin2_standard', - }), - ]), + plugin$: from([...prebootPlugins, ...standardPlugins]), }); prebootMockPluginSystem.uiPlugins.mockReturnValue(new Map()); From 35569daaf54d41bd320b2bb00a52b93e95301fb2 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Wed, 13 Oct 2021 11:36:46 -0600 Subject: [PATCH 18/20] Revert console changes. --- src/plugins/console/server/config.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/console/server/config.ts b/src/plugins/console/server/config.ts index 5c060e46d1080..15e7721ac9c60 100644 --- a/src/plugins/console/server/config.ts +++ b/src/plugins/console/server/config.ts @@ -20,6 +20,7 @@ const baseSettings = { // Settings only available in 7.x const deprecatedSettings = { + enabled: schema.boolean({ defaultValue: true }), proxyFilter: schema.arrayOf(schema.string(), { defaultValue: ['.*'] }), proxyConfig: schema.arrayOf( schema.object({ @@ -63,7 +64,16 @@ const configSchema7x = schema.object( export type ConfigType = TypeOf; export type ConfigType7x = TypeOf; +const deprecations: PluginConfigDescriptor['deprecations'] = ({ unused }) => [unused('ssl')]; + +const deprecations7x: PluginConfigDescriptor['deprecations'] = ({ deprecate, unused }) => [ + deprecate('enabled', '8.0.0'), + deprecate('proxyFilter', '8.0.0'), + deprecate('proxyConfig', '8.0.0'), + unused('ssl'), +]; + export const config: PluginConfigDescriptor = { schema: kibanaVersion.major < 8 ? configSchema7x : configSchema, - deprecations: ({ deprecate, unused }) => [unused('ssl')], + deprecations: kibanaVersion.major < 8 ? deprecations7x : deprecations, }; From a7912a1da711e2c696a46080169c659600faedcd Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Thu, 14 Oct 2021 12:50:17 -0600 Subject: [PATCH 19/20] Revert all stack management changes. --- src/plugins/console/server/config.ts | 18 +++++++----------- .../cross_cluster_replication/server/config.ts | 1 + .../cross_cluster_replication/server/index.ts | 1 + .../server/config.ts | 1 + .../index_lifecycle_management/server/index.ts | 1 + .../plugins/index_management/server/config.ts | 14 ++++++++++++++ .../plugins/index_management/server/index.ts | 9 ++++++++- .../license_management/server/config.ts | 1 + .../plugins/license_management/server/index.ts | 1 + .../plugins/remote_clusters/server/config.ts | 2 ++ x-pack/plugins/rollup/server/config.ts | 14 ++++++++++++++ x-pack/plugins/rollup/server/index.ts | 8 +++++++- .../plugins/snapshot_restore/server/config.ts | 1 + .../plugins/snapshot_restore/server/index.ts | 1 + .../plugins/snapshot_restore/server/plugin.ts | 4 ++++ .../plugins/upgrade_assistant/common/config.ts | 1 + .../plugins/upgrade_assistant/server/index.ts | 1 + 17 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 x-pack/plugins/index_management/server/config.ts create mode 100644 x-pack/plugins/rollup/server/config.ts diff --git a/src/plugins/console/server/config.ts b/src/plugins/console/server/config.ts index 15e7721ac9c60..6d667fed081e8 100644 --- a/src/plugins/console/server/config.ts +++ b/src/plugins/console/server/config.ts @@ -15,12 +15,12 @@ import { MAJOR_VERSION } from '../common/constants'; const kibanaVersion = new SemVer(MAJOR_VERSION); const baseSettings = { + enabled: schema.boolean({ defaultValue: true }), ssl: schema.object({ verify: schema.boolean({ defaultValue: false }) }, {}), }; // Settings only available in 7.x const deprecatedSettings = { - enabled: schema.boolean({ defaultValue: true }), proxyFilter: schema.arrayOf(schema.string(), { defaultValue: ['.*'] }), proxyConfig: schema.arrayOf( schema.object({ @@ -64,16 +64,12 @@ const configSchema7x = schema.object( export type ConfigType = TypeOf; export type ConfigType7x = TypeOf; -const deprecations: PluginConfigDescriptor['deprecations'] = ({ unused }) => [unused('ssl')]; - -const deprecations7x: PluginConfigDescriptor['deprecations'] = ({ deprecate, unused }) => [ - deprecate('enabled', '8.0.0'), - deprecate('proxyFilter', '8.0.0'), - deprecate('proxyConfig', '8.0.0'), - unused('ssl'), -]; - export const config: PluginConfigDescriptor = { schema: kibanaVersion.major < 8 ? configSchema7x : configSchema, - deprecations: kibanaVersion.major < 8 ? deprecations7x : deprecations, + deprecations: ({ deprecate, unused }) => [ + deprecate('enabled', '8.0.0'), + deprecate('proxyFilter', '8.0.0'), + deprecate('proxyConfig', '8.0.0'), + unused('ssl'), + ], }; diff --git a/x-pack/plugins/cross_cluster_replication/server/config.ts b/x-pack/plugins/cross_cluster_replication/server/config.ts index a24b21f22fb7e..50cca903f8a2b 100644 --- a/x-pack/plugins/cross_cluster_replication/server/config.ts +++ b/x-pack/plugins/cross_cluster_replication/server/config.ts @@ -8,6 +8,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/cross_cluster_replication/server/index.ts b/x-pack/plugins/cross_cluster_replication/server/index.ts index b1803950614d8..a6a3ec0fe5753 100644 --- a/x-pack/plugins/cross_cluster_replication/server/index.ts +++ b/x-pack/plugins/cross_cluster_replication/server/index.ts @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/index_lifecycle_management/server/config.ts b/x-pack/plugins/index_lifecycle_management/server/config.ts index 10a6af24ea920..f3fdf59cec55b 100644 --- a/x-pack/plugins/index_lifecycle_management/server/config.ts +++ b/x-pack/plugins/index_lifecycle_management/server/config.ts @@ -8,6 +8,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/index_lifecycle_management/server/index.ts b/x-pack/plugins/index_lifecycle_management/server/index.ts index e90518dbfa357..1f8b01913fd3e 100644 --- a/x-pack/plugins/index_lifecycle_management/server/index.ts +++ b/x-pack/plugins/index_lifecycle_management/server/index.ts @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/index_management/server/config.ts b/x-pack/plugins/index_management/server/config.ts new file mode 100644 index 0000000000000..0a314c7654b16 --- /dev/null +++ b/x-pack/plugins/index_management/server/config.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), +}); + +export type IndexManagementConfig = TypeOf; diff --git a/x-pack/plugins/index_management/server/index.ts b/x-pack/plugins/index_management/server/index.ts index d5aebd3934dcf..14b67e2ffd581 100644 --- a/x-pack/plugins/index_management/server/index.ts +++ b/x-pack/plugins/index_management/server/index.ts @@ -5,13 +5,20 @@ * 2.0. */ -import { PluginInitializerContext } from 'src/core/server'; +import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; import { IndexMgmtServerPlugin } from './plugin'; +import { configSchema } from './config'; export const plugin = (context: PluginInitializerContext) => new IndexMgmtServerPlugin(context); +export const config: PluginConfigDescriptor = { + schema: configSchema, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], +}; + /** @public */ export { Dependencies } from './types'; export { IndexManagementPluginSetup } from './plugin'; export { Index, LegacyTemplateSerialized } from '../common'; +export { IndexManagementConfig } from './config'; diff --git a/x-pack/plugins/license_management/server/config.ts b/x-pack/plugins/license_management/server/config.ts index 0bdedea309b14..0e4de29b718be 100644 --- a/x-pack/plugins/license_management/server/config.ts +++ b/x-pack/plugins/license_management/server/config.ts @@ -8,6 +8,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/license_management/server/index.ts b/x-pack/plugins/license_management/server/index.ts index 7a24845c981e9..e78ffe07b50c0 100644 --- a/x-pack/plugins/license_management/server/index.ts +++ b/x-pack/plugins/license_management/server/index.ts @@ -17,4 +17,5 @@ export const config: PluginConfigDescriptor = { exposeToBrowser: { ui: true, }, + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], }; diff --git a/x-pack/plugins/remote_clusters/server/config.ts b/x-pack/plugins/remote_clusters/server/config.ts index 20fcdd3a9b945..8f379ec5613c8 100644 --- a/x-pack/plugins/remote_clusters/server/config.ts +++ b/x-pack/plugins/remote_clusters/server/config.ts @@ -9,6 +9,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; import { PluginConfigDescriptor } from 'kibana/server'; export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), @@ -17,6 +18,7 @@ export const configSchema = schema.object({ export type ConfigType = TypeOf; export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { ui: true, diff --git a/x-pack/plugins/rollup/server/config.ts b/x-pack/plugins/rollup/server/config.ts new file mode 100644 index 0000000000000..d20b317422107 --- /dev/null +++ b/x-pack/plugins/rollup/server/config.ts @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { schema, TypeOf } from '@kbn/config-schema'; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), +}); + +export type RollupConfig = TypeOf; diff --git a/x-pack/plugins/rollup/server/index.ts b/x-pack/plugins/rollup/server/index.ts index 948153e4ed51b..e77e0e6f15d72 100644 --- a/x-pack/plugins/rollup/server/index.ts +++ b/x-pack/plugins/rollup/server/index.ts @@ -5,8 +5,14 @@ * 2.0. */ -import { PluginInitializerContext } from 'src/core/server'; +import { PluginInitializerContext, PluginConfigDescriptor } from 'src/core/server'; import { RollupPlugin } from './plugin'; +import { configSchema, RollupConfig } from './config'; export const plugin = (pluginInitializerContext: PluginInitializerContext) => new RollupPlugin(pluginInitializerContext); + +export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], + schema: configSchema, +}; diff --git a/x-pack/plugins/snapshot_restore/server/config.ts b/x-pack/plugins/snapshot_restore/server/config.ts index ce5eff832756e..f0ca416ef2032 100644 --- a/x-pack/plugins/snapshot_restore/server/config.ts +++ b/x-pack/plugins/snapshot_restore/server/config.ts @@ -8,6 +8,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), slm_ui: schema.object({ enabled: schema.boolean({ defaultValue: true }), }), diff --git a/x-pack/plugins/snapshot_restore/server/index.ts b/x-pack/plugins/snapshot_restore/server/index.ts index d85d03923df1f..e10bffd6073d2 100644 --- a/x-pack/plugins/snapshot_restore/server/index.ts +++ b/x-pack/plugins/snapshot_restore/server/index.ts @@ -12,6 +12,7 @@ import { configSchema, SnapshotRestoreConfig } from './config'; export const plugin = (ctx: PluginInitializerContext) => new SnapshotRestoreServerPlugin(ctx); export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { slm_ui: true, diff --git a/x-pack/plugins/snapshot_restore/server/plugin.ts b/x-pack/plugins/snapshot_restore/server/plugin.ts index ce01aa25c97d8..4414e3735959b 100644 --- a/x-pack/plugins/snapshot_restore/server/plugin.ts +++ b/x-pack/plugins/snapshot_restore/server/plugin.ts @@ -34,6 +34,10 @@ export class SnapshotRestoreServerPlugin implements Plugin ): void { const pluginConfig = this.context.config.get(); + if (!pluginConfig.enabled) { + return; + } + const router = http.createRouter(); this.license.setup( diff --git a/x-pack/plugins/upgrade_assistant/common/config.ts b/x-pack/plugins/upgrade_assistant/common/config.ts index bce28e55ba913..e74fe5cc1bf16 100644 --- a/x-pack/plugins/upgrade_assistant/common/config.ts +++ b/x-pack/plugins/upgrade_assistant/common/config.ts @@ -8,6 +8,7 @@ import { schema, TypeOf } from '@kbn/config-schema'; export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), /* * This will default to true up until the last minor before the next major. * In readonly mode, the user will not be able to perform any actions in the UI diff --git a/x-pack/plugins/upgrade_assistant/server/index.ts b/x-pack/plugins/upgrade_assistant/server/index.ts index 6981b6f93da13..5591276b2fa34 100644 --- a/x-pack/plugins/upgrade_assistant/server/index.ts +++ b/x-pack/plugins/upgrade_assistant/server/index.ts @@ -14,6 +14,7 @@ export const plugin = (ctx: PluginInitializerContext) => { }; export const config: PluginConfigDescriptor = { + deprecations: ({ deprecate }) => [deprecate('enabled', '8.0.0')], schema: configSchema, exposeToBrowser: { readonly: true, From 577400b409656ad64e4b7f166a3342e84ef24019 Mon Sep 17 00:00:00 2001 From: Luke Elmers Date: Fri, 15 Oct 2021 10:23:42 -0600 Subject: [PATCH 20/20] Remove extra notable-breaking-changes tag in docs. --- docs/migration/migrate_8_0.asciidoc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/migration/migrate_8_0.asciidoc b/docs/migration/migrate_8_0.asciidoc index 8ba7911f65f15..f5f8a95ad24de 100644 --- a/docs/migration/migrate_8_0.asciidoc +++ b/docs/migration/migrate_8_0.asciidoc @@ -17,6 +17,7 @@ See also <> and <>. //NOTE: The notable-breaking-changes tagged regions are re-used in the //Installation and Upgrade Guide +// tag::notable-breaking-changes[] [float] [[breaking_80_index_pattern_changes]] === Index pattern changes @@ -30,19 +31,16 @@ to function as expected. Support for these index patterns has been removed in 8. *Impact:* You must migrate your time_based index patterns to a wildcard pattern, for example, `logstash-*`. - [float] [[breaking_80_setting_changes]] === Settings changes -// tag::notable-breaking-changes[] [float] ==== Multitenancy by changing `kibana.index` is no longer supported *Details:* `kibana.index`, `xpack.reporting.index` and `xpack.task_manager.index` can no longer be specified. *Impact:* Users who relied on changing these settings to achieve multitenancy should use *Spaces*, cross-cluster replication, or cross-cluster search instead. To migrate to *Spaces*, users are encouraged to use saved object management to export their saved objects from a tenant into the default tenant in a space. Improvements are planned to improve on this workflow. See https://github.com/elastic/kibana/issues/82020 for more details. -// tag::notable-breaking-changes[] [float] ==== Disabling most plugins with the `{plugin_name}.enabled` setting is no longer supported *Details:* The ability for most plugins to be disabled using the `{plugin_name}.enabled` config option has been removed.