Class SecureSetting<T>
java.lang.Object
org.elasticsearch.common.settings.Setting<T>
org.elasticsearch.common.settings.SecureSetting<T>
- All Implemented Interfaces:
org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentObject
A secure setting.
This class allows access to settings from the Elasticsearch keystore.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.common.settings.Setting
Setting.AffixKey, Setting.AffixSetting<T>, Setting.AffixSettingDependency, Setting.GroupKey, Setting.Key, Setting.ListKey, Setting.Property, Setting.SettingDependency, Setting.SimpleKey, Setting.Validator<T>
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
-
Field Summary
Fields inherited from class org.elasticsearch.common.settings.Setting
defaultValue
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Method Summary
Modifier and TypeMethodDescriptionvoid
diff
(Settings.Builder builder, Settings source, Settings defaultSettings) Overrides the diff operation to make this a no-op for secure settings as they shouldn't be returned in a diffboolean
Returns true if and only if this setting is present in the given settings instance.Returns the settings value.getDefault
(Settings settings) Returns the default value for this setting.getDefaultRaw
(Settings settings) Returns the default value string representation for this setting.byte[]
getSecretDigest
(Settings settings) Returns the digest of this secure setting's value ornull
if the setting is missing (inside the keystore).static Setting<InputStream>
secureFile
(String name, Setting<InputStream> fallback, Setting.Property... properties) A setting which contains a file.static Setting<SecureString>
secureString
(String name, Setting<SecureString> fallback, Setting.Property... properties) A setting which contains a sensitive string.Methods inherited from class org.elasticsearch.common.settings.Setting
affixKeySetting, affixKeySetting, boolSetting, boolSetting, boolSetting, boolSetting, boolSetting, byteSizeSetting, byteSizeSetting, byteSizeSetting, byteSizeSetting, byteSizeSetting, doubleSetting, doubleSetting, enumSetting, enumSetting, enumSetting, equals, exists, existsOrFallbackExists, floatSetting, floatSetting, get, getConcreteSetting, getKey, getProperties, getRawKey, getSettingsDependencies, groupSetting, groupSetting, hashCode, hasIndexScope, hasNodeScope, intSetting, intSetting, intSetting, intSetting, intSetting, intSetting, intSetting, isConsistent, isDynamic, isFiltered, isFinal, isInternalIndex, isOperatorOnly, isPrivateIndex, listSetting, listSetting, listSetting, listSetting, listSetting, listSetting, listSetting, longSetting, match, memorySizeSetting, memorySizeSetting, memorySizeSetting, parseByteSize, parseInt, parseInt, parseInt, parseInt, parseLong, parseTimeValue, positiveTimeSetting, positiveTimeSetting, prefixKeySetting, simpleString, simpleString, simpleString, simpleString, simpleString, simpleString, timeSetting, timeSetting, timeSetting, timeSetting, timeSetting, timeSetting, timeSetting, toString, toXContent, versionSetting
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Method Details
-
getDefaultRaw
Description copied from class:Setting
Returns the default value string representation for this setting.- Overrides:
getDefaultRaw
in classSetting<T>
- Parameters:
settings
- a settings object for settings that has a default value depending on another setting if available
-
getDefault
Description copied from class:Setting
Returns the default value for this setting.- Overrides:
getDefault
in classSetting<T>
- Parameters:
settings
- a settings object for settings that has a default value depending on another setting if available
-
exists
Description copied from class:Setting
Returns true if and only if this setting is present in the given settings instance. Note that fallback settings are excluded. -
get
Description copied from class:Setting
Returns the settings value. If the setting is not present in the given settings object the default value is returned instead. -
getSecretDigest
Returns the digest of this secure setting's value ornull
if the setting is missing (inside the keystore). This method can be called even after theSecureSettings
have been closed, unlike#get(Settings)
. The digest is used to check for changes of the value (by re-reading theSecureSettings
), without actually transmitting the value to compare with. -
diff
Overrides the diff operation to make this a no-op for secure settings as they shouldn't be returned in a diff -
secureString
public static Setting<SecureString> secureString(String name, Setting<SecureString> fallback, Setting.Property... properties) A setting which contains a sensitive string. This may be any sensitive string, e.g. a username, a password, an auth token, etc. -
secureFile
public static Setting<InputStream> secureFile(String name, Setting<InputStream> fallback, Setting.Property... properties) A setting which contains a file. Reading the setting opens an input stream to the file. This may be any sensitive file, e.g. a set of credentials normally in plaintext.
-