Skip to content

Commit 01354e2

Browse files
committed
HTTPCLIENT-1625 Completely overhaul GSS-API-based authentication backend
1 parent 25f080f commit 01354e2

File tree

22 files changed

+1029
-195
lines changed

22 files changed

+1029
-195
lines changed

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: 6 additions & 1 deletion
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;
@@ -94,7 +95,11 @@ default TestClientBuilder addExecInterceptorFirst(String name, ExecChainHandler
9495
throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
9596
}
9697

97-
default TestClientBuilder addExecInterceptorLast(String name, ExecChainHandler interceptor) {
98+
default TestClientBuilder addExecInterceptorLast(String name, ExecChainHandler interceptor) {
99+
throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
100+
}
101+
102+
default TestClientBuilder setDefaultCredentialsProvider(CredentialsProvider credentialsProvider) {
98103
throw new UnsupportedOperationException("Operation not supported by " + getProtocolLevel());
99104
}
100105

0 commit comments

Comments
 (0)