You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/10/20 09:52:58 UTC

[1/2] httpcomponents-client git commit: HTTPCLIENT-1855: Removed code causing unnecessary auth cache updated; Reverted 7e44b96

Repository: httpcomponents-client
Updated Branches:
  refs/heads/4.5.x cfbbea0ee -> 1383e1f78


HTTPCLIENT-1855: Removed code causing unnecessary auth cache updated; Reverted 7e44b96


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/aa818657
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/aa818657
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/aa818657

Branch: refs/heads/4.5.x
Commit: aa81865776f4d664b829981071fbd9fd83203d6f
Parents: cfbbea0
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Thu Oct 19 20:07:49 2017 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Thu Oct 19 20:07:49 2017 +0200

----------------------------------------------------------------------
 .../http/client/protocol/RequestAuthCache.java  |  7 -----
 .../client/protocol/TestRequestAuthCache.java   | 27 --------------------
 2 files changed, 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/aa818657/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
index 7bf37e6..ab68515 100644
--- a/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
+++ b/httpclient/src/main/java/org/apache/http/client/protocol/RequestAuthCache.java
@@ -44,7 +44,6 @@ import org.apache.http.auth.AuthState;
 import org.apache.http.auth.Credentials;
 import org.apache.http.client.AuthCache;
 import org.apache.http.client.CredentialsProvider;
-import org.apache.http.client.config.AuthSchemes;
 import org.apache.http.conn.routing.RouteInfo;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.Args;
@@ -136,12 +135,6 @@ public class RequestAuthCache implements HttpRequestInterceptor {
         final Credentials creds = credsProvider.getCredentials(authScope);
 
         if (creds != null) {
-            if (AuthSchemes.BASIC.equalsIgnoreCase(authScheme.getSchemeName())
-                    || AuthSchemes.DIGEST.equalsIgnoreCase(authScheme.getSchemeName())) {
-                authState.setState(AuthProtocolState.CHALLENGED);
-            } else {
-                authState.setState(AuthProtocolState.SUCCESS);
-            }
             authState.update(authScheme, creds);
         } else {
             this.log.debug("No credentials for preemptive authentication");

http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/aa818657/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
----------------------------------------------------------------------
diff --git a/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java b/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
index 1c0d323..3f0d8e9 100644
--- a/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
+++ b/httpclient/src/test/java/org/apache/http/client/protocol/TestRequestAuthCache.java
@@ -124,33 +124,6 @@ public class TestRequestAuthCache {
     }
 
     @Test
-    public void testPreemptiveTargetAndProxyAuthDigest() throws Exception {
-        final HttpRequest request = new BasicHttpRequest("GET", "/");
-
-        final HttpClientContext context = HttpClientContext.create();
-        context.setAttribute(HttpClientContext.CREDS_PROVIDER, this.credProvider);
-        context.setAttribute(HttpCoreContext.HTTP_TARGET_HOST, this.target);
-        context.setAttribute(HttpClientContext.HTTP_ROUTE, new HttpRoute(this.target, null, this.proxy, false));
-        context.setAttribute(HttpClientContext.TARGET_AUTH_STATE, this.targetState);
-        context.setAttribute(HttpClientContext.PROXY_AUTH_STATE, this.proxyState);
-
-        final AuthCache authCache = new BasicAuthCache();
-        authCache.put(this.target, this.digestAuthscheme1);
-        authCache.put(this.proxy, this.digestAuthscheme2);
-
-        context.setAttribute(HttpClientContext.AUTH_CACHE, authCache);
-
-        final HttpRequestInterceptor interceptor = new RequestAuthCache();
-        interceptor.process(request, context);
-        Assert.assertNotNull(this.targetState.getAuthScheme());
-        Assert.assertSame(this.targetState.getState(), AuthProtocolState.CHALLENGED);
-        Assert.assertSame(this.creds1, this.targetState.getCredentials());
-        Assert.assertNotNull(this.proxyState.getAuthScheme());
-        Assert.assertSame(this.proxyState.getState(), AuthProtocolState.CHALLENGED);
-        Assert.assertSame(this.creds2, this.proxyState.getCredentials());
-    }
-
-    @Test
     public void testCredentialsProviderNotSet() throws Exception {
         final HttpRequest request = new BasicHttpRequest("GET", "/");
 


[2/2] httpcomponents-client git commit: HTTPCLIENT-1855: disabled caching of DIGEST auth scheme instances due to unreliability of nonce counter when the auth cache is shared by multiple sessions

Posted by ol...@apache.org.
HTTPCLIENT-1855: disabled caching of DIGEST auth scheme instances due to unreliability of nonce counter when the auth cache is shared by multiple sessions


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/1383e1f7
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/1383e1f7
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/1383e1f7

Branch: refs/heads/4.5.x
Commit: 1383e1f781012e767c0cc811aeef77e28264682d
Parents: aa81865
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Fri Oct 20 11:45:12 2017 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Fri Oct 20 11:45:12 2017 +0200

----------------------------------------------------------------------
 .../apache/http/impl/client/AuthenticationStrategyAdaptor.java    | 3 +--
 .../org/apache/http/impl/client/AuthenticationStrategyImpl.java   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/1383e1f7/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AuthenticationStrategyAdaptor.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AuthenticationStrategyAdaptor.java b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AuthenticationStrategyAdaptor.java
index f72ae07..d09b670 100644
--- a/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AuthenticationStrategyAdaptor.java
+++ b/httpclient/src/main/java-deprecated/org/apache/http/impl/client/AuthenticationStrategyAdaptor.java
@@ -167,8 +167,7 @@ class AuthenticationStrategyAdaptor implements AuthenticationStrategy {
             return false;
         }
         final String schemeName = authScheme.getSchemeName();
-        return schemeName.equalsIgnoreCase(AuthPolicy.BASIC) ||
-                schemeName.equalsIgnoreCase(AuthPolicy.DIGEST);
+        return schemeName.equalsIgnoreCase(AuthPolicy.BASIC);
     }
 
     public AuthenticationHandler getHandler() {

http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/1383e1f7/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
----------------------------------------------------------------------
diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java b/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
index 1f35e61..4ca17c3 100644
--- a/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
+++ b/httpclient/src/main/java/org/apache/http/impl/client/AuthenticationStrategyImpl.java
@@ -237,8 +237,7 @@ abstract class AuthenticationStrategyImpl implements AuthenticationStrategy {
             return false;
         }
         final String schemeName = authScheme.getSchemeName();
-        return schemeName.equalsIgnoreCase(AuthSchemes.BASIC) ||
-                schemeName.equalsIgnoreCase(AuthSchemes.DIGEST);
+        return schemeName.equalsIgnoreCase(AuthSchemes.BASIC);
     }
 
     @Override