- * We use service keytabs for validating incoming kerberos tickets and is a
- * required configuration. Due to JVM wide system properties for Kerberos we
- * cannot support multiple Kerberos realms. This class adds checks for node to
- * fail if service keytab does not exist or multiple kerberos realms have been
- * configured.
- */
-public class KerberosRealmBootstrapCheck implements BootstrapCheck {
- private final Environment env;
-
- public KerberosRealmBootstrapCheck(final Environment env) {
- this.env = env;
- }
-
- @Override
- public BootstrapCheckResult check(final BootstrapContext context) {
- final Map
- * As we are uing this instead of jaas.conf, this requires refresh of
- * {@link Configuration} and reqires appropriate security permissions to do so.
+ * As we are using this instead of jaas.conf, this requires refresh of
+ * {@link Configuration} and requires appropriate security permissions to do so.
*/
static class PasswordJaasConf extends Configuration {
private final String principal;
diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java
index d47ffe4a344..4fb94c74949 100644
--- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java
+++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/pki/PkiOptionalClientAuthTests.java
@@ -5,8 +5,9 @@
*/
package org.elasticsearch.xpack.security.authc.pki;
-import org.apache.http.message.BasicHeader;
import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy;
+import org.elasticsearch.client.Request;
+import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.client.RestClient;
@@ -76,13 +77,15 @@ public class PkiOptionalClientAuthTests extends SecuritySingleNodeTestCase {
public void testRestClientWithoutClientCertificate() throws Exception {
SSLIOSessionStrategy sessionStrategy = new SSLIOSessionStrategy(getSSLContext());
try (RestClient restClient = createRestClient(httpClientBuilder -> httpClientBuilder.setSSLStrategy(sessionStrategy), "https")) {
- ResponseException e = expectThrows(ResponseException.class, () -> restClient.performRequest("GET", "_nodes"));
+ ResponseException e = expectThrows(ResponseException.class, () -> restClient.performRequest(new Request("GET", "_nodes")));
assertThat(e.getResponse().getStatusLine().getStatusCode(), is(401));
- Response response = restClient.performRequest("GET", "_nodes",
- new BasicHeader(UsernamePasswordToken.BASIC_AUTH_HEADER,
- UsernamePasswordToken.basicAuthHeaderValue(SecuritySettingsSource.TEST_USER_NAME,
- new SecureString(SecuritySettingsSourceField.TEST_PASSWORD.toCharArray()))));
+ Request request = new Request("GET", "_nodes");
+ RequestOptions.Builder options = request.getOptions().toBuilder();
+ options.addHeader("Authorization", UsernamePasswordToken.basicAuthHeaderValue(SecuritySettingsSource.TEST_USER_NAME,
+ new SecureString(SecuritySettingsSourceField.TEST_PASSWORD.toCharArray())));
+ request.setOptions(options);
+ Response response = restClient.performRequest(request);
assertThat(response.getStatusLine().getStatusCode(), is(200));
}
}
diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java
index 67bfc2ecdcb..13a124e4bdc 100644
--- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java
+++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/rest/action/RestAuthenticateActionTests.java
@@ -5,7 +5,8 @@
*/
package org.elasticsearch.xpack.security.rest.action;
-import org.apache.http.message.BasicHeader;
+import org.elasticsearch.client.Request;
+import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.settings.SecureString;
@@ -52,11 +53,12 @@ public class RestAuthenticateActionTests extends SecurityIntegTestCase {
}
public void testAuthenticateApi() throws Exception {
- Response response = getRestClient().performRequest("GET", "/_xpack/security/_authenticate",
- new BasicHeader("Authorization", basicAuthHeaderValue(SecuritySettingsSource.TEST_USER_NAME,
- new SecureString(SecuritySettingsSourceField.TEST_PASSWORD.toCharArray()))));
- assertThat(response.getStatusLine().getStatusCode(), is(200));
- ObjectPath objectPath = ObjectPath.createFromResponse(response);
+ Request request = new Request("GET", "/_xpack/security/_authenticate");
+ RequestOptions.Builder options = request.getOptions().toBuilder();
+ options.addHeader("Authorization", basicAuthHeaderValue(SecuritySettingsSource.TEST_USER_NAME,
+ new SecureString(SecuritySettingsSourceField.TEST_PASSWORD.toCharArray())));
+ request.setOptions(options);
+ ObjectPath objectPath = ObjectPath.createFromResponse(getRestClient().performRequest(request));
assertThat(objectPath.evaluate("username").toString(), equalTo(SecuritySettingsSource.TEST_USER_NAME));
List