From f126dc5589162e5efee0a58259de7b270e400ab7 Mon Sep 17 00:00:00 2001 From: Albert Zaharovits Date: Sun, 9 Dec 2018 14:32:43 +0200 Subject: [PATCH 1/3] Plain deprecate --- docs/reference/migration/migrate_6_6.asciidoc | 27 +++++++++++++++++++ .../notification/email/EmailService.java | 2 +- .../notification/hipchat/HipChatService.java | 6 ++--- .../notification/jira/JiraService.java | 6 ++--- .../pagerduty/PagerDutyService.java | 2 +- .../notification/slack/SlackService.java | 2 +- 6 files changed, 36 insertions(+), 9 deletions(-) diff --git a/docs/reference/migration/migrate_6_6.asciidoc b/docs/reference/migration/migrate_6_6.asciidoc index 2cfba69c249d9..19105b978d195 100644 --- a/docs/reference/migration/migrate_6_6.asciidoc +++ b/docs/reference/migration/migrate_6_6.asciidoc @@ -78,3 +78,30 @@ GET /stackoverflow/_search -------------------------------------------------- // CONSOLE // TEST[setup:stackoverflow] + +[float] +=== Settings changes + +[float] +==== Watcher notifications + +The following settings have been deprecated and the secure variant should +be used instead. These replacement settings are <> which have +to be defined on each cluster node's keystore, i.e., they are not available +to the cluster settings API. + +- `xpack.notification.email.account..smtp.password`, instead use +`xpack.notification.email.account..smtp.secure_password` +- `xpack.notification.hipchat.account..auth_token`, instead use +`xpack.notification.hipchat.account..secure_auth_token` +- `xpack.notification.jira.account..url`, instead use +`xpack.notification.jira.account..secure_url` +- `xpack.notification.jira.account..user`, instead use +`xpack.notification.jira.account..secure_user` +- `xpack.notification.jira.account..password`, instead use +`xpack.notification.jira.account..secure_password` +- `xpack.notification.pagerduty.account..service_api_key`, instead use +`xpack.notification.pagerduty.account..secure_service_api_key` +- `xpack.notification.slack.account..url`, instead use +`xpack.notification.slack.account..secure_url` + diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailService.java index cf897a68957b9..49afa25fd450c 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailService.java @@ -65,7 +65,7 @@ public class EmailService extends NotificationService { private static final Setting.AffixSetting SETTING_SMTP_PASSWORD = Setting.affixKeySetting("xpack.notification.email.account.", "smtp.password", - (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered)); + (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated)); private static final Setting.AffixSetting SETTING_SECURE_PASSWORD = Setting.affixKeySetting("xpack.notification.email.account.", "smtp.secure_password", diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/hipchat/HipChatService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/hipchat/HipChatService.java index b7032d7f25967..44f5aba716ca2 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/hipchat/HipChatService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/hipchat/HipChatService.java @@ -32,9 +32,9 @@ public class HipChatService extends NotificationService { static final Setting SETTING_DEFAULT_PORT = Setting.intSetting("xpack.notification.hipchat.port", 443, Setting.Property.Dynamic, Setting.Property.NodeScope); - private static final Setting.AffixSetting SETTING_AUTH_TOKEN = - Setting.affixKeySetting("xpack.notification.hipchat.account.", "auth_token", - (key) -> Setting.simpleString(key, Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Filtered)); + private static final Setting.AffixSetting SETTING_AUTH_TOKEN = Setting.affixKeySetting("xpack.notification.hipchat.account.", + "auth_token", (key) -> Setting.simpleString(key, Setting.Property.Dynamic, Setting.Property.NodeScope, + Setting.Property.Filtered, Setting.Property.Deprecated)); private static final Setting.AffixSetting SETTING_AUTH_TOKEN_SECURE = Setting.affixKeySetting("xpack.notification.hipchat.account.", "secure_auth_token", diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraService.java index efc41fe216364..bc9e096342b67 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraService.java @@ -34,15 +34,15 @@ public class JiraService extends NotificationService { private static final Setting.AffixSetting SETTING_URL = Setting.affixKeySetting("xpack.notification.jira.account.", "url", - (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered)); + (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated)); private static final Setting.AffixSetting SETTING_USER = Setting.affixKeySetting("xpack.notification.jira.account.", "user", - (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered)); + (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated)); private static final Setting.AffixSetting SETTING_PASSWORD = Setting.affixKeySetting("xpack.notification.jira.account.", "password", - (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered)); + (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated)); private static final Setting.AffixSetting SETTING_SECURE_USER = Setting.affixKeySetting("xpack.notification.jira.account.", "secure_user", diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyService.java index ff46d0d6184e6..8d117ea11e095 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyService.java @@ -28,7 +28,7 @@ public class PagerDutyService extends NotificationService { private static final Setting.AffixSetting SETTING_SERVICE_API_KEY = Setting.affixKeySetting("xpack.notification.pagerduty.account.", "service_api_key", - (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered)); + (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated)); private static final Setting.AffixSetting SETTING_SECURE_SERVICE_API_KEY = Setting.affixKeySetting("xpack.notification.pagerduty.account.", "secure_service_api_key", diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackService.java index 9a347e50c5298..d4e3f12b7cd38 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackService.java @@ -28,7 +28,7 @@ public class SlackService extends NotificationService { private static final Setting.AffixSetting SETTING_URL = Setting.affixKeySetting("xpack.notification.slack.account.", "url", - (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered)); + (key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated)); private static final Setting.AffixSetting SETTING_URL_SECURE = Setting.affixKeySetting("xpack.notification.slack.account.", "secure_url", (key) -> SecureSetting.secureString(key, null)); From a8f742c35b92232df0f4d5af6411e5dd6772321c Mon Sep 17 00:00:00 2001 From: Albert Zaharovits Date: Sun, 9 Dec 2018 14:41:27 +0200 Subject: [PATCH 2/3] Q --- .../xpack/watcher/notification/NotificationService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/NotificationService.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/NotificationService.java index c34b1ab97d6a2..5672e20905346 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/NotificationService.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/NotificationService.java @@ -121,7 +121,7 @@ private String getNotificationsAccountPrefix() { } private Set getAccountNames(Settings settings) { - // secure settings are not responsible for the client names + // secure settings are not responsible for the client names, but maybe they should? final Settings noSecureSettings = Settings.builder().put(settings, false).build(); return noSecureSettings.getByPrefix(getNotificationsAccountPrefix()).names(); } From 089a6a07c7db32acdf8387f74b2af8b9262fb2cb Mon Sep 17 00:00:00 2001 From: Albert Zaharovits Date: Mon, 17 Dec 2018 21:03:59 +0200 Subject: [PATCH 3/3] Docs nit --- docs/reference/migration/migrate_6_6.asciidoc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/reference/migration/migrate_6_6.asciidoc b/docs/reference/migration/migrate_6_6.asciidoc index 6a44e2f4a5b1e..8b44e09eb1e37 100644 --- a/docs/reference/migration/migrate_6_6.asciidoc +++ b/docs/reference/migration/migrate_6_6.asciidoc @@ -84,12 +84,13 @@ GET /stackoverflow/_search === Settings changes [float] -==== Watcher notifications +[[watcher-notifications-account-settings]] +==== Watcher notifications account settings -The following settings have been deprecated and the secure variant should -be used instead. These replacement settings are <> which have -to be defined on each cluster node's keystore, i.e., they are not available -to the cluster settings API. +The following settings have been deprecated and the secure variants should +be used instead. The <> have to be defined +inside each cluster node's keystore, i.e., they are not to be specified via +the cluster settings API. - `xpack.notification.email.account..smtp.password`, instead use `xpack.notification.email.account..smtp.secure_password`