Skip to content

Commit

Permalink
[7.x] Improve xpack.security.session deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
watson committed Sep 8, 2021
1 parent d6e5827 commit 1c455e9
Showing 1 changed file with 26 additions and 8 deletions.
34 changes: 26 additions & 8 deletions x-pack/plugins/security/server/config_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,29 +162,47 @@ export const securityConfigDeprecationProvider: ConfigDeprecationProvider = ({
(settings, fromPath, addDeprecation) => {
if (settings?.xpack?.security?.session?.idleTimeout === undefined) {
addDeprecation({
message:
'Session idle timeout ("xpack.security.session.idleTimeout") will be set to 1 hour by default in the next major version (8.0).',
title: i18n.translate('xpack.security.deprecations.idleTimeoutTitle', {
defaultMessage: 'Default value of xpack.security.session.idleTimeout is changing',
}),
message: i18n.translate('xpack.security.deprecations.idleTimeoutMessage', {
defaultMessage:
'Session idle timeout ("xpack.security.session.idleTimeout") will be set to 1 hour by default in the next major version (8.0).',
}),
documentationUrl:
'https://www.elastic.co/guide/en/kibana/current/xpack-security-session-management.html#session-idle-timeout',
correctiveActions: {
manualSteps: [
`Use "xpack.security.session.idleTimeout" in your Kibana configuration to change default session idle timeout.`,
`To disable session idle timeout, set "xpack.security.session.idleTimeout" to 0.`,
i18n.translate('xpack.security.deprecations.idleTimeout.manualStepOneMessage', {
defaultMessage: `Use "xpack.security.session.idleTimeout" in your Kibana configuration to change default session idle timeout.`,
}),
i18n.translate('xpack.security.deprecations.idleTimeout.manualStepTwoMessage', {
defaultMessage: `To disable session idle timeout, set "xpack.security.session.idleTimeout" to 0.`,
}),
],
},
});
}

if (settings?.xpack?.security?.session?.lifespan === undefined) {
addDeprecation({
message:
'Session lifespan ("xpack.security.session.lifespan") will be set to 30 days by default in the next major version (8.0).',
title: i18n.translate('xpack.security.deprecations.lifespanTitle', {
defaultMessage: 'Default value of xpack.security.session.lifespan is changing',
}),
message: i18n.translate('xpack.security.deprecations.lifespanMessage', {
defaultMessage:
'Session lifespan ("xpack.security.session.lifespan") will be set to 30 days by default in the next major version (8.0).',
}),
documentationUrl:
'https://www.elastic.co/guide/en/kibana/current/xpack-security-session-management.html#session-lifespan',
correctiveActions: {
manualSteps: [
`Use "xpack.security.session.lifespan" in your Kibana configuration to change default session lifespan.`,
`To disable session lifespan, set "xpack.security.session.lifespan" to 0.`,
i18n.translate('xpack.security.deprecations.lifespan.manualStepOneMessage', {
defaultMessage: `Use "xpack.security.session.lifespan" in your Kibana configuration to change default session lifespan.`,
}),
i18n.translate('xpack.security.deprecations.lifespan.manualStepTwoMessage', {
defaultMessage: `To disable session lifespan, set "xpack.security.session.lifespan" to 0.`,
}),
],
},
});
Expand Down

0 comments on commit 1c455e9

Please sign in to comment.