From f64c66cdbb7cf6285f2184665eba324b229c2b01 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 12 Oct 2021 11:02:27 +0200 Subject: [PATCH] [7.x] Ensure deprecation documentationUrl's point to correct doc branch (#114263) This was made possible via PR #113600. --- .../deprecation/core_deprecations.test.ts | 22 +-- .../config/deprecation/core_deprecations.ts | 152 +++++++++++------- x-pack/plugins/maps/server/index.ts | 6 +- .../security/server/config_deprecations.ts | 18 +-- 4 files changed, 119 insertions(+), 79 deletions(-) diff --git a/src/core/server/config/deprecation/core_deprecations.test.ts b/src/core/server/config/deprecation/core_deprecations.test.ts index 51eb84559972..37172b602ba8 100644 --- a/src/core/server/config/deprecation/core_deprecations.test.ts +++ b/src/core/server/config/deprecation/core_deprecations.test.ts @@ -267,7 +267,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.events.ops\\" has been deprecated and will be removed in 8.0. To access ops data moving forward, please enable debug logs for the \\"metrics.ops\\" context in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx", + "\\"logging.events.ops\\" has been deprecated and will be removed in 8.0. To access ops data moving forward, please enable debug logs for the \\"metrics.ops\\" context in your logging configuration.", ] `); }); @@ -280,7 +280,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.events.request\\" has been deprecated and will be removed in 8.0. To access request data moving forward, please enable debug logs for the \\"http.server.response\\" context in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx", + "\\"logging.events.request\\" has been deprecated and will be removed in 8.0. To access request data moving forward, please enable debug logs for the \\"http.server.response\\" context in your logging configuration.", ] `); }); @@ -293,7 +293,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.events.response\\" has been deprecated and will be removed in 8.0. To access response data moving forward, please enable debug logs for the \\"http.server.response\\" context in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx", + "\\"logging.events.response\\" has been deprecated and will be removed in 8.0. To access response data moving forward, please enable debug logs for the \\"http.server.response\\" context in your logging configuration.", ] `); }); @@ -306,7 +306,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.timezone\\" has been deprecated and will be removed in 8.0. To set the timezone moving forward, please add a timezone date modifier to the log pattern in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx", + "\\"logging.timezone\\" has been deprecated and will be removed in 8.0. To set the timezone moving forward, please add a timezone date modifier to the log pattern in your logging configuration.", ] `); }); @@ -319,7 +319,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.dest\\" has been deprecated and will be removed in 8.0. To set the destination moving forward, you can use the \\"console\\" appender in your logging configuration or define a custom one. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx", + "\\"logging.dest\\" has been deprecated and will be removed in 8.0. To set the destination moving forward, you can use the \\"console\\" appender in your logging configuration or define a custom one.", ] `); }); @@ -329,7 +329,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.dest\\" has been deprecated and will be removed in 8.0. To set the destination moving forward, you can use the \\"console\\" appender in your logging configuration or define a custom one. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx", + "\\"logging.dest\\" has been deprecated and will be removed in 8.0. To set the destination moving forward, you can use the \\"console\\" appender in your logging configuration or define a custom one.", ] `); }); @@ -375,7 +375,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.json\\" has been deprecated and will be removed in 8.0. To specify log message format moving forward, you can configure the \\"appender.layout\\" property for every custom appender in your logging configuration. There is currently no default layout for custom appenders and each one must be declared explicitly. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx", + "\\"logging.json\\" has been deprecated and will be removed in 8.0. To specify log message format moving forward, you can configure the \\"appender.layout\\" property for every custom appender in your logging configuration. There is currently no default layout for custom appenders and each one must be declared explicitly.", ] `); }); @@ -388,7 +388,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#rolling-file-appender", + "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration.", ] `); }); @@ -399,7 +399,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#rolling-file-appender", + "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration.", ] `); }); @@ -410,7 +410,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#rolling-file-appender", + "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration.", ] `); }); @@ -421,7 +421,7 @@ describe('core deprecations', () => { }); expect(messages).toMatchInlineSnapshot(` Array [ - "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration. For more details, see https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#rolling-file-appender", + "\\"logging.rotate\\" and sub-options have been deprecated and will be removed in 8.0. Moving forward, you can enable log rotation using the \\"rolling-file\\" appender for a logger in your logging configuration.", ] `); }); diff --git a/src/core/server/config/deprecation/core_deprecations.ts b/src/core/server/config/deprecation/core_deprecations.ts index 12c0099fb98e..8d0f799a2e06 100644 --- a/src/core/server/config/deprecation/core_deprecations.ts +++ b/src/core/server/config/deprecation/core_deprecations.ts @@ -185,11 +185,15 @@ const removeFromConfigStep = (setting: string) => { }); }; -const opsLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const opsLoggingEventDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.events?.ops) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`, title: i18n.translate('core.deprecations.loggingEventsOps.deprecationTitle', { defaultMessage: `Setting "logging.events.ops" is deprecated`, }), @@ -197,8 +201,7 @@ const opsLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, addDe defaultMessage: '"logging.events.ops" has been deprecated and will be removed ' + 'in 8.0. To access ops data moving forward, please enable debug logs for the ' + - '"metrics.ops" context in your logging configuration. For more details, see ' + - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx', + '"metrics.ops" context in your logging configuration.', }), correctiveActions: { manualSteps: [ @@ -212,11 +215,15 @@ const opsLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, addDe } }; -const requestLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const requestLoggingEventDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.events?.request) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`, title: i18n.translate('core.deprecations.loggingEventsRequest.deprecationTitle', { defaultMessage: `Setting "logging.events.request" is deprecated`, }), @@ -224,8 +231,7 @@ const requestLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, a defaultMessage: '"logging.events.request" has been deprecated and will be removed ' + 'in 8.0. To access request data moving forward, please enable debug logs for the ' + - '"http.server.response" context in your logging configuration. For more details, see ' + - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx', + '"http.server.response" context in your logging configuration.', }), correctiveActions: { manualSteps: [ @@ -239,11 +245,15 @@ const requestLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, a } }; -const responseLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const responseLoggingEventDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.events?.response) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`, title: i18n.translate('core.deprecations.loggingEventsResponse.deprecationTitle', { defaultMessage: `Setting "logging.events.response" is deprecated`, }), @@ -251,8 +261,7 @@ const responseLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, defaultMessage: '"logging.events.response" has been deprecated and will be removed ' + 'in 8.0. To access response data moving forward, please enable debug logs for the ' + - '"http.server.response" context in your logging configuration. For more details, see ' + - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx', + '"http.server.response" context in your logging configuration.', }), correctiveActions: { manualSteps: [ @@ -266,11 +275,15 @@ const responseLoggingEventDeprecation: ConfigDeprecation = (settings, fromPath, } }; -const timezoneLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const timezoneLoggingDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.timezone) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingtimezone', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingtimezone`, title: i18n.translate('core.deprecations.loggingTimezone.deprecationTitle', { defaultMessage: `Setting "logging.timezone" is deprecated`, }), @@ -278,8 +291,7 @@ const timezoneLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDe defaultMessage: '"logging.timezone" has been deprecated and will be removed ' + 'in 8.0. To set the timezone moving forward, please add a timezone date modifier to the log pattern ' + - 'in your logging configuration. For more details, see ' + - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx', + 'in your logging configuration.', }), correctiveActions: { manualSteps: [ @@ -293,11 +305,15 @@ const timezoneLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDe } }; -const destLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const destLoggingDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.dest) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingdest', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingdest`, title: i18n.translate('core.deprecations.loggingDest.deprecationTitle', { defaultMessage: `Setting "logging.dest" is deprecated`, }), @@ -305,8 +321,7 @@ const destLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprec defaultMessage: '"logging.dest" has been deprecated and will be removed ' + 'in 8.0. To set the destination moving forward, you can use the "console" appender ' + - 'in your logging configuration or define a custom one. For more details, see ' + - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx', + 'in your logging configuration or define a custom one.', }), correctiveActions: { manualSteps: [ @@ -320,11 +335,15 @@ const destLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprec } }; -const quietLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const quietLoggingDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.quiet) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingquiet', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingquiet`, title: i18n.translate('core.deprecations.loggingQuiet.deprecationTitle', { defaultMessage: `Setting "logging.quiet" is deprecated`, }), @@ -345,11 +364,15 @@ const quietLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDepre } }; -const silentLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const silentLoggingDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.silent) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingsilent', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingsilent`, title: i18n.translate('core.deprecations.loggingSilent.deprecationTitle', { defaultMessage: `Setting "logging.silent" is deprecated`, }), @@ -370,11 +393,15 @@ const silentLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDepr } }; -const verboseLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const verboseLoggingDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.verbose) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingverbose', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingverbose`, title: i18n.translate('core.deprecations.loggingVerbose.deprecationTitle', { defaultMessage: `Setting "logging.verbose" is deprecated`, }), @@ -395,15 +422,19 @@ const verboseLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDep } }; -const jsonLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const jsonLoggingDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { // We silence the deprecation warning when running in development mode because // the dev CLI code in src/dev/cli_dev_mode/using_server_process.ts manually // specifies `--logging.json=false`. Since it's executed in a child process, the // ` legacyLoggingConfigSchema` returns `true` for the TTY check on `process.stdout.isTTY` if (settings.logging?.json && settings.env !== 'development') { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx`, title: i18n.translate('core.deprecations.loggingJson.deprecationTitle', { defaultMessage: `Setting "logging.json" is deprecated`, }), @@ -412,9 +443,7 @@ const jsonLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprec '"logging.json" has been deprecated and will be removed ' + 'in 8.0. To specify log message format moving forward, ' + 'you can configure the "appender.layout" property for every custom appender in your logging configuration. ' + - 'There is currently no default layout for custom appenders and each one must be declared explicitly. ' + - 'For more details, see ' + - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx', + 'There is currently no default layout for custom appenders and each one must be declared explicitly.', }), correctiveActions: { manualSteps: [ @@ -428,11 +457,15 @@ const jsonLoggingDeprecation: ConfigDeprecation = (settings, fromPath, addDeprec } }; -const logRotateDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const logRotateDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.rotate) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#rolling-file-appender', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#rolling-file-appender`, title: i18n.translate('core.deprecations.loggingRotate.deprecationTitle', { defaultMessage: `Setting "logging.rotate" is deprecated`, }), @@ -440,8 +473,7 @@ const logRotateDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecat defaultMessage: '"logging.rotate" and sub-options have been deprecated and will be removed in 8.0. ' + 'Moving forward, you can enable log rotation using the "rolling-file" appender for a logger ' + - 'in your logging configuration. For more details, see ' + - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#rolling-file-appender', + 'in your logging configuration.', }), correctiveActions: { manualSteps: [ @@ -455,11 +487,15 @@ const logRotateDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecat } }; -const logEventsLogDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const logEventsLogDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.events?.log) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`, title: i18n.translate('core.deprecations.loggingEventsLog.deprecationTitle', { defaultMessage: `Setting "logging.events.log" is deprecated`, }), @@ -480,11 +516,15 @@ const logEventsLogDeprecation: ConfigDeprecation = (settings, fromPath, addDepre } }; -const logEventsErrorDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const logEventsErrorDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.events?.error) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingevents', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingevents`, title: i18n.translate('core.deprecations.loggingEventsError.deprecationTitle', { defaultMessage: `Setting "logging.events.error" is deprecated`, }), @@ -505,11 +545,15 @@ const logEventsErrorDeprecation: ConfigDeprecation = (settings, fromPath, addDep } }; -const logFilterDeprecation: ConfigDeprecation = (settings, fromPath, addDeprecation) => { +const logFilterDeprecation: ConfigDeprecation = ( + settings, + fromPath, + addDeprecation, + { branch } +) => { if (settings.logging?.filter) { addDeprecation({ - documentationUrl: - 'https://github.com/elastic/kibana/blob/master/src/core/server/logging/README.mdx#loggingfilter', + documentationUrl: `https://github.com/elastic/kibana/blob/${branch}/src/core/server/logging/README.mdx#loggingfilter`, title: i18n.translate('core.deprecations.loggingFilter.deprecationTitle', { defaultMessage: `Setting "logging.filter" is deprecated`, }), diff --git a/x-pack/plugins/maps/server/index.ts b/x-pack/plugins/maps/server/index.ts index 291bb28eed44..4e5dfcf1f94c 100644 --- a/x-pack/plugins/maps/server/index.ts +++ b/x-pack/plugins/maps/server/index.ts @@ -52,14 +52,14 @@ export const config: PluginConfigDescriptor = { ( completeConfig: Record, rootPath: string, - addDeprecation: AddConfigDeprecation + addDeprecation: AddConfigDeprecation, + { branch } ) => { if (_.get(completeConfig, 'map.proxyElasticMapsServiceInMaps') === undefined) { return completeConfig; } addDeprecation({ - documentationUrl: - 'https://www.elastic.co/guide/en/kibana/current/maps-connect-to-ems.html#elastic-maps-server', + documentationUrl: `https://www.elastic.co/guide/en/kibana/${branch}/maps-connect-to-ems.html#elastic-maps-server`, message: i18n.translate('xpack.maps.deprecation.proxyEMS.message', { defaultMessage: 'map.proxyElasticMapsServiceInMaps is deprecated and is no longer used', }), diff --git a/x-pack/plugins/security/server/config_deprecations.ts b/x-pack/plugins/security/server/config_deprecations.ts index 6d522076bd0d..ce9eb76fb1dc 100644 --- a/x-pack/plugins/security/server/config_deprecations.ts +++ b/x-pack/plugins/security/server/config_deprecations.ts @@ -30,7 +30,7 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ unused('authorization.legacyFallback.enabled'), unused('authc.saml.maxRedirectURLSize'), // Deprecation warning for the legacy audit logger. - (settings, fromPath, addDeprecation) => { + (settings, fromPath, addDeprecation, { branch }) => { const auditLoggingEnabled = settings?.xpack?.security?.audit?.enabled ?? false; const legacyAuditLoggerEnabled = !settings?.xpack?.security?.audit?.appender; if (auditLoggingEnabled && legacyAuditLoggerEnabled) { @@ -42,8 +42,7 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ defaultMessage: 'The legacy audit logger is deprecated in favor of the new ECS-compliant audit logger.', }), - documentationUrl: - 'https://www.elastic.co/guide/en/kibana/current/security-settings-kb.html#audit-logging-settings', + documentationUrl: `https://www.elastic.co/guide/en/kibana/${branch}/security-settings-kb.html#audit-logging-settings`, correctiveActions: { manualSteps: [ i18n.translate('xpack.security.deprecations.auditLogger.manualStepOneMessage', { @@ -141,7 +140,7 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ }); } }, - (settings, fromPath, addDeprecation) => { + (settings, fromPath, addDeprecation, { branch }) => { if ('enabled' in (settings?.xpack?.security || {})) { addDeprecation({ title: i18n.translate('xpack.security.deprecations.enabledTitle', { @@ -151,8 +150,7 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ defaultMessage: 'Enabling or disabling the Security plugin in Kibana is deprecated. Configure security in Elasticsearch instead.', }), - documentationUrl: - 'https://www.elastic.co/guide/en/elasticsearch/reference/current/secure-cluster.html', + documentationUrl: `https://www.elastic.co/guide/en/elasticsearch/reference/${branch}/secure-cluster.html`, correctiveActions: { manualSteps: [ i18n.translate('xpack.security.deprecations.enabled.manualStepOneMessage', { @@ -168,7 +166,7 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ } }, // Default values for session expiration timeouts. - (settings, fromPath, addDeprecation) => { + (settings, fromPath, addDeprecation, { branch }) => { if (settings?.xpack?.security?.session?.idleTimeout === undefined) { addDeprecation({ level: 'warning', @@ -178,8 +176,7 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ message: i18n.translate('xpack.security.deprecations.idleTimeoutMessage', { defaultMessage: 'The session idle timeout will default to 1 hour in 8.0.', }), - documentationUrl: - 'https://www.elastic.co/guide/en/kibana/current/xpack-security-session-management.html#session-idle-timeout', + documentationUrl: `https://www.elastic.co/guide/en/kibana/${branch}/xpack-security-session-management.html#session-idle-timeout`, correctiveActions: { manualSteps: [ i18n.translate('xpack.security.deprecations.idleTimeout.manualStepOneMessage', { @@ -202,8 +199,7 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ message: i18n.translate('xpack.security.deprecations.lifespanMessage', { defaultMessage: 'The session lifespan will default to 30 days in 8.0.', }), - documentationUrl: - 'https://www.elastic.co/guide/en/kibana/current/xpack-security-session-management.html#session-lifespan', + documentationUrl: `https://www.elastic.co/guide/en/kibana/${branch}/xpack-security-session-management.html#session-lifespan`, correctiveActions: { manualSteps: [ i18n.translate('xpack.security.deprecations.lifespan.manualStepOneMessage', {