Skip to content

Commit 42d4d82

Browse files
committed
HTTPCLIENT-1625 Completely overhaul GSS-API-based authentication backend
rename AuthSchemeV2 to AuthScheme2, and some internal GSS variable renames rename gss serverName to PeerName (was spn in previous commit) don't add SPNEGO to DefaultAuthenticationStrategy rename GGSSchemeBase to GSSchemeBase remove KerberosScheme rename SPNegoScheme to SpnegoScheme
1 parent 007a5f6 commit 42d4d82

25 files changed

Lines changed: 1267 additions & 573 deletions

httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/StandardTestClientBuilder.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.hc.client5.http.HttpRequestRetryStrategy;
3434
import org.apache.hc.client5.http.UserTokenHandler;
3535
import org.apache.hc.client5.http.auth.AuthSchemeFactory;
36+
import org.apache.hc.client5.http.auth.CredentialsProvider;
3637
import org.apache.hc.client5.http.config.ConnectionConfig;
3738
import org.apache.hc.client5.http.config.TlsConfig;
3839
import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
@@ -153,6 +154,12 @@ public TestAsyncClientBuilder setDefaultAuthSchemeRegistry(final Lookup<AuthSche
153154
return this;
154155
}
155156

157+
@Override
158+
public TestAsyncClientBuilder setDefaultCredentialsProvider(final CredentialsProvider credentialsProvider) {
159+
this.clientBuilder.setDefaultCredentialsProvider(credentialsProvider);
160+
return this;
161+
}
162+
156163
@Override
157164
public TestAsyncClient build() throws Exception {
158165
final PoolingAsyncClientConnectionManager connectionManager = connectionManagerBuilder

httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/async/TestAsyncClientBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.hc.client5.http.HttpRequestRetryStrategy;
3434
import org.apache.hc.client5.http.UserTokenHandler;
3535
import org.apache.hc.client5.http.auth.AuthSchemeFactory;
36+
import org.apache.hc.client5.http.auth.CredentialsProvider;
3637
import org.apache.hc.client5.http.config.TlsConfig;
3738
import org.apache.hc.core5.http.Header;
3839
import org.apache.hc.core5.http.HttpRequestInterceptor;
@@ -101,6 +102,10 @@ default TestAsyncClientBuilder setDefaultAuthSchemeRegistry(Lookup<AuthSchemeFac
101102
throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
102103
}
103104

105+
default TestAsyncClientBuilder setDefaultCredentialsProvider(CredentialsProvider credentialsProvider) {
106+
throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
107+
}
108+
104109
TestAsyncClient build() throws Exception;
105110

106111
}

httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/sync/StandardTestClientBuilder.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.hc.client5.http.HttpRequestRetryStrategy;
3434
import org.apache.hc.client5.http.UserTokenHandler;
3535
import org.apache.hc.client5.http.auth.AuthSchemeFactory;
36+
import org.apache.hc.client5.http.auth.CredentialsProvider;
3637
import org.apache.hc.client5.http.classic.ExecChainHandler;
3738
import org.apache.hc.client5.http.config.ConnectionConfig;
3839
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
@@ -150,6 +151,12 @@ public TestClientBuilder addExecInterceptorLast(final String name, final ExecCha
150151
return this;
151152
}
152153

154+
@Override
155+
public TestClientBuilder setDefaultCredentialsProvider(final CredentialsProvider credentialsProvider) {
156+
this.clientBuilder.setDefaultCredentialsProvider(credentialsProvider);
157+
return this;
158+
}
159+
153160
@Override
154161
public TestClient build() throws Exception {
155162
final HttpClientConnectionManager connectionManagerCopy = connectionManager != null ? connectionManager :

httpclient5-testing/src/test/java/org/apache/hc/client5/testing/extension/sync/TestClientBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.hc.client5.http.HttpRequestRetryStrategy;
3434
import org.apache.hc.client5.http.UserTokenHandler;
3535
import org.apache.hc.client5.http.auth.AuthSchemeFactory;
36+
import org.apache.hc.client5.http.auth.CredentialsProvider;
3637
import org.apache.hc.client5.http.classic.ExecChainHandler;
3738
import org.apache.hc.client5.http.io.HttpClientConnectionManager;
3839
import org.apache.hc.core5.http.Header;
@@ -98,6 +99,10 @@ default TestClientBuilder addExecInterceptorLast(String name, ExecChainHandler i
9899
throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
99100
}
100101

102+
default TestClientBuilder setDefaultCredentialsProvider(CredentialsProvider credentialsProvider) {
103+
throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
104+
}
105+
101106
TestClient build() throws Exception;
102107

103108
}

0 commit comments

Comments
 (0)