diff --git a/src/main/java/org/elasticsearch/shield/ShieldModule.java b/src/main/java/org/elasticsearch/shield/ShieldModule.java index b96fd1f2fb9..60a96458748 100644 --- a/src/main/java/org/elasticsearch/shield/ShieldModule.java +++ b/src/main/java/org/elasticsearch/shield/ShieldModule.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.rest.ShieldRestModule; import org.elasticsearch.shield.license.LicenseModule; import org.elasticsearch.shield.ssl.SSLModule; import org.elasticsearch.shield.support.AbstractShieldModule; -import org.elasticsearch.shield.transport.SecuredTransportModule; +import org.elasticsearch.shield.transport.ShieldTransportModule; /** * @@ -36,7 +36,7 @@ public class ShieldModule extends AbstractShieldModule.Spawn { if (clientMode) { return ImmutableList.of( new ShieldActionModule(settings), - new SecuredTransportModule(settings), + new ShieldTransportModule(settings), new SSLModule(settings)); } @@ -47,7 +47,7 @@ public class ShieldModule extends AbstractShieldModule.Spawn { new AuditTrailModule(settings), new ShieldRestModule(settings), new ShieldActionModule(settings), - new SecuredTransportModule(settings), + new ShieldTransportModule(settings), new SignatureModule(settings), new SSLModule(settings)); } diff --git a/src/main/java/org/elasticsearch/shield/transport/SecuredClientTransportService.java b/src/main/java/org/elasticsearch/shield/transport/ShieldClientTransportService.java similarity index 84% rename from src/main/java/org/elasticsearch/shield/transport/SecuredClientTransportService.java rename to src/main/java/org/elasticsearch/shield/transport/ShieldClientTransportService.java index 127e14b2005..8fcbeb5dd0c 100644 --- a/src/main/java/org/elasticsearch/shield/transport/SecuredClientTransportService.java +++ b/src/main/java/org/elasticsearch/shield/transport/ShieldClientTransportService.java @@ -11,12 +11,12 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.*; -public class SecuredClientTransportService extends TransportService { +public class ShieldClientTransportService extends TransportService { private final ClientTransportFilter clientFilter; @Inject - public SecuredClientTransportService(Settings settings, Transport transport, ThreadPool threadPool, ClientTransportFilter clientFilter) { + public ShieldClientTransportService(Settings settings, Transport transport, ThreadPool threadPool, ClientTransportFilter clientFilter) { super(settings, transport, threadPool); this.clientFilter = clientFilter; } diff --git a/src/main/java/org/elasticsearch/shield/transport/SecuredServerTransportService.java b/src/main/java/org/elasticsearch/shield/transport/ShieldServerTransportService.java similarity index 87% rename from src/main/java/org/elasticsearch/shield/transport/SecuredServerTransportService.java rename to src/main/java/org/elasticsearch/shield/transport/ShieldServerTransportService.java index a0c57660276..532a8d0ffe2 100644 --- a/src/main/java/org/elasticsearch/shield/transport/SecuredServerTransportService.java +++ b/src/main/java/org/elasticsearch/shield/transport/ShieldServerTransportService.java @@ -9,8 +9,8 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.collect.Maps; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.shield.transport.netty.NettySecuredTransport; -import org.elasticsearch.shield.transport.netty.SecuredMessageChannelHandler; +import org.elasticsearch.shield.transport.netty.ShieldNettyTransport; +import org.elasticsearch.shield.transport.netty.ShieldMessageChannelHandler; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.*; @@ -19,7 +19,7 @@ import java.util.Map; /** * */ -public class SecuredServerTransportService extends TransportService { +public class ShieldServerTransportService extends TransportService { public static final String SETTING_NAME = "shield.type"; @@ -29,10 +29,10 @@ public class SecuredServerTransportService extends TransportService { private final Map profileFilters; @Inject - public SecuredServerTransportService(Settings settings, Transport transport, ThreadPool threadPool, - ServerTransportFilter.ClientProfile clientProfileFilter, - ServerTransportFilter.NodeProfile nodeProfileFilter, - ClientTransportFilter clientTransportFilter) { + public ShieldServerTransportService(Settings settings, Transport transport, ThreadPool threadPool, + ServerTransportFilter.ClientProfile clientProfileFilter, + ServerTransportFilter.NodeProfile nodeProfileFilter, + ClientTransportFilter clientTransportFilter) { super(settings, transport, threadPool); this.clientProfileFilter = clientProfileFilter; this.nodeProfileFilter = nodeProfileFilter; @@ -62,7 +62,7 @@ public class SecuredServerTransportService extends TransportService { } private Map initializeProfileFilters() { - if (!(transport instanceof NettySecuredTransport)) { + if (!(transport instanceof ShieldNettyTransport)) { return null; } @@ -150,7 +150,7 @@ public class SecuredServerTransportService extends TransportService { @SuppressWarnings("unchecked") public void messageReceived(TransportRequest request, TransportChannel channel) throws Exception { try { - SecuredMessageChannelHandler.VisibleNettyTransportChannel nettyTransportChannel = (SecuredMessageChannelHandler.VisibleNettyTransportChannel) channel; + ShieldMessageChannelHandler.VisibleNettyTransportChannel nettyTransportChannel = (ShieldMessageChannelHandler.VisibleNettyTransportChannel) channel; String profile = nettyTransportChannel.getProfile(); ServerTransportFilter filter = profileFilters.get(profile); if (filter == null) { diff --git a/src/main/java/org/elasticsearch/shield/transport/SecuredTransportModule.java b/src/main/java/org/elasticsearch/shield/transport/ShieldTransportModule.java similarity index 76% rename from src/main/java/org/elasticsearch/shield/transport/SecuredTransportModule.java rename to src/main/java/org/elasticsearch/shield/transport/ShieldTransportModule.java index 4fa1770ac74..2b1739e8d8e 100644 --- a/src/main/java/org/elasticsearch/shield/transport/SecuredTransportModule.java +++ b/src/main/java/org/elasticsearch/shield/transport/ShieldTransportModule.java @@ -13,16 +13,16 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.shield.ShieldPlugin; import org.elasticsearch.shield.support.AbstractShieldModule; import org.elasticsearch.shield.transport.filter.IPFilter; -import org.elasticsearch.shield.transport.netty.NettySecuredHttpServerTransportModule; -import org.elasticsearch.shield.transport.netty.NettySecuredTransportModule; +import org.elasticsearch.shield.transport.netty.ShieldNettyHttpServerTransportModule; +import org.elasticsearch.shield.transport.netty.ShieldNettyTransportModule; import org.elasticsearch.transport.TransportModule; /** * */ -public class SecuredTransportModule extends AbstractShieldModule.Spawn implements PreProcessModule { +public class ShieldTransportModule extends AbstractShieldModule.Spawn implements PreProcessModule { - public SecuredTransportModule(Settings settings) { + public ShieldTransportModule(Settings settings) { super(settings); } @@ -30,21 +30,21 @@ public class SecuredTransportModule extends AbstractShieldModule.Spawn implement public Iterable spawnModules(boolean clientMode) { if (clientMode) { - return ImmutableList.of(new NettySecuredTransportModule(settings)); + return ImmutableList.of(new ShieldNettyTransportModule(settings)); } return ImmutableList.of( - new NettySecuredHttpServerTransportModule(settings), - new NettySecuredTransportModule(settings)); + new ShieldNettyHttpServerTransportModule(settings), + new ShieldNettyTransportModule(settings)); } @Override public void processModule(Module module) { if (module instanceof TransportModule) { if (clientMode) { - ((TransportModule) module).setTransportService(SecuredClientTransportService.class, ShieldPlugin.NAME); + ((TransportModule) module).setTransportService(ShieldClientTransportService.class, ShieldPlugin.NAME); } else { - ((TransportModule) module).setTransportService(SecuredServerTransportService.class, ShieldPlugin.NAME); + ((TransportModule) module).setTransportService(ShieldServerTransportService.class, ShieldPlugin.NAME); } } } diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/NettyIPFilterUpstreamHandler.java b/src/main/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandler.java similarity index 90% rename from src/main/java/org/elasticsearch/shield/transport/netty/NettyIPFilterUpstreamHandler.java rename to src/main/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandler.java index 0f457d9b868..4a83cff7c17 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/NettyIPFilterUpstreamHandler.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandler.java @@ -17,12 +17,12 @@ import java.net.InetSocketAddress; * */ @ChannelHandler.Sharable -public class NettyIPFilterUpstreamHandler extends IpFilteringHandlerImpl { +public class IPFilterNettyUpstreamHandler extends IpFilteringHandlerImpl { private final IPFilter filter; private final String profile; - public NettyIPFilterUpstreamHandler(IPFilter filter, String profile) { + public IPFilterNettyUpstreamHandler(IPFilter filter, String profile) { this.filter = filter; this.profile = profile; } diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/SecuredMessageChannelHandler.java b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldMessageChannelHandler.java similarity index 96% rename from src/main/java/org/elasticsearch/shield/transport/netty/SecuredMessageChannelHandler.java rename to src/main/java/org/elasticsearch/shield/transport/netty/ShieldMessageChannelHandler.java index 106dd769cf0..c8d7e4bbfa4 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/SecuredMessageChannelHandler.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldMessageChannelHandler.java @@ -23,11 +23,11 @@ import org.elasticsearch.transport.netty.NettyTransportChannel; import java.io.IOException; import java.net.InetSocketAddress; -public class SecuredMessageChannelHandler extends MessageChannelHandler { +public class ShieldMessageChannelHandler extends MessageChannelHandler { private final String profileName; - public SecuredMessageChannelHandler(NettyTransport nettyTransport, String profileName, ESLogger logger) { + public ShieldMessageChannelHandler(NettyTransport nettyTransport, String profileName, ESLogger logger) { super(nettyTransport, logger); this.profileName = profileName; } diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransport.java b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransport.java similarity index 86% rename from src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransport.java rename to src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransport.java index 1fa8c49cf38..15d4c73a8d2 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransport.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransport.java @@ -21,15 +21,15 @@ import javax.net.ssl.SSLEngine; /** * */ -public class NettySecuredHttpServerTransport extends NettyHttpServerTransport { +public class ShieldNettyHttpServerTransport extends NettyHttpServerTransport { private final IPFilter ipFilter; private final SSLService sslService; private final boolean ssl; @Inject - public NettySecuredHttpServerTransport(Settings settings, NetworkService networkService, BigArrays bigArrays, - IPFilter ipFilter, SSLService sslService) { + public ShieldNettyHttpServerTransport(Settings settings, NetworkService networkService, BigArrays bigArrays, + IPFilter ipFilter, SSLService sslService) { super(settings, networkService, bigArrays); this.ipFilter = ipFilter; this.ssl = settings.getAsBoolean("shield.http.ssl", false); @@ -57,7 +57,7 @@ public class NettySecuredHttpServerTransport extends NettyHttpServerTransport { pipeline.addFirst("ssl", new SslHandler(engine)); } - pipeline.addFirst("ipfilter", new NettyIPFilterUpstreamHandler(ipFilter, IPFilter.HTTP_PROFILE_NAME)); + pipeline.addFirst("ipfilter", new IPFilterNettyUpstreamHandler(ipFilter, IPFilter.HTTP_PROFILE_NAME)); return pipeline; } } diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransportModule.java b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransportModule.java similarity index 73% rename from src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransportModule.java rename to src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransportModule.java index 94264e835a8..089bb009350 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredHttpServerTransportModule.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyHttpServerTransportModule.java @@ -15,16 +15,16 @@ import org.elasticsearch.shield.support.AbstractShieldModule; /** * */ -public class NettySecuredHttpServerTransportModule extends AbstractShieldModule implements PreProcessModule { +public class ShieldNettyHttpServerTransportModule extends AbstractShieldModule implements PreProcessModule { - public NettySecuredHttpServerTransportModule(Settings settings) { + public ShieldNettyHttpServerTransportModule(Settings settings) { super(settings); } @Override public void processModule(Module module) { if (module instanceof HttpServerModule) { - ((HttpServerModule) module).setHttpServerTransport(NettySecuredHttpServerTransport.class, ShieldPlugin.NAME); + ((HttpServerModule) module).setHttpServerTransport(ShieldNettyHttpServerTransport.class, ShieldPlugin.NAME); } } diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransport.java b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransport.java similarity index 90% rename from src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransport.java rename to src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransport.java index fd6e8486b8a..36c4099e92b 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransport.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransport.java @@ -25,7 +25,7 @@ import java.net.InetSocketAddress; /** * */ -public class NettySecuredTransport extends NettyTransport { +public class ShieldNettyTransport extends NettyTransport { public static final String HOSTNAME_VERIFICATION_SETTING = "shield.ssl.hostname_verification"; public static final String HOSTNAME_VERIFICATION_RESOLVE_NAME_SETTING = "shield.ssl.hostname_verification.resolve_name"; @@ -35,8 +35,8 @@ public class NettySecuredTransport extends NettyTransport { private final boolean ssl; @Inject - public NettySecuredTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, BigArrays bigArrays, Version version, - @Nullable IPFilter authenticator, SSLService sslService) { + public ShieldNettyTransport(Settings settings, ThreadPool threadPool, NetworkService networkService, BigArrays bigArrays, Version version, + @Nullable IPFilter authenticator, SSLService sslService) { super(settings, threadPool, networkService, bigArrays, version); this.authenticator = authenticator; this.ssl = settings.getAsBoolean("shield.transport.ssl", false); @@ -78,9 +78,9 @@ public class NettySecuredTransport extends NettyTransport { pipeline.addFirst("ssl", new SslHandler(serverEngine)); } - pipeline.replace("dispatcher", "dispatcher", new SecuredMessageChannelHandler(nettyTransport, name, logger)); + pipeline.replace("dispatcher", "dispatcher", new ShieldMessageChannelHandler(nettyTransport, name, logger)); if (authenticator != null) { - pipeline.addFirst("ipfilter", new NettyIPFilterUpstreamHandler(authenticator, name)); + pipeline.addFirst("ipfilter", new IPFilterNettyUpstreamHandler(authenticator, name)); } return pipeline; } @@ -98,7 +98,7 @@ public class NettySecuredTransport extends NettyTransport { if (ssl) { pipeline.addFirst("sslInitializer", new ClientSslHandlerInitializer()); } - pipeline.replace("dispatcher", "dispatcher", new SecuredMessageChannelHandler(nettyTransport, "default", logger)); + pipeline.replace("dispatcher", "dispatcher", new ShieldMessageChannelHandler(nettyTransport, "default", logger)); return pipeline; } diff --git a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransportModule.java b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportModule.java similarity index 76% rename from src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransportModule.java rename to src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportModule.java index 488150863af..b3091f3db82 100644 --- a/src/main/java/org/elasticsearch/shield/transport/netty/NettySecuredTransportModule.java +++ b/src/main/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportModule.java @@ -15,16 +15,16 @@ import org.elasticsearch.transport.TransportModule; /** * */ -public class NettySecuredTransportModule extends AbstractShieldModule implements PreProcessModule { +public class ShieldNettyTransportModule extends AbstractShieldModule implements PreProcessModule { - public NettySecuredTransportModule(Settings settings) { + public ShieldNettyTransportModule(Settings settings) { super(settings); } @Override public void processModule(Module module) { if (module instanceof TransportModule) { - ((TransportModule) module).setTransport(NettySecuredTransport.class, ShieldPlugin.NAME); + ((TransportModule) module).setTransport(ShieldNettyTransport.class, ShieldPlugin.NAME); } } diff --git a/src/test/java/org/elasticsearch/test/ShieldClearScrollTests.java b/src/test/java/org/elasticsearch/integration/ShieldClearScrollTests.java similarity index 98% rename from src/test/java/org/elasticsearch/test/ShieldClearScrollTests.java rename to src/test/java/org/elasticsearch/integration/ShieldClearScrollTests.java index f545fe939af..023dd365ec9 100644 --- a/src/test/java/org/elasticsearch/test/ShieldClearScrollTests.java +++ b/src/test/java/org/elasticsearch/integration/ShieldClearScrollTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.test; +package org.elasticsearch.integration; import org.elasticsearch.ExceptionsHelper; import org.elasticsearch.action.bulk.BulkRequestBuilder; @@ -14,6 +14,7 @@ import org.elasticsearch.action.search.MultiSearchResponse; import org.elasticsearch.action.search.SearchPhaseExecutionException; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authz.AuthorizationException; +import org.elasticsearch.test.ShieldIntegrationTest; import org.junit.After; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTests.java b/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTests.java index fd7dcb005b6..9929a4ba5e9 100644 --- a/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTests.java +++ b/src/test/java/org/elasticsearch/integration/ldap/AbstractAdLdapRealmTests.java @@ -19,7 +19,7 @@ import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.authc.support.ldap.SearchScope; import org.elasticsearch.shield.authz.AuthorizationException; -import org.elasticsearch.shield.transport.netty.NettySecuredTransport; +import org.elasticsearch.shield.transport.netty.ShieldNettyTransport; import org.elasticsearch.test.ShieldIntegrationTest; import org.junit.BeforeClass; import org.junit.Ignore; @@ -160,7 +160,7 @@ abstract public class AbstractAdLdapRealmTests extends ShieldIntegrationTest { return settingsBuilder() .put("shield.ssl.keystore.path", store.getPath()) .put("shield.ssl.keystore.password", password) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_SETTING, false) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_SETTING, false) .put("shield.ssl.truststore.path", store.getPath()) .put("shield.ssl.truststore.password", password).build(); } diff --git a/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java b/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java index 0593231f41c..83d53426f17 100644 --- a/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java +++ b/src/test/java/org/elasticsearch/shield/ShieldPluginEnabledDisabledTests.java @@ -15,8 +15,8 @@ import org.elasticsearch.node.internal.InternalNode; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; -import org.elasticsearch.shield.transport.SecuredServerTransportService; -import org.elasticsearch.shield.transport.netty.NettySecuredTransport; +import org.elasticsearch.shield.transport.ShieldServerTransportService; +import org.elasticsearch.shield.transport.netty.ShieldNettyTransport; import org.elasticsearch.test.ElasticsearchIntegrationTest.ClusterScope; import org.elasticsearch.test.ShieldIntegrationTest; import org.elasticsearch.test.ShieldSettingsSource; @@ -90,14 +90,14 @@ public class ShieldPluginEnabledDisabledTests extends ShieldIntegrationTest { @Test public void testTransportEnabledDisabled() throws Exception { for (TransportService service : internalCluster().getInstances(TransportService.class)) { - Matcher matcher = instanceOf(SecuredServerTransportService.class); + Matcher matcher = instanceOf(ShieldServerTransportService.class); if (!enabled) { matcher = not(matcher); } assertThat(service, matcher); } for (Transport transport : internalCluster().getInstances(Transport.class)) { - Matcher matcher = instanceOf(NettySecuredTransport.class); + Matcher matcher = instanceOf(ShieldNettyTransport.class); if (!enabled) { matcher = not(matcher); } diff --git a/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java b/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java index 0be5652c64f..8f7547a52dd 100644 --- a/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java +++ b/src/test/java/org/elasticsearch/shield/VersionCompatibilityTests.java @@ -38,7 +38,7 @@ public class VersionCompatibilityTests extends ElasticsearchTestCase { assertThat("Remove TransportProfileUtil class or bump the version, fixed in es core 1.5", Version.CURRENT.onOrBefore(Version.V_1_4_2), is(true)); /** - * see https://github.com/elasticsearch/elasticsearch/pull/9134 {@link org.elasticsearch.shield.transport.netty.SecuredMessageChannelHandler} + * see https://github.com/elasticsearch/elasticsearch/pull/9134 {@link org.elasticsearch.shield.transport.netty.ShieldMessageChannelHandler} */ assertThat("Cleanup SecuredMessageChannelHandler class and remove needless code, fixed in es core 1.5", Version.CURRENT.onOrBefore(Version.V_1_4_2), is(true)); diff --git a/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java b/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java index 8ad8b67c5fd..8fdbfe5f856 100644 --- a/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java +++ b/src/test/java/org/elasticsearch/shield/transport/TransportFilterTests.java @@ -43,7 +43,7 @@ public class TransportFilterTests extends ElasticsearchIntegrationTest { return ImmutableSettings.settingsBuilder() .put("plugins.load_classpath_plugins", false) .put("plugin.types", InternalPlugin.class.getName()) - .put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, SecuredServerTransportService.class.getName()) + .put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, ShieldServerTransportService.class.getName()) .build(); } diff --git a/src/test/java/org/elasticsearch/shield/transport/netty/NettyIPFilterUpstreamHandlerTests.java b/src/test/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandlerTests.java similarity index 96% rename from src/test/java/org/elasticsearch/shield/transport/netty/NettyIPFilterUpstreamHandlerTests.java rename to src/test/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandlerTests.java index ad61131dcb5..6b5ef53e176 100644 --- a/src/test/java/org/elasticsearch/shield/transport/netty/NettyIPFilterUpstreamHandlerTests.java +++ b/src/test/java/org/elasticsearch/shield/transport/netty/IPFilterNettyUpstreamHandlerTests.java @@ -23,9 +23,9 @@ import static org.hamcrest.Matchers.is; /** * */ -public class NettyIPFilterUpstreamHandlerTests extends ElasticsearchTestCase { +public class IPFilterNettyUpstreamHandlerTests extends ElasticsearchTestCase { - private NettyIPFilterUpstreamHandler nettyUpstreamHandler; + private IPFilterNettyUpstreamHandler nettyUpstreamHandler; @Before public void init() throws Exception { @@ -36,7 +36,7 @@ public class NettyIPFilterUpstreamHandlerTests extends ElasticsearchTestCase { IPFilter ipFilter = new IPFilter(settings, AuditTrail.NOOP); - nettyUpstreamHandler = new NettyIPFilterUpstreamHandler(ipFilter, IPFilter.HTTP_PROFILE_NAME); + nettyUpstreamHandler = new IPFilterNettyUpstreamHandler(ipFilter, IPFilter.HTTP_PROFILE_NAME); } @Test diff --git a/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationIntegrationTests.java b/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationTests.java similarity index 88% rename from src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationIntegrationTests.java rename to src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationTests.java index b7d55e79577..34f18e5a20d 100644 --- a/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationIntegrationTests.java +++ b/src/test/java/org/elasticsearch/shield/transport/netty/IPHostnameVerificationTests.java @@ -21,7 +21,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde import static org.hamcrest.CoreMatchers.is; @ClusterScope(scope = ElasticsearchIntegrationTest.Scope.SUITE) -public class IPHostnameVerificationIntegrationTests extends ShieldIntegrationTest { +public class IPHostnameVerificationTests extends ShieldIntegrationTest { static Path keystore; @@ -59,16 +59,16 @@ public class IPHostnameVerificationIntegrationTests extends ShieldIntegrationTes .put("transport.host", "127.0.0.1") .put("network.host", "127.0.0.1") .put("shield.ssl.client.auth", "false") - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_SETTING, true) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_RESOLVE_NAME_SETTING, false) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_SETTING, true) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_RESOLVE_NAME_SETTING, false) .build(); } @Override protected Settings transportClientSettings() { return ImmutableSettings.builder().put(super.transportClientSettings()) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_SETTING, true) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_RESOLVE_NAME_SETTING, false) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_SETTING, true) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_RESOLVE_NAME_SETTING, false) .put("shield.ssl.keystore.path", keystore.toAbsolutePath()) .put("shield.ssl.keystore.password", "testnode-ip-only") .put("shield.ssl.truststore.path", keystore.toAbsolutePath()) diff --git a/src/test/java/org/elasticsearch/shield/transport/netty/NettySecuredTransportTests.java b/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportTests.java similarity index 84% rename from src/test/java/org/elasticsearch/shield/transport/netty/NettySecuredTransportTests.java rename to src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportTests.java index 070fc7eb787..3d441e43cce 100644 --- a/src/test/java/org/elasticsearch/shield/transport/netty/NettySecuredTransportTests.java +++ b/src/test/java/org/elasticsearch/shield/transport/netty/ShieldNettyTransportTests.java @@ -28,7 +28,7 @@ import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilde import static org.mockito.Mockito.mock; import static org.hamcrest.Matchers.*; -public class NettySecuredTransportTests extends ElasticsearchTestCase { +public class ShieldNettyTransportTests extends ElasticsearchTestCase { private SSLService sslService; @@ -44,7 +44,7 @@ public class NettySecuredTransportTests extends ElasticsearchTestCase { @Test public void testThatSSLCanBeDisabledByProfile() throws Exception { Settings settings = ImmutableSettings.builder().put("shield.transport.ssl", true).build(); - NettySecuredTransport transport = new NettySecuredTransport(settings, mock(ThreadPool.class), mock(NetworkService.class), mock(BigArrays.class), Version.CURRENT, null, sslService); + ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class), mock(BigArrays.class), Version.CURRENT, null, sslService); setOpenChannelsHandlerToMock(transport); ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", ImmutableSettings.builder().put("shield.ssl", false).build()); assertThat(factory.getPipeline().get(SslHandler.class), nullValue()); @@ -53,7 +53,7 @@ public class NettySecuredTransportTests extends ElasticsearchTestCase { @Test public void testThatSSLCanBeEnabledByProfile() throws Exception { Settings settings = ImmutableSettings.builder().put("shield.transport.ssl", false).build(); - NettySecuredTransport transport = new NettySecuredTransport(settings, mock(ThreadPool.class), mock(NetworkService.class), mock(BigArrays.class), Version.CURRENT, null, sslService); + ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class), mock(BigArrays.class), Version.CURRENT, null, sslService); setOpenChannelsHandlerToMock(transport); ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", ImmutableSettings.builder().put("shield.ssl", true).build()); assertThat(factory.getPipeline().get(SslHandler.class), notNullValue()); @@ -62,7 +62,7 @@ public class NettySecuredTransportTests extends ElasticsearchTestCase { @Test public void testThatProfileTakesDefaultSSLSetting() throws Exception { Settings settings = ImmutableSettings.builder().put("shield.transport.ssl", true).build(); - NettySecuredTransport transport = new NettySecuredTransport(settings, mock(ThreadPool.class), mock(NetworkService.class), mock(BigArrays.class), Version.CURRENT, null, sslService); + ShieldNettyTransport transport = new ShieldNettyTransport(settings, mock(ThreadPool.class), mock(NetworkService.class), mock(BigArrays.class), Version.CURRENT, null, sslService); setOpenChannelsHandlerToMock(transport); ChannelPipelineFactory factory = transport.configureServerChannelPipelineFactory("client", ImmutableSettings.EMPTY); assertThat(factory.getPipeline().get(SslHandler.class), notNullValue()); diff --git a/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationIntegrationTests.java b/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationTests.java similarity index 91% rename from src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationIntegrationTests.java rename to src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationTests.java index fc4940377a4..7b4d5b2b085 100644 --- a/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationIntegrationTests.java +++ b/src/test/java/org/elasticsearch/shield/transport/netty/SslHostnameVerificationTests.java @@ -28,7 +28,7 @@ import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.CoreMatchers.is; @ClusterScope(scope = Scope.SUITE) -public class SslHostnameVerificationIntegrationTests extends ShieldIntegrationTest { +public class SslHostnameVerificationTests extends ShieldIntegrationTest { static Path keystore; @@ -56,14 +56,14 @@ public class SslHostnameVerificationIntegrationTests extends ShieldIntegrationTe .put("shield.ssl.keystore.password", "testnode-no-subjaltname") .put("shield.ssl.truststore.path", keystore.toAbsolutePath()) // settings for client truststore .put("shield.ssl.truststore.password", "testnode-no-subjaltname") - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_SETTING, false) // disable hostname verification as this test uses non-localhost addresses + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_SETTING, false) // disable hostname verification as this test uses non-localhost addresses .build(); } @Override protected Settings transportClientSettings() { return ImmutableSettings.builder().put(super.transportClientSettings()) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_SETTING, false) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_SETTING, false) .put("shield.ssl.truststore.path", keystore.toAbsolutePath()) // settings for client truststore .put("shield.ssl.truststore.password", "testnode-no-subjaltname") .build(); @@ -77,7 +77,7 @@ public class SslHostnameVerificationIntegrationTests extends ShieldIntegrationTe InetSocketAddress inetSocketAddress = ((InetSocketTransportAddress) transportAddress).address(); Settings settings = ImmutableSettings.builder().put(transportClientSettings()) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_SETTING, true) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_SETTING, true) .build(); try (TransportClient client = new TransportClient(settings, false)) { diff --git a/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java b/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java index 58379992125..f0d45e8fd4f 100644 --- a/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java +++ b/src/test/java/org/elasticsearch/test/ShieldSettingsSource.java @@ -17,7 +17,7 @@ import org.elasticsearch.shield.authc.support.SecuredString; import org.elasticsearch.shield.authc.support.UsernamePasswordToken; import org.elasticsearch.shield.signature.InternalSignatureService; import org.elasticsearch.shield.test.ShieldTestUtils; -import org.elasticsearch.shield.transport.netty.NettySecuredTransport; +import org.elasticsearch.shield.transport.netty.ShieldNettyTransport; import org.elasticsearch.test.discovery.ClusterDiscoveryConfiguration; import java.io.File; @@ -223,8 +223,8 @@ public class ShieldSettingsSource extends ClusterDiscoveryConfiguration.UnicastZ if (sslTransportEnabled) { builder.put("shield.ssl.keystore.path", store.getPath()) .put("shield.ssl.keystore.password", password) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_SETTING, hostnameVerificationEnabled) - .put(NettySecuredTransport.HOSTNAME_VERIFICATION_RESOLVE_NAME_SETTING, hostnameVerificationResolveNameEnabled); + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_SETTING, hostnameVerificationEnabled) + .put(ShieldNettyTransport.HOSTNAME_VERIFICATION_RESOLVE_NAME_SETTING, hostnameVerificationResolveNameEnabled); } if (sslTransportEnabled && randomBoolean()) {