hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject [01/12] git commit: HADOOP-11083. After refactoring of HTTP proxyuser to common, doAs param is case sensitive. (tucu)
Date Sat, 13 Sep 2014 06:57:41 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HDFS-6584 dc27ee9ae -> dba52ce0b


HADOOP-11083. After refactoring of HTTP proxyuser to common, doAs param is case sensitive.
(tucu)


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

Branch: refs/heads/HDFS-6584
Commit: c656d7d6e53436bf082f76e5988e39d8e18ed64f
Parents: 581176c
Author: Alejandro Abdelnur <tucu@apache.org>
Authored: Thu Sep 11 13:53:31 2014 -0700
Committer: Alejandro Abdelnur <tucu@apache.org>
Committed: Thu Sep 11 13:53:31 2014 -0700

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt    |  3 +++
 .../web/DelegationTokenAuthenticationFilter.java   |  3 ++-
 .../delegation/web/TestWebDelegationToken.java     | 17 +++++++++++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c656d7d6/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 3bf92ec..f7cbc8c 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -787,6 +787,9 @@ Release 2.6.0 - UNRELEASED
     HADOOP-11085. Excessive logging by org.apache.hadoop.util.Progress when
     value is NaN (Mit Desai via jlowe)
 
+    HADOOP-11083. After refactoring of HTTP proxyuser to common, doAs param is 
+    case sensitive. (tucu)
+
 Release 2.5.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c656d7d6/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticationFilter.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticationFilter.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticationFilter.java
index 37474e9..64a5622 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticationFilter.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/delegation/web/DelegationTokenAuthenticationFilter.java
@@ -188,7 +188,8 @@ public class DelegationTokenAuthenticationFilter
         UTF8_CHARSET);
     if (list != null) {
       for (NameValuePair nv : list) {
-        if (DelegationTokenAuthenticatedURL.DO_AS.equals(nv.getName())) {
+        if (DelegationTokenAuthenticatedURL.DO_AS.
+            equalsIgnoreCase(nv.getName())) {
           return nv.getValue();
         }
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c656d7d6/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
index 118abff..189a334 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/token/delegation/web/TestWebDelegationToken.java
@@ -795,6 +795,23 @@ public class TestWebDelegationToken {
       jetty.start();
       final URL url = new URL(getJettyURL() + "/foo/bar");
 
+      // proxyuser using raw HTTP, verifying doAs is case insensitive
+      String strUrl = String.format("%s?user.name=%s&doas=%s", 
+          url.toExternalForm(), FOO_USER, OK_USER);
+      HttpURLConnection conn = 
+          (HttpURLConnection) new URL(strUrl).openConnection();
+      Assert.assertEquals(HttpURLConnection.HTTP_OK, conn.getResponseCode());
+      List<String> ret = IOUtils.readLines(conn.getInputStream());
+      Assert.assertEquals(1, ret.size());
+      Assert.assertEquals(OK_USER, ret.get(0));
+      strUrl = String.format("%s?user.name=%s&DOAS=%s", url.toExternalForm(), 
+          FOO_USER, OK_USER);
+      conn = (HttpURLConnection) new URL(strUrl).openConnection();
+      Assert.assertEquals(HttpURLConnection.HTTP_OK, conn.getResponseCode());
+      ret = IOUtils.readLines(conn.getInputStream());
+      Assert.assertEquals(1, ret.size());
+      Assert.assertEquals(OK_USER, ret.get(0));
+
       UserGroupInformation ugi = UserGroupInformation.createRemoteUser(FOO_USER);
       ugi.doAs(new PrivilegedExceptionAction<Void>() {
         @Override


Mime
View raw message