From 430839875648dc7fcdebb06cf461d5a85645f6a2 Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Thu, 14 Oct 2021 16:30:15 +0200 Subject: [PATCH 1/4] Improve session timeout deprecation messages. --- .../server/config_deprecations.test.ts | 10 +++++----- .../security/server/config_deprecations.ts | 20 ++++++++----------- .../translations/translations/ja-JP.json | 20 +++++++++---------- .../translations/translations/zh-CN.json | 20 +++++++++---------- 4 files changed, 33 insertions(+), 37 deletions(-) diff --git a/x-pack/plugins/security/server/config_deprecations.test.ts b/x-pack/plugins/security/server/config_deprecations.test.ts index 634df081d77d7..76a06a67e6575 100644 --- a/x-pack/plugins/security/server/config_deprecations.test.ts +++ b/x-pack/plugins/security/server/config_deprecations.test.ts @@ -48,8 +48,8 @@ describe('Config Deprecations', () => { expect(migrated).toEqual(defaultConfig); expect(messages).toMatchInlineSnapshot(` Array [ - "The session idle timeout will default to 1 hour in 8.0.", - "The session lifespan will default to 30 days in 8.0.", + "User sessions will automatically time out after 1 hour of inactivity starting in 8.0. Override this value to change the timeout.", + "Users are automatically required to log in again after 30 days starting in 8.0. Override this value to change the timeout.", ] `); }); @@ -60,7 +60,7 @@ describe('Config Deprecations', () => { expect(migrated).toEqual(defaultConfig); expect(messages).toMatchInlineSnapshot(` Array [ - "The session idle timeout will default to 1 hour in 8.0.", + "User sessions will automatically time out after 1 hour of inactivity starting in 8.0. Override this value to change the timeout.", ] `); }); @@ -71,7 +71,7 @@ describe('Config Deprecations', () => { expect(migrated).toEqual(defaultConfig); expect(messages).toMatchInlineSnapshot(` Array [ - "The session lifespan will default to 30 days in 8.0.", + "Users are automatically required to log in again after 30 days starting in 8.0. Override this value to change the timeout.", ] `); }); @@ -90,7 +90,7 @@ describe('Config Deprecations', () => { expect(messages).toMatchInlineSnapshot(` Array [ "Setting \\"xpack.security.sessionTimeout\\" has been replaced by \\"xpack.security.session.idleTimeout\\"", - "The session lifespan will default to 30 days in 8.0.", + "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 ce9eb76fb1dc8..e5bed341f2fc6 100644 --- a/x-pack/plugins/security/server/config_deprecations.ts +++ b/x-pack/plugins/security/server/config_deprecations.ts @@ -171,19 +171,17 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ addDeprecation({ 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 1 hour', }), 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 1 hour 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". A value of 0 disables the timeout.`, }), ], }, @@ -194,19 +192,17 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ addDeprecation({ 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". A value of 0 disables the timeout.`, }), ], }, diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 4ca4348395d8d..406c5ae2bac48 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -5026,6 +5026,16 @@ "visTypeMetric.colorModes.backgroundOptionLabel": "背景", "visTypeMetric.colorModes.labelsOptionLabel": "ラベル", "visTypeMetric.colorModes.noneOptionLabel": "なし", + "visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。", + "visTypeMetric.metricTitle": "メトリック", + "visTypeMetric.params.color.useForLabel": "使用する色", + "visTypeMetric.params.rangesTitle": "範囲", + "visTypeMetric.params.settingsTitle": "設定", + "visTypeMetric.params.showTitleLabel": "タイトルを表示", + "visTypeMetric.params.style.fontSizeLabel": "ポイント単位のメトリックフォントサイズ", + "visTypeMetric.params.style.styleTitle": "スタイル", + "visTypeMetric.schemas.metricTitle": "メトリック", + "visTypeMetric.schemas.splitGroupTitle": "グループを分割", "expressionMetricVis.function.dimension.splitGroup": "グループを分割", "expressionMetricVis.function.bgFill.help": "html 16 進数コード(#123456)、html 色(red、blue)、または rgba 値(rgba(255,255,255,1))。", "expressionMetricVis.function.bucket.help": "バケットディメンションの構成です。", @@ -5041,16 +5051,6 @@ "expressionMetricVis.function.showLabels.help": "メトリック値の下にラベルを表示します。", "expressionMetricVis.function.subText.help": "メトリックの下に表示するカスタムテキスト", "expressionMetricVis.function.useRanges.help": "有効な色範囲です。", - "visTypeMetric.metricDescription": "計算結果を単独の数字として表示します。", - "visTypeMetric.metricTitle": "メトリック", - "visTypeMetric.params.color.useForLabel": "使用する色", - "visTypeMetric.params.rangesTitle": "範囲", - "visTypeMetric.params.settingsTitle": "設定", - "visTypeMetric.params.showTitleLabel": "タイトルを表示", - "visTypeMetric.params.style.fontSizeLabel": "ポイント単位のメトリックフォントサイズ", - "visTypeMetric.params.style.styleTitle": "スタイル", - "visTypeMetric.schemas.metricTitle": "メトリック", - "visTypeMetric.schemas.splitGroupTitle": "グループを分割", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.deprecation": "Visualizeの円グラフのレガシーグラフライブラリは廃止予定であり、8.0以降ではサポートされません。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.description": "Visualizeで円グラフのレガシーグラフライブラリを有効にします。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.name": "円グラフのレガシーグラフライブラリ", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 9cf5f6095ab79..8308854f29cd1 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -5072,6 +5072,16 @@ "visTypeMetric.colorModes.backgroundOptionLabel": "背景", "visTypeMetric.colorModes.labelsOptionLabel": "标签", "visTypeMetric.colorModes.noneOptionLabel": "无", + "visTypeMetric.metricDescription": "将计算结果显示为单个数字。", + "visTypeMetric.metricTitle": "指标", + "visTypeMetric.params.color.useForLabel": "将颜色用于", + "visTypeMetric.params.rangesTitle": "范围", + "visTypeMetric.params.settingsTitle": "设置", + "visTypeMetric.params.showTitleLabel": "显示标题", + "visTypeMetric.params.style.fontSizeLabel": "指标字体大小(磅)", + "visTypeMetric.params.style.styleTitle": "样式", + "visTypeMetric.schemas.metricTitle": "指标", + "visTypeMetric.schemas.splitGroupTitle": "拆分组", "expressionMetricVis.function.dimension.splitGroup": "拆分组", "expressionMetricVis.function.bgFill.help": "将颜色表示为 html 十六进制代码 (#123456)、html 颜色(red、blue)或 rgba 值 (rgba(255,255,255,1))。", "expressionMetricVis.function.bucket.help": "存储桶维度配置", @@ -5087,16 +5097,6 @@ "expressionMetricVis.function.showLabels.help": "在指标值下显示标签。", "expressionMetricVis.function.subText.help": "要在指标下显示的定制文本", "expressionMetricVis.function.useRanges.help": "已启用颜色范围。", - "visTypeMetric.metricDescription": "将计算结果显示为单个数字。", - "visTypeMetric.metricTitle": "指标", - "visTypeMetric.params.color.useForLabel": "将颜色用于", - "visTypeMetric.params.rangesTitle": "范围", - "visTypeMetric.params.settingsTitle": "设置", - "visTypeMetric.params.showTitleLabel": "显示标题", - "visTypeMetric.params.style.fontSizeLabel": "指标字体大小(磅)", - "visTypeMetric.params.style.styleTitle": "样式", - "visTypeMetric.schemas.metricTitle": "指标", - "visTypeMetric.schemas.splitGroupTitle": "拆分组", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.deprecation": "Visualize 中饼图的旧版图表库已弃用,自 8.0 后将不受支持。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.description": "在 Visualize 中启用饼图的旧版图表库。", "visTypePie.advancedSettings.visualization.legacyPieChartsLibrary.name": "饼图旧版图表库", From 82d62f45c0f655232b01f195e9859c464c61ff55 Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Thu, 14 Oct 2021 21:49:38 +0200 Subject: [PATCH 2/4] Eliminate documentation link and make a manual fix more detailed. --- x-pack/plugins/security/server/config_deprecations.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/security/server/config_deprecations.ts b/x-pack/plugins/security/server/config_deprecations.ts index e5bed341f2fc6..477bde81aa747 100644 --- a/x-pack/plugins/security/server/config_deprecations.ts +++ b/x-pack/plugins/security/server/config_deprecations.ts @@ -166,7 +166,7 @@ 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({ level: 'warning', @@ -177,11 +177,11 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ defaultMessage: 'User sessions will automatically time out after 1 hour 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: `To configure a custom timeout, set "xpack.security.session.idleTimeout". A value of 0 disables the timeout.`, + 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.', }), ], }, @@ -198,11 +198,11 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ 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: `To configure a custom timeout, set "xpack.security.session.lifespan". A value of 0 disables the timeout.`, + 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.', }), ], }, From 4380ce4dcf9de0a8622df5c3bc8cae947b2f59ce Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Fri, 15 Oct 2021 11:39:35 +0200 Subject: [PATCH 3/4] Use Word Joiner (U+2060) to prevent wrapping timeout format. --- x-pack/plugins/security/server/config_deprecations.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security/server/config_deprecations.ts b/x-pack/plugins/security/server/config_deprecations.ts index 477bde81aa747..c52f7ddae02b6 100644 --- a/x-pack/plugins/security/server/config_deprecations.ts +++ b/x-pack/plugins/security/server/config_deprecations.ts @@ -181,7 +181,9 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ manualSteps: [ i18n.translate('xpack.security.deprecations.idleTimeout.manualStepOneMessage', { 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.', + '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.', }), ], }, @@ -202,7 +204,9 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ manualSteps: [ i18n.translate('xpack.security.deprecations.lifespan.manualStepOneMessage', { 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.', + '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.', }), ], }, From ed2630941f3daf262b76426ffd5752056ecfe321 Mon Sep 17 00:00:00 2001 From: Aleh Zasypkin Date: Tue, 19 Oct 2021 16:04:10 +0200 Subject: [PATCH 4/4] Update deprecation message to mention 8 hours instead of 1. --- x-pack/plugins/security/server/config_deprecations.test.ts | 4 ++-- x-pack/plugins/security/server/config_deprecations.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/security/server/config_deprecations.test.ts b/x-pack/plugins/security/server/config_deprecations.test.ts index 180b51a536167..2c916e475a495 100644 --- a/x-pack/plugins/security/server/config_deprecations.test.ts +++ b/x-pack/plugins/security/server/config_deprecations.test.ts @@ -54,7 +54,7 @@ describe('Config Deprecations', () => { Array [ Object { "level": "warning", - "message": "User sessions will automatically time out after 1 hour of inactivity starting in 8.0. Override this value to change the timeout.", + "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", @@ -72,7 +72,7 @@ describe('Config Deprecations', () => { Array [ Object { "level": "warning", - "message": "User sessions will automatically time out after 1 hour of inactivity starting in 8.0. Override this value to change the timeout.", + "message": "User sessions will automatically time out after 8 hours of inactivity 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 65586a6a0b35b..b867c50f589e0 100644 --- a/x-pack/plugins/security/server/config_deprecations.ts +++ b/x-pack/plugins/security/server/config_deprecations.ts @@ -231,11 +231,11 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({ configPath: 'xpack.security.session.idleTimeout', level: 'warning', title: i18n.translate('xpack.security.deprecations.idleTimeoutTitle', { - defaultMessage: '"xpack.security.session.idleTimeout" is now 1 hour', + defaultMessage: '"xpack.security.session.idleTimeout" is now 8 hours', }), message: i18n.translate('xpack.security.deprecations.idleTimeoutMessage', { defaultMessage: - 'User sessions will automatically time out after 1 hour of inactivity starting in 8.0. Override this value to change the timeout.', + 'User sessions will automatically time out after 8 hours of inactivity starting in 8.0. Override this value to change the timeout.', }), correctiveActions: { manualSteps: [