Skip to content

Commit c625867

Browse files
committed
rename setting and update docs
1 parent 8f9c13c commit c625867

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

docs/reference/settings/monitoring-settings.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,16 @@ xpack.monitoring.exporters:
198198

199199
`auth.username`::
200200

201-
The username is required if a `auth.password` is supplied.
201+
The username is required if `auth.secure_password` or `auth.password` is supplied.
202202

203-
`secure_auth.password` ({ref}/secure-settings.html[Secure], {ref}/secure-settings.html#reloadable-secure-settings[reloadable])::
203+
`auth.secure_password` ({ref}/secure-settings.html[Secure], {ref}/secure-settings.html#reloadable-secure-settings[reloadable])::
204204

205-
The password for the `auth.username`. May not be specified with `auth.password`.
205+
The password for the `auth.username`. Takes precedence over `auth.password` if it is also specified.
206206

207207
`auth.password`::
208208

209-
The password for the `auth.username`. May not be specified with `secure_auth.password`. This setting is deprecated[7.6.0, Use
210-
`secure_auth.password` instead.].
209+
The password for the `auth.username`. This setting is ignored if `auth.secure_password` is also specified. This setting is
210+
deprecated[7.7.0, Use `auth.secure_password` instead.].
211211

212212
`connection.timeout`::
213213

x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public void validate(final String username, final Map<Setting<?>, Object> settin
220220
}
221221

222222
// it would be ideal to validate that just one of either AUTH_PASSWORD_SETTING or
223-
// SECURE_AUTH_PASSWORD_SETTING were present here, but that is not currently possible with the settings
223+
// AUTH_SECURE_PASSWORD_SETTING were present here, but that is not currently possible with the settings
224224
// validation framework.
225225
// https://github.com/elastic/elasticsearch/issues/51332
226226
}
@@ -290,10 +290,10 @@ public Iterator<Setting<?>> settings() {
290290
/**
291291
* Secure password for basic auth.
292292
*/
293-
public static final Setting.AffixSetting<SecureString> SECURE_AUTH_PASSWORD_SETTING =
293+
public static final Setting.AffixSetting<SecureString> AUTH_SECURE_PASSWORD_SETTING =
294294
Setting.affixKeySetting(
295295
"xpack.monitoring.exporters.",
296-
"secure_auth_password",
296+
"auth.secure_password",
297297
key -> SecureSetting.secureString(key, null),
298298
TYPE_DEPENDENCY);
299299
/**
@@ -707,8 +707,8 @@ private static void configureTimeouts(final RestClientBuilder builder, final Con
707707
*/
708708
public static List<String> loadSettings(Settings settings) {
709709
final List<String> changedExporters = new ArrayList<>();
710-
for (final String namespace : SECURE_AUTH_PASSWORD_SETTING.getNamespaces(settings)) {
711-
final Setting<SecureString> s = SECURE_AUTH_PASSWORD_SETTING.getConcreteSettingForNamespace(namespace);
710+
for (final String namespace : AUTH_SECURE_PASSWORD_SETTING.getNamespaces(settings)) {
711+
final Setting<SecureString> s = AUTH_SECURE_PASSWORD_SETTING.getConcreteSettingForNamespace(namespace);
712712
final SecureString securePassword = s.get(settings);
713713
final SecureString existingPassword = SECURE_AUTH_PASSWORDS.put(namespace, securePassword);
714714
if (securePassword.equals(existingPassword) == false) {
@@ -905,7 +905,7 @@ public static List<Setting.AffixSetting<?>> getDynamicSettings() {
905905
}
906906

907907
public static List<Setting.AffixSetting<?>> getSecureSettings() {
908-
return List.of(SECURE_AUTH_PASSWORD_SETTING);
908+
return List.of(AUTH_SECURE_PASSWORD_SETTING);
909909
}
910910

911911
public static List<Setting.AffixSetting<?>> getSettings() {

0 commit comments

Comments
 (0)