Module org.elasticsearch.server
Class InMemoryClonedSecureSettings
java.lang.Object
org.elasticsearch.common.settings.InMemoryClonedSecureSettings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SecureSettingscloneSecureSettings(Settings source, List<Setting<?>> settingsToClone) Creates a cloned (detached)SecureSettingsinstance by copying selected secure settings from the providedSettings.
-
Constructor Details
-
InMemoryClonedSecureSettings
public InMemoryClonedSecureSettings()
-
-
Method Details
-
cloneSecureSettings
public static SecureSettings cloneSecureSettings(Settings source, List<Setting<?>> settingsToClone) throws GeneralSecurityException Creates a cloned (detached)SecureSettingsinstance by copying selected secure settings from the providedSettings. The returned instance does not require the originalSecureSettingsto remain open and will always report as loaded.Only secure settings of type
Stringare supported (file-based secure settings are not). The returned instance cannot be serialized. Also, attempting tocloseit will not have any effect.The cloned secure settings will remain in memory for the lifetime of the returned object. This bypasses the normal lifecycle of
SecureSettings. Great care must be taken when using this method to avoid unintentionally retaining sensitive data in memory.- Parameters:
source- theSettingsobject with open/availableSecureSettingssettingsToClone- the list of secure settings definitions to copy if present- Returns:
- a cloned
SecureSettingscontaining only the selected settings if present - Throws:
GeneralSecurityException- if any secure setting cannot be accessed
-