From 63b9762e820c7b85e560b12c78eb45a55d176895 Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Tue, 19 Oct 2021 20:18:23 +0200 Subject: [PATCH] Improve session timeout deprecation messages. (#115020) * Improve session timeout deprecation messages. * Eliminate documentation link and make a manual fix more detailed. * Use Word Joiner (U+2060) to prevent wrapping timeout format. * Update deprecation message to mention 8 hours instead of 1. --- .../server/config_deprecations.test.ts | 10 +++---- .../security/server/config_deprecations.ts | 30 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/x-pack/plugins/security/server/config_deprecations.test.ts b/x-pack/plugins/security/server/config_deprecations.test.ts index 0989008c9f932..2c916e475a495 100644 --- a/x-pack/plugins/security/server/config_deprecations.test.ts +++ b/x-pack/plugins/security/server/config_deprecations.test.ts @@ -54,11 +54,11 @@ describe('Config Deprecations', () => { Array [ Object { "level": "warning", - "message": "The session idle timeout will default to 1 hour in 8.0.", + "message": "User sessions will automatically time out after 8 hours of inactivity starting in 8.0. Override this value to change the timeout.", }, Object { "level": "warning", - "message": "The session lifespan will default to 30 days in 8.0.", + "message": "Users are automatically required to log in again after 30 days starting in 8.0. Override this value to change the timeout.", }, ] `); @@ -72,7 +72,7 @@ describe('Config Deprecations', () => { Array [ Object { "level": "warning", - "message": "The session idle timeout will default to 1 hour in 8.0.", + "message": "User sessions will automatically time out after 8 hours of inactivity starting in 8.0. Override this value to change the timeout.", }, ] `); @@ -86,7 +86,7 @@ describe('Config Deprecations', () => { Array [ Object { "level": "warning", - "message": "The session lifespan will default to 30 days in 8.0.", + "message": "Users are automatically required to log in again after 30 days starting in 8.0. Override this value to change the timeout.", }, ] `); @@ -111,7 +111,7 @@ describe('Config Deprecations', () => { }, Object { "level": "warning", - "message": "The session lifespan will default to 30 days in 8.0.", + "message": "Users are automatically required to log in again after 30 days starting in 8.0. Override this value to change the timeout.", }, ] `); diff --git a/x-pack/plugins/security/server/config_deprecations.ts b/x-pack/plugins/security/server/config_deprecations.ts index ea9377f6a74a5..b867c50f589e0 100644 --- a/x-pack/plugins/security/server/config_deprecations.ts +++ b/x-pack/plugins/security/server/config_deprecations.ts @@ -225,25 +225,25 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ } }, // Default values for session expiration timeouts. - (settings, fromPath, addDeprecation, { branch }) => { + (settings, fromPath, addDeprecation) => { if (settings?.xpack?.security?.session?.idleTimeout === undefined) { addDeprecation({ configPath: 'xpack.security.session.idleTimeout', level: 'warning', title: i18n.translate('xpack.security.deprecations.idleTimeoutTitle', { - defaultMessage: 'The "xpack.security.session.idleTimeout" default is changing', + defaultMessage: '"xpack.security.session.idleTimeout" is now 8 hours', }), message: i18n.translate('xpack.security.deprecations.idleTimeoutMessage', { - defaultMessage: 'The session idle timeout will default to 1 hour in 8.0.', + defaultMessage: + 'User sessions will automatically time out after 8 hours of inactivity starting in 8.0. Override this value to change the 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', { - defaultMessage: `Set "xpack.security.session.idleTimeout" in your Kibana configuration to override the default session idle timeout.`, - }), - i18n.translate('xpack.security.deprecations.idleTimeout.manualStepTwoMessage', { - defaultMessage: `To disable the session idle timeout, set "xpack.security.session.idleTimeout" to 0.`, + defaultMessage: + 'To configure a custom timeout, set "xpack.security.session.idleTimeout". Use the format ⁠[ms|s|m|h|d|w|M|Y], for example, 20m, 24h, 7d, 1w. A value of 0 disables the timeout.', + description: + 'Please preserve a Word Joiner (U+2060) symbol after in translation.', }), ], }, @@ -255,19 +255,19 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ configPath: 'xpack.security.session.lifespan', level: 'warning', title: i18n.translate('xpack.security.deprecations.lifespanTitle', { - defaultMessage: 'The "xpack.security.session.lifespan" default is changing', + defaultMessage: '"xpack.security.session.lifespan" is now 30 days', }), message: i18n.translate('xpack.security.deprecations.lifespanMessage', { - defaultMessage: 'The session lifespan will default to 30 days in 8.0.', + defaultMessage: + 'Users are automatically required to log in again after 30 days starting in 8.0. Override this value to change the timeout.', }), - 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', { - defaultMessage: `Set "xpack.security.session.lifespan" in your Kibana configuration to override the default session lifespan.`, - }), - i18n.translate('xpack.security.deprecations.lifespan.manualStepTwoMessage', { - defaultMessage: `To disable the session lifespan, set "xpack.security.session.lifespan" to 0.`, + defaultMessage: + 'To configure a custom timeout, set "xpack.security.session.lifespan". Use the format ⁠[ms|s|m|h|d|w|M|Y], for example, 20m, 24h, 7d, 1w. A value of 0 disables the timeout.', + description: + 'Please preserve a Word Joiner (U+2060) symbol after in translation.', }), ], },