Skip to content

Commit

Permalink
Improve session timeout deprecation messages. (#115020)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
azasypkin authored Oct 19, 2021
1 parent 5f38cac commit 63b9762
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions x-pack/plugins/security/server/config_deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
},
]
`);
Expand All @@ -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.",
},
]
`);
Expand All @@ -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.",
},
]
`);
Expand All @@ -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.",
},
]
`);
Expand Down
30 changes: 15 additions & 15 deletions x-pack/plugins/security/server/config_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <count>⁠[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 <count> in translation.',
}),
],
},
Expand All @@ -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 <count>⁠[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 <count> in translation.',
}),
],
},
Expand Down

0 comments on commit 63b9762

Please sign in to comment.