|
|
@@ -9,7 +9,6 @@ package org.elasticsearch.test;
|
|
|
import io.netty.util.ThreadDeathWatcher;
|
|
|
import io.netty.util.concurrent.GlobalEventExecutor;
|
|
|
|
|
|
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
|
|
|
import org.elasticsearch.action.admin.cluster.node.info.NodeInfo;
|
|
|
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
|
|
|
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
|
|
|
@@ -22,7 +21,6 @@ import org.elasticsearch.client.RestHighLevelClient;
|
|
|
import org.elasticsearch.client.internal.Client;
|
|
|
import org.elasticsearch.client.internal.node.NodeClient;
|
|
|
import org.elasticsearch.cluster.ClusterState;
|
|
|
-import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
|
|
import org.elasticsearch.cluster.metadata.IndexAbstraction;
|
|
|
import org.elasticsearch.cluster.metadata.Metadata;
|
|
|
import org.elasticsearch.cluster.routing.IndexRoutingTable;
|
|
|
@@ -33,8 +31,6 @@ import org.elasticsearch.gateway.GatewayService;
|
|
|
import org.elasticsearch.index.Index;
|
|
|
import org.elasticsearch.license.LicenseService;
|
|
|
import org.elasticsearch.plugins.Plugin;
|
|
|
-import org.elasticsearch.xcontent.XContentBuilder;
|
|
|
-import org.elasticsearch.xcontent.json.JsonXContent;
|
|
|
import org.elasticsearch.xpack.core.security.authc.support.Hasher;
|
|
|
import org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken;
|
|
|
import org.elasticsearch.xpack.security.LocalStateSecurity;
|
|
|
@@ -56,11 +52,9 @@ import java.util.stream.Collectors;
|
|
|
|
|
|
import static org.elasticsearch.test.SecuritySettingsSourceField.TEST_PASSWORD_SECURE_STRING;
|
|
|
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
|
|
|
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout;
|
|
|
import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
|
|
|
import static org.elasticsearch.xpack.core.security.index.RestrictedIndicesNames.SECURITY_MAIN_ALIAS;
|
|
|
import static org.hamcrest.Matchers.hasItem;
|
|
|
-import static org.hamcrest.Matchers.is;
|
|
|
|
|
|
/**
|
|
|
* Base class to run tests against a cluster with X-Pack installed and security enabled.
|
|
|
@@ -368,12 +362,6 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- protected static void assertGreenClusterState(Client client) {
|
|
|
- ClusterHealthResponse clusterHealthResponse = client.admin().cluster().prepareHealth().get();
|
|
|
- assertNoTimeout(clusterHealthResponse);
|
|
|
- assertThat(clusterHealthResponse.getStatus(), is(ClusterHealthStatus.GREEN));
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Creates the indices provided as argument, randomly associating them with aliases, indexes one dummy document per index
|
|
|
* and refreshes the new indices
|
|
|
@@ -430,7 +418,6 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
|
|
|
assertBusy(() -> {
|
|
|
ClusterState clusterState = client.admin().cluster().prepareState().setLocal(true).get().getState();
|
|
|
assertFalse(clusterState.blocks().hasGlobalBlock(GatewayService.STATE_NOT_RECOVERED_BLOCK));
|
|
|
- XContentBuilder builder = JsonXContent.contentBuilder().prettyPrint().startObject();
|
|
|
Index securityIndex = resolveSecurityIndex(clusterState.metadata());
|
|
|
if (securityIndex != null) {
|
|
|
IndexRoutingTable indexRoutingTable = clusterState.routingTable().index(securityIndex);
|
|
|
@@ -471,10 +458,6 @@ public abstract class SecurityIntegTestCase extends ESIntegTestCase {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- protected boolean isTransportSSLEnabled() {
|
|
|
- return customSecuritySettingsSource.isSslEnabled();
|
|
|
- }
|
|
|
-
|
|
|
public static Hasher getFastStoredHashAlgoForTests() {
|
|
|
return inFipsJvm()
|
|
|
? Hasher.resolve(randomFrom("pbkdf2", "pbkdf2_1000", "pbkdf2_stretch_1000", "pbkdf2_stretch"))
|