Skip to content

Commit adc961f

Browse files
Watcher deprecate notification service settings (elastic#36403)
Deprecates all the settings for watcher notifications account that are dynamic cluster filtered and have a corresponding secure sibling. They are deprecated in favor of the sibling that is stored in the keystore. Follow-up on elastic#35610
1 parent 15d1e70 commit adc961f

File tree

6 files changed

+37
-9
lines changed

6 files changed

+37
-9
lines changed

docs/reference/migration/migrate_6_6.asciidoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,31 @@ GET /stackoverflow/_search
7979
--------------------------------------------------
8080
// CONSOLE
8181
// TEST[setup:stackoverflow]
82+
83+
[float]
84+
=== Settings changes
85+
86+
[float]
87+
[[watcher-notifications-account-settings]]
88+
==== Watcher notifications account settings
89+
90+
The following settings have been deprecated and the secure variants should
91+
be used instead. The <<secure-settings, secure settings>> have to be defined
92+
inside each cluster node's keystore, i.e., they are not to be specified via
93+
the cluster settings API.
94+
95+
- `xpack.notification.email.account.<id>.smtp.password`, instead use
96+
`xpack.notification.email.account.<id>.smtp.secure_password`
97+
- `xpack.notification.hipchat.account.<id>.auth_token`, instead use
98+
`xpack.notification.hipchat.account.<id>.secure_auth_token`
99+
- `xpack.notification.jira.account.<id>.url`, instead use
100+
`xpack.notification.jira.account.<id>.secure_url`
101+
- `xpack.notification.jira.account.<id>.user`, instead use
102+
`xpack.notification.jira.account.<id>.secure_user`
103+
- `xpack.notification.jira.account.<id>.password`, instead use
104+
`xpack.notification.jira.account.<id>.secure_password`
105+
- `xpack.notification.pagerduty.account.<id>.service_api_key`, instead use
106+
`xpack.notification.pagerduty.account.<id>.secure_service_api_key`
107+
- `xpack.notification.slack.account.<id>.url`, instead use
108+
`xpack.notification.slack.account.<id>.secure_url`
109+

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/EmailService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class EmailService extends NotificationService<Account> {
6565

6666
private static final Setting.AffixSetting<String> SETTING_SMTP_PASSWORD =
6767
Setting.affixKeySetting("xpack.notification.email.account.", "smtp.password",
68-
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered));
68+
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated));
6969

7070
private static final Setting.AffixSetting<SecureString> SETTING_SECURE_PASSWORD =
7171
Setting.affixKeySetting("xpack.notification.email.account.", "smtp.secure_password",

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/hipchat/HipChatService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public class HipChatService extends NotificationService<HipChatAccount> {
3232
static final Setting<Integer> SETTING_DEFAULT_PORT =
3333
Setting.intSetting("xpack.notification.hipchat.port", 443, Setting.Property.Dynamic, Setting.Property.NodeScope);
3434

35-
private static final Setting.AffixSetting<String> SETTING_AUTH_TOKEN =
36-
Setting.affixKeySetting("xpack.notification.hipchat.account.", "auth_token",
37-
(key) -> Setting.simpleString(key, Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Filtered));
35+
private static final Setting.AffixSetting<String> SETTING_AUTH_TOKEN = Setting.affixKeySetting("xpack.notification.hipchat.account.",
36+
"auth_token", (key) -> Setting.simpleString(key, Setting.Property.Dynamic, Setting.Property.NodeScope,
37+
Setting.Property.Filtered, Setting.Property.Deprecated));
3838

3939
private static final Setting.AffixSetting<SecureString> SETTING_AUTH_TOKEN_SECURE =
4040
Setting.affixKeySetting("xpack.notification.hipchat.account.", "secure_auth_token",

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/jira/JiraService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ public class JiraService extends NotificationService<JiraAccount> {
3434

3535
private static final Setting.AffixSetting<String> SETTING_URL =
3636
Setting.affixKeySetting("xpack.notification.jira.account.", "url",
37-
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered));
37+
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated));
3838

3939
private static final Setting.AffixSetting<String> SETTING_USER =
4040
Setting.affixKeySetting("xpack.notification.jira.account.", "user",
41-
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered));
41+
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated));
4242

4343
private static final Setting.AffixSetting<String> SETTING_PASSWORD =
4444
Setting.affixKeySetting("xpack.notification.jira.account.", "password",
45-
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered));
45+
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated));
4646

4747
private static final Setting.AffixSetting<SecureString> SETTING_SECURE_USER =
4848
Setting.affixKeySetting("xpack.notification.jira.account.", "secure_user",

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/pagerduty/PagerDutyService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class PagerDutyService extends NotificationService<PagerDutyAccount> {
2828

2929
private static final Setting.AffixSetting<String> SETTING_SERVICE_API_KEY =
3030
Setting.affixKeySetting("xpack.notification.pagerduty.account.", "service_api_key",
31-
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered));
31+
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated));
3232

3333
private static final Setting.AffixSetting<SecureString> SETTING_SECURE_SERVICE_API_KEY =
3434
Setting.affixKeySetting("xpack.notification.pagerduty.account.", "secure_service_api_key",

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/slack/SlackService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public class SlackService extends NotificationService<SlackAccount> {
2828

2929
private static final Setting.AffixSetting<String> SETTING_URL =
3030
Setting.affixKeySetting("xpack.notification.slack.account.", "url",
31-
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered));
31+
(key) -> Setting.simpleString(key, Property.Dynamic, Property.NodeScope, Property.Filtered, Property.Deprecated));
3232

3333
private static final Setting.AffixSetting<SecureString> SETTING_URL_SECURE =
3434
Setting.affixKeySetting("xpack.notification.slack.account.", "secure_url", (key) -> SecureSetting.secureString(key, null));

0 commit comments

Comments
 (0)