diff options
author | Simon Willnauer <simonw@apache.org> | 2017-06-21 08:14:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-21 08:14:38 +0200 |
commit | 86a544de3b250a22af51b18eba08465cbca42c8d (patch) | |
tree | df10e29ad341053daae9001d21919bde34a37fa6 /core/src/main/java/org | |
parent | 406a15e7a90b39d7ed209983d1f90045bba7e0f2 (diff) |
Ensure we never read from a closed MockSecureSettings object (#25322)
If secure settings are closed after the node has been constructed
no key-store access is permitted. We should also try to be as close as possible
to the real behavior if we mock secure settings. This change also adds
the same behavior as bootstrap has to InternalTestCluster to ensure we fail
if we try to read from secure settings after the node has been constructed.
Diffstat (limited to 'core/src/main/java/org')
-rw-r--r-- | core/src/main/java/org/elasticsearch/common/settings/SecureSettings.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/src/main/java/org/elasticsearch/common/settings/SecureSettings.java b/core/src/main/java/org/elasticsearch/common/settings/SecureSettings.java index c5a364f547..98f980c1ec 100644 --- a/core/src/main/java/org/elasticsearch/common/settings/SecureSettings.java +++ b/core/src/main/java/org/elasticsearch/common/settings/SecureSettings.java @@ -20,6 +20,7 @@ package org.elasticsearch.common.settings; import java.io.Closeable; +import java.io.IOException; import java.io.InputStream; import java.security.GeneralSecurityException; import java.util.Set; @@ -40,4 +41,7 @@ public interface SecureSettings extends Closeable { /** Return a file setting. The {@link InputStream} should be closed once it is used. */ InputStream getFile(String setting) throws GeneralSecurityException; + + @Override + void close() throws IOException; } |