diff --git a/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java b/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java index 409e53abeb1..91cb305b52a 100644 --- a/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java +++ b/plugin/security/src/main/java/org/elasticsearch/xpack/security/audit/index/IndexAuditTrail.java @@ -44,6 +44,7 @@ import org.elasticsearch.plugins.Plugin; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportMessage; +import org.elasticsearch.xpack.core.XPackClientPlugin; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.security.authc.AuthenticationToken; import org.elasticsearch.xpack.core.security.index.IndexAuditTrailField; @@ -961,7 +962,7 @@ public class IndexAuditTrail extends AbstractComponent implements AuditTrail { // method for testing to allow different plugins such as mock transport... List> remoteTransportClientPlugins() { - return Arrays.asList(Security.class, XPackPlugin.class); + return Arrays.asList(XPackClientPlugin.class); } public static void registerSettings(List> settings) { diff --git a/plugin/security/src/test/java/org/elasticsearch/test/SettingsFilterTests.java b/plugin/security/src/test/java/org/elasticsearch/test/SettingsFilterTests.java index 504083f3618..3d30a8e7bc0 100644 --- a/plugin/security/src/test/java/org/elasticsearch/test/SettingsFilterTests.java +++ b/plugin/security/src/test/java/org/elasticsearch/test/SettingsFilterTests.java @@ -16,6 +16,7 @@ import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; +import org.elasticsearch.xpack.security.LocalStateSecurity; import org.elasticsearch.xpack.security.Security; import org.hamcrest.Matcher; @@ -38,7 +39,7 @@ public class SettingsFilterTests extends ESTestCase { private Map settingsMatcherMap = new HashMap<>(); private MockSecureSettings mockSecureSettings = new MockSecureSettings(); - public void testFiltering() throws OperatorCreationException, GeneralSecurityException, DestroyFailedException, IOException { + public void testFiltering() throws Exception { configureUnfilteredSetting("xpack.security.authc.realms.file.type", "file"); // ldap realm filtering @@ -103,17 +104,15 @@ public class SettingsFilterTests extends ESTestCase { .setSecureSettings(mockSecureSettings) .build(); - XPackPlugin xPackPlugin = new XPackPlugin(settings, null); - Security securityPlugin = new Security(settings, null); + LocalStateSecurity securityPlugin = new LocalStateSecurity(settings, null); + List> settingList = new ArrayList<>(); settingList.add(Setting.simpleString("foo.bar", Setting.Property.NodeScope)); settingList.add(Setting.simpleString("foo.baz", Setting.Property.NodeScope)); settingList.add(Setting.simpleString("bar.baz", Setting.Property.NodeScope)); settingList.add(Setting.simpleString("baz.foo", Setting.Property.NodeScope)); - settingList.addAll(xPackPlugin.getSettings()); settingList.addAll(securityPlugin.getSettings()); List settingsFilterList = new ArrayList<>(); - settingsFilterList.addAll(xPackPlugin.getSettingsFilter()); settingsFilterList.addAll(securityPlugin.getSettingsFilter()); // custom settings, potentially added by a plugin SettingsModule settingsModule = new SettingsModule(settings, settingList, settingsFilterList);