hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1351432 - in /hadoop/common/branches/branch-1: CHANGES.txt src/core/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java src/test/org/apache/hadoop/security/authentication/client/TestAuthenticatedURL.java
Date Mon, 18 Jun 2012 18:04:18 GMT
Author: tucu
Date: Mon Jun 18 18:04:18 2012
New Revision: 1351432

URL: http://svn.apache.org/viewvc?rev=1351432&view=rev
Log:
HADOOP-8512. AuthenticatedURL should reset the Token when the server returns other than OK
on authentication (tucu)

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/core/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
    hadoop/common/branches/branch-1/src/test/org/apache/hadoop/security/authentication/client/TestAuthenticatedURL.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1351432&r1=1351431&r2=1351432&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Mon Jun 18 18:04:18 2012
@@ -31,6 +31,9 @@ Release 1.2.0 - unreleased
     MAPREDUCE-3727. jobtoken location property in jobconf refers to wrong 
     jobtoken file (tucu)
 
+    HADOOP-8512. AuthenticatedURL should reset the Token when the server 
+    returns other than OK on authentication (tucu)
+
 Release 1.1.0 - unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1/src/core/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/core/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java?rev=1351432&r1=1351431&r2=1351432&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/core/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
(original)
+++ hadoop/common/branches/branch-1/src/core/org/apache/hadoop/security/authentication/client/AuthenticatedURL.java
Mon Jun 18 18:04:18 2012
@@ -266,6 +266,7 @@ public class AuthenticatedURL {
         }
       }
     } else {
+      token.set(null);
       throw new AuthenticationException("Authentication failed, status: " + conn.getResponseCode()
+
                                         ", message: " + conn.getResponseMessage());
     }

Modified: hadoop/common/branches/branch-1/src/test/org/apache/hadoop/security/authentication/client/TestAuthenticatedURL.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/test/org/apache/hadoop/security/authentication/client/TestAuthenticatedURL.java?rev=1351432&r1=1351431&r2=1351432&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/test/org/apache/hadoop/security/authentication/client/TestAuthenticatedURL.java
(original)
+++ hadoop/common/branches/branch-1/src/test/org/apache/hadoop/security/authentication/client/TestAuthenticatedURL.java
Mon Jun 18 18:04:18 2012
@@ -13,6 +13,7 @@
  */
 package org.apache.hadoop.security.authentication.client;
 
+import junit.framework.Assert;
 import junit.framework.TestCase;
 import org.mockito.Mockito;
 
@@ -100,11 +101,14 @@ public class TestAuthenticatedURL extend
     headers.put("Set-Cookie", cookies);
     Mockito.when(conn.getHeaderFields()).thenReturn(headers);
 
+    AuthenticatedURL.Token token = new AuthenticatedURL.Token();
+    token.set("bar");
     try {
-      AuthenticatedURL.extractToken(conn, new AuthenticatedURL.Token());
+      AuthenticatedURL.extractToken(conn, token);
       fail();
     } catch (AuthenticationException ex) {
       // Expected
+      Assert.assertFalse(token.isSet());
     } catch (Exception ex) {
       fail();
     }



Mime
View raw message