Module org.elasticsearch.xcore
Class RealmSettings
java.lang.Object
org.elasticsearch.xpack.core.security.authc.RealmSettings
Provides a number of utility methods for interacting with
Settings and Setting inside a Realm.
Settings for realms use an affix style,
where the type of the realm is part of the prefix, and name of the realm is the variable portion
(That is to set the order in a file realm named "file1", then full setting key would be
xpack.security.authc.realms.file.file1.order.
This class provides some convenience methods for defining and retrieving such settings.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Setting.AffixSetting<List<String>> static final Setting.AffixSetting<Boolean> static final Setting.AffixSetting<String> static final Function<String, Setting.AffixSetting<Boolean>> static final Function<String, Setting.AffixSetting<Integer>> static final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Function<String, Setting.AffixSetting<T>> affixSetting(String suffix, Function<String, Setting<T>> delegateFactory) Create aFunctionthat acts as a factory anSetting.AffixSetting.static Map<String, DomainConfig> computeRealmNameToDomainConfigAssociation(Settings globalSettings) Computes the realm name to domain name association.static StringgetFullSettingKey(String realmName, Setting.AffixSetting<?> setting) static <T> StringgetFullSettingKey(RealmConfig.RealmIdentifier realmId, Function<String, Setting.AffixSetting<T>> setting) static <T> StringgetFullSettingKey(RealmConfig realm, Function<String, Setting.AffixSetting<T>> setting) static StringgetFullSettingKey(RealmConfig realm, Setting.AffixSetting<?> setting) static Map<RealmConfig.RealmIdentifier, Settings> getRealmSettings(Settings globalSettings) Extracts the realm settings from a global settings object.static List<Setting.AffixSetting<?>> getStandardSettings(String realmType) static StringrealmSettingPrefix(String type) static StringrealmSettingPrefix(RealmConfig.RealmIdentifier identifier) static StringrealmSslPrefix(RealmConfig.RealmIdentifier identifier) static Setting.AffixSetting<SecureString> secureString(String realmType, String suffix) Create asecure stringSettingobject of a realm of with the provided type and setting suffix.static Setting.AffixSetting<String> simpleString(String realmType, String suffix, Setting.Property... properties) Create asimple stringSettingobject for a realm of with the provided type and setting suffix.
-
Field Details
-
DOMAIN_TO_REALM_ASSOC_SETTING
-
DOMAIN_UID_LITERAL_USERNAME_SETTING
-
DOMAIN_UID_SUFFIX_SETTING
-
RESERVED_REALM_AND_DOMAIN_NAME_PREFIX
- See Also:
-
PREFIX
- See Also:
-
ENABLED_SETTING
-
ORDER_SETTING
-
-
Method Details
-
realmSettingPrefix
-
realmSettingPrefix
-
realmSslPrefix
-
simpleString
public static Setting.AffixSetting<String> simpleString(String realmType, String suffix, Setting.Property... properties) Create asimple stringSettingobject for a realm of with the provided type and setting suffix.- Parameters:
realmType- The type of the realm, used within the setting prefixsuffix- The suffix of the setting (everything following the realm name in the affix setting)properties- And properties to apply to the setting
-
secureString
Create asecure stringSettingobject of a realm of with the provided type and setting suffix.- Parameters:
realmType- The type of the realm, used within the setting prefixsuffix- The suffix of the setting (everything following the realm name in the affix setting)
-
affixSetting
public static <T> Function<String,Setting.AffixSetting<T>> affixSetting(String suffix, Function<String, Setting<T>> delegateFactory) Create aFunctionthat acts as a factory anSetting.AffixSetting. TheFunctiontakes the realm-type as an argument.- Parameters:
suffix- The suffix of the setting (everything following the realm name in the affix setting)delegateFactory- A factory to produce the concrete setting. SeeSetting.affixKeySetting(String, String, Function, Setting.AffixSettingDependency[])
-
getRealmSettings
Extracts the realm settings from a global settings object. Returns a Map of realm-id to realm-settings. -
computeRealmNameToDomainConfigAssociation
public static Map<String,DomainConfig> computeRealmNameToDomainConfigAssociation(Settings globalSettings) Computes the realm name to domain name association. Also verifies that realms are assigned to at most one domain and that domains do not refer to undefined realms. -
getFullSettingKey
-
getFullSettingKey
-
getFullSettingKey
public static <T> String getFullSettingKey(RealmConfig.RealmIdentifier realmId, Function<String, Setting.AffixSetting<T>> setting) -
getFullSettingKey
public static <T> String getFullSettingKey(RealmConfig realm, Function<String, Setting.AffixSetting<T>> setting) -
getStandardSettings
-