remove path.home from TransportClients in code and docs
After changes in core and elastic/elasticsearch#578, we do not need to set path.home in the settings for a TransportClient anymore. This cleans up the usages of it in our tests and in our documentation. Closes elastic/elasticsearch#605 Original commit: elastic/x-pack-elasticsearch@d70875fe2b
This commit is contained in:
parent
a6dc1ad97d
commit
714460c2f0
|
@ -68,7 +68,6 @@ public class CustomRealmIT extends ESIntegTestCase {
|
|||
String clusterName = nodeInfos.getClusterNameAsString();
|
||||
|
||||
Settings settings = Settings.builder()
|
||||
.put("path.home", createTempDir())
|
||||
.put("cluster.name", clusterName)
|
||||
.put(Headers.PREFIX + "." + CustomRealm.USER_HEADER, CustomRealm.KNOWN_USER)
|
||||
.put(Headers.PREFIX + "." + CustomRealm.PW_HEADER, CustomRealm.KNOWN_PW)
|
||||
|
@ -89,7 +88,6 @@ public class CustomRealmIT extends ESIntegTestCase {
|
|||
String clusterName = nodeInfos.getClusterNameAsString();
|
||||
|
||||
Settings settings = Settings.builder()
|
||||
.put("path.home", createTempDir())
|
||||
.put("cluster.name", clusterName)
|
||||
.put(Headers.PREFIX + "." + CustomRealm.USER_HEADER, CustomRealm.KNOWN_USER + randomAsciiOfLength(1))
|
||||
.put(Headers.PREFIX + "." + CustomRealm.PW_HEADER, CustomRealm.KNOWN_PW)
|
||||
|
|
|
@ -88,7 +88,6 @@ TransportClient client = TransportClient.builder()
|
|||
.settings(Settings.builder()
|
||||
.put("cluster.name", "myClusterName")
|
||||
.put("shield.user", "transport_client_user:changeme")
|
||||
.put("path.home", "/path/to/client/home")
|
||||
...
|
||||
.build())
|
||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9300))
|
||||
|
@ -117,7 +116,6 @@ TransportClient client = TransportClient.builder()
|
|||
.settings(Settings.builder()
|
||||
.put("cluster.name", "myClusterName")
|
||||
.put("shield.user", "transport_client_user:changeme")
|
||||
.put("path.home", "/path/to/client/home")
|
||||
...
|
||||
.build())
|
||||
.build()
|
||||
|
@ -149,7 +147,6 @@ TransportClient client = TransportClient.builder()
|
|||
.put("shield.user", "transport_client_user:changeme")
|
||||
.put("shield.ssl.keystore.path", "/path/to/client.jks") (1)
|
||||
.put("shield.ssl.keystore.password", "password")
|
||||
.put("path.home", "/path/to/client/home")
|
||||
...
|
||||
.build());
|
||||
--------------------------------------------------------------------------------------------------
|
||||
|
@ -172,7 +169,6 @@ TransportClient client = TransportClient.builder()
|
|||
.put("shield.ssl.keystore.path", "/path/to/client.jks") (1)
|
||||
.put("shield.ssl.keystore.password", "password")
|
||||
.put("shield.transport.ssl", "true")
|
||||
.put("path.home", "/path/to/client/home")
|
||||
...
|
||||
.build())
|
||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9300))
|
||||
|
@ -201,7 +197,6 @@ TransportClient client = TransportClient.builder()
|
|||
.put("shield.ssl.truststore.path", "/path/to/truststore.jks") (1)
|
||||
.put("shield.ssl.truststore.password", "password")
|
||||
.put("shield.transport.ssl", "true")
|
||||
.put("path.home", "/path/to/client/home")
|
||||
...
|
||||
.build())
|
||||
.addTransportAddress(new InetSocketTransportAddress("localhost", 9300))
|
||||
|
|
|
@ -691,7 +691,6 @@ public class IndexAuditTrail extends AbstractComponent implements AuditTrail, Cl
|
|||
final TransportClient transportClient = TransportClient.builder()
|
||||
.settings(Settings.builder()
|
||||
.put("name", DEFAULT_CLIENT_NAME + "-" + settings.get("name"))
|
||||
.put("path.home", environment.binFile().getParent())
|
||||
.put(clientSettings))
|
||||
.addPlugin(ShieldPlugin.class)
|
||||
.build();
|
||||
|
|
|
@ -198,7 +198,6 @@ public class RunAsIntegTests extends ShieldIntegTestCase {
|
|||
Settings settings = Settings.builder()
|
||||
.put(extraSettings)
|
||||
.put("cluster.name", clusterName)
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
|
||||
return TransportClient.builder()
|
||||
|
|
|
@ -137,7 +137,6 @@ public class PkiAuthenticationTests extends ShieldIntegTestCase {
|
|||
Settings.Builder builder = Settings.builder()
|
||||
.put(transportClientSettings())
|
||||
.put(additionalSettings)
|
||||
.put("path.home", createTempDir())
|
||||
.put("cluster.name", internalCluster().getClusterName());
|
||||
builder.remove("shield.user");
|
||||
builder.remove("request.headers.Authorization");
|
||||
|
|
|
@ -104,7 +104,6 @@ public class PkiOptionalClientAuthTests extends ShieldIntegTestCase {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
|
||||
|
||||
|
|
|
@ -62,7 +62,6 @@ public class SslHostnameVerificationTests extends ShieldIntegTestCase {
|
|||
.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")
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,6 @@ public class SslClientAuthTests extends ShieldIntegTestCase {
|
|||
}
|
||||
|
||||
Settings settings = settingsBuilder()
|
||||
.put("path.home", createTempDir())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("shield.ssl.keystore.path", store)
|
||||
.put("shield.ssl.keystore.password", "testclient-client-profile")
|
||||
|
|
|
@ -60,7 +60,6 @@ public class SslIntegrationTests extends ShieldIntegTestCase {
|
|||
public void testThatUnconfiguredCiphersAreRejected() {
|
||||
try(TransportClient transportClient = TransportClient.builder().settings(settingsBuilder()
|
||||
.put(transportClientSettings())
|
||||
.put("path.home", createTempDir())
|
||||
.put("name", "programmatic_transport_client")
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.putArray("shield.ssl.ciphers", new String[]{"TLS_ECDH_anon_WITH_RC4_128_SHA", "SSL_RSA_WITH_3DES_EDE_CBC_SHA"})
|
||||
|
@ -78,7 +77,6 @@ public class SslIntegrationTests extends ShieldIntegTestCase {
|
|||
public void testThatTransportClientUsingSSLv3ProtocolIsRejected() {
|
||||
try(TransportClient transportClient = TransportClient.builder().settings(settingsBuilder()
|
||||
.put(transportClientSettings())
|
||||
.put("path.home", createTempDir())
|
||||
.put("name", "programmatic_transport_client")
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.putArray("shield.ssl.supported_protocols", new String[]{"SSLv3"})
|
||||
|
|
|
@ -87,7 +87,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
Settings settings = settingsBuilder().put(transportClientSettings())
|
||||
.put("name", "programmatic_transport_client")
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.put(additionalSettings)
|
||||
.build();
|
||||
return TransportClient.builder().settings(settings)
|
||||
|
@ -215,7 +214,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
Settings settings = settingsBuilder()
|
||||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).addPlugin(ShieldPlugin.class).addPlugin(licensePluginClass()).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("no_ssl")));
|
||||
|
@ -232,7 +230,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
Settings settings = settingsBuilder()
|
||||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(internalCluster().getInstance(Transport.class).boundAddress().boundAddress());
|
||||
|
@ -249,7 +246,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
Settings settings = settingsBuilder()
|
||||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("client")));
|
||||
|
@ -266,7 +262,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
Settings settings = settingsBuilder()
|
||||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("no_client_auth")));
|
||||
|
@ -287,7 +282,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.transport.ssl", true)
|
||||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).addPlugin(ShieldPlugin.class).addPlugin(licensePluginClass()).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("no_client_auth")));
|
||||
|
@ -309,7 +303,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.transport.ssl", true)
|
||||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("client")));
|
||||
|
@ -331,7 +324,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.transport.ssl", true)
|
||||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(internalCluster().getInstance(Transport.class).boundAddress().boundAddress());
|
||||
|
@ -352,7 +344,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.transport.ssl", true)
|
||||
.put("shield.ssl.truststore.path", getDataPath("/org/elasticsearch/shield/transport/ssl/certs/simple/truststore-testnode-only.jks"))
|
||||
.put("shield.ssl.truststore.password", "truststore-testnode-only")
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("no_ssl")));
|
||||
|
@ -371,7 +362,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(internalCluster().getInstance(Transport.class).boundAddress().boundAddress());
|
||||
|
@ -390,7 +380,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("client")));
|
||||
|
@ -409,7 +398,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("no_client_auth")));
|
||||
|
@ -428,7 +416,6 @@ public class SslMultiPortTests extends ShieldIntegTestCase {
|
|||
.put("shield.user", DEFAULT_USER_NAME + ":" + DEFAULT_PASSWORD)
|
||||
.put("cluster.name", internalCluster().getClusterName())
|
||||
.put("shield.transport.ssl", true)
|
||||
.put("path.home", createTempDir())
|
||||
.build();
|
||||
try (TransportClient transportClient = TransportClient.builder().settings(settings).build()) {
|
||||
transportClient.addTransportAddress(new InetSocketTransportAddress(InetAddress.getLoopbackAddress(), getProfilePort("no_ssl")));
|
||||
|
|
Loading…
Reference in New Issue