Module org.elasticsearch.server
Class SecureClusterStateSettings
java.lang.Object
org.elasticsearch.common.settings.SecureClusterStateSettings
- All Implemented Interfaces:
Closeable,AutoCloseable,Writeable,SecureSettings
Implementation of
SecureSettings that represents secrets in cluster state. Secrets are stored as byte arrays along with
their SHA-256 digests. Provides functionality to read and serialize secure settings to broadcast them as part of cluster state.
Does not provide any encryption.
Cluster state secrets are initialized from file settings (typically using the "cluster_secrets" namespace),
and might look as follows under the respective namespace:
{
"string_secrets": {
"secure.setting.key.one": "aaa",
"secure.setting.key.two": "bbb"
}
"file_secrets": {
"secure.setting.key.three": "Y2Nj"
}
}
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static SecureClusterStateSettingscopyOf(SecureClusterStateSettings secureSettings) Creates a copy of the givenSecureClusterStateSettingssharing the immutable state, but allowing the copy to be closed without impacting the original.booleanstatic SecureClusterStateSettingsfromXContent(XContentParser parser) Reads secure cluster state settings from Json xContent, which might look as follows:Return a file setting.Returns the names of all secure settings available.byte[]getSHA256Digest(String setting) Return a string setting.inthashCode()booleanisLoaded()Returns true iff the settings are loaded and retrievable.voidwriteTo(StreamOutput out) Write this into the StreamOutput.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
SecureClusterStateSettings
- Throws:
IOException
-
-
Method Details
-
copyOf
Creates a copy of the givenSecureClusterStateSettingssharing the immutable state, but allowing the copy to be closed without impacting the original. -
fromXContent
Reads secure cluster state settings from Json xContent, which might look as follows:{ "string_secrets": { "secure.setting.key.one": "aaa", "secure.setting.key.two": "bbb" } "file_secrets": { "secure.setting.key.three": "Y2Nj" } }- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
isLoaded
public boolean isLoaded()Description copied from interface:SecureSettingsReturns true iff the settings are loaded and retrievable.- Specified by:
isLoadedin interfaceSecureSettings
-
getSettingNames
Description copied from interface:SecureSettingsReturns the names of all secure settings available.- Specified by:
getSettingNamesin interfaceSecureSettings
-
getString
Description copied from interface:SecureSettingsReturn a string setting. TheSecureStringshould be closed once it is used.- Specified by:
getStringin interfaceSecureSettings
-
getFile
Description copied from interface:SecureSettingsReturn a file setting. TheInputStreamshould be closed once it is used.- Specified by:
getFilein interfaceSecureSettings
-
getSHA256Digest
- Specified by:
getSHA256Digestin interfaceSecureSettings
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceSecureSettings
-
equals
-
hashCode
public int hashCode()
-