Module org.elasticsearch.xcore
Class SecuritySettingsUtil
java.lang.Object
org.elasticsearch.xpack.core.security.authc.support.SecuritySettingsUtil
Utilities for validating security settings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidverifyNonNullNotEmpty(String settingKey, String settingValue) Validates that a given setting's value is not empty nor null.static voidverifyNonNullNotEmpty(String settingKey, String settingValue, Collection<String> allowedValues) Validates that a given setting's value is not empty nor null and that it is one of the allowed values.static voidverifyNonNullNotEmpty(String settingKey, List<String> settingValues) Validates that a given setting's values are not empty nor null.static voidverifyNonNullNotEmpty(String settingKey, List<String> settingValues, Collection<String> allowedValues) Validates that a given setting's values are not empty nor null and that are one of the allowed values.static voidverifyProxySettings(String key, String hostValue, Map<Setting<?>, Object> settings, Setting.AffixSetting<String> hostKey, Setting.AffixSetting<String> schemeKey, Setting.AffixSetting<Integer> portKey)
-
Method Details
-
verifyNonNullNotEmpty
Validates that a given setting's value is not empty nor null.- Parameters:
settingKey- The full setting key which is validated. Used for building a proper error messages.settingValue- The value to validate that it's not null nor empty.
-
verifyNonNullNotEmpty
public static void verifyNonNullNotEmpty(String settingKey, String settingValue, Collection<String> allowedValues) Validates that a given setting's value is not empty nor null and that it is one of the allowed values.- Parameters:
settingKey- The full setting key which is validated. Used for building a proper error messages.settingValue- The value to validate that it's not null nor empty and that is one of the allowed values.allowedValues- Optional allowed values, against which to validate the given setting value. If provided, it will be checked that the setting value is one of these allowed values.
-
verifyNonNullNotEmpty
Validates that a given setting's values are not empty nor null.- Parameters:
settingKey- The full setting key which is validated. Used for building a proper error messages.settingValues- The values to validate that are not null nor empty.
-
verifyNonNullNotEmpty
public static void verifyNonNullNotEmpty(String settingKey, List<String> settingValues, Collection<String> allowedValues) Validates that a given setting's values are not empty nor null and that are one of the allowed values.- Parameters:
settingKey- The full setting key which is validated. Used for building a proper error messages.settingValues- The values to validate that are not null nor empty and that are one of the allowed values.allowedValues- The allowed values against which to validate the given setting values. If provided, this method will check that the setting values are one of these allowed values.
-
verifyProxySettings
public static void verifyProxySettings(String key, String hostValue, Map<Setting<?>, Object> settings, Setting.AffixSetting<String> hostKey, Setting.AffixSetting<String> schemeKey, Setting.AffixSetting<Integer> portKey)
-