You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2016/07/26 20:30:14 UTC

[1/2] hive git commit: HIVE-14316 : TestLlapTokenChecker.testCheckPermissions, testGetToken fail (Sergey Shelukhin, reviewed by Siddharth Seth)

Repository: hive
Updated Branches:
  refs/heads/branch-2.1 186e11b69 -> 6a7bc534a
  refs/heads/master 87bc121a4 -> 9500f23af


HIVE-14316 : TestLlapTokenChecker.testCheckPermissions, testGetToken fail (Sergey Shelukhin, reviewed by Siddharth Seth)


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

Branch: refs/heads/master
Commit: 9500f23afa435934e9bfba30f9085de5bf34ef0b
Parents: 87bc121
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue Jul 26 13:24:37 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue Jul 26 13:24:37 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hive/llap/daemon/impl/LlapTokenChecker.java      | 9 ++++++---
 .../org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java  | 1 -
 .../hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java  | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/9500f23a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
index 0a688f8..beb5c7f 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
@@ -118,6 +118,9 @@ public final class LlapTokenChecker {
   @VisibleForTesting
   static void checkPermissionsInternal(String kerberosName, List<LlapTokenIdentifier> tokens,
       String userName, String appId, Object hint) {
+    if (appId == null) {
+      appId = "";
+    }
     if (kerberosName != null && StringUtils.isBlank(appId) && kerberosName.equals(userName)) {
       return;
     }
@@ -127,8 +130,8 @@ public final class LlapTokenChecker {
         if (checkTokenPermissions(userName, appId, tokenUser, tokenAppId)) return;
       }
     }
-    throw new SecurityException("Unauthorized to access "
-        + userName + ", " + appId.hashCode() + " (" + hint + ")");
+    throw new SecurityException(
+        "Unauthorized to access " + userName + ", " + appId + " (" + hint + ")");
   }
 
   public static void checkPermissions(
@@ -139,7 +142,7 @@ public final class LlapTokenChecker {
     }
     if (!checkTokenPermissions(userName, appId, prm.userName, prm.appId)) {
       throw new SecurityException("Unauthorized to access "
-          + userName + ", " + appId.hashCode() + " (" + hint + ")");
+          + userName + ", " + appId + " (" + hint + ")");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/9500f23a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
index 8e5735f..5c7d4ef 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
@@ -33,7 +33,6 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Multimap;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hive.llap.LlapUtil;
 import org.apache.hadoop.hive.llap.daemon.FinishableStateUpdateHandler;
 import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SignableVertexSpec;
 import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SourceStateProto;

http://git-wip-us.apache.org/repos/asf/hive/blob/9500f23a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
----------------------------------------------------------------------
diff --git a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
index d4ded23..26d0b9b 100644
--- a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
+++ b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
@@ -65,7 +65,7 @@ public class TestLlapTokenChecker {
   private List<LlapTokenIdentifier> createTokens(String... args) {
     List<LlapTokenIdentifier> tokens = new ArrayList<>();
     for (int i = 0; i < args.length; i += 2) {
-      tokens.add(new LlapTokenIdentifier(null, null, new Text(args[i]), "c", args[i + 1], false));
+      tokens.add(new LlapTokenIdentifier(new Text(args[i]), null, null, "c", args[i + 1], false));
     }
     return tokens;
   }


[2/2] hive git commit: HIVE-14316 : TestLlapTokenChecker.testCheckPermissions, testGetToken fail (Sergey Shelukhin, reviewed by Siddharth Seth)

Posted by se...@apache.org.
HIVE-14316 : TestLlapTokenChecker.testCheckPermissions, testGetToken fail (Sergey Shelukhin, reviewed by Siddharth Seth)


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

Branch: refs/heads/branch-2.1
Commit: 6a7bc534a0b5493f9f60b529fbdcabe720a2dd31
Parents: 186e11b
Author: Sergey Shelukhin <se...@apache.org>
Authored: Tue Jul 26 13:24:37 2016 -0700
Committer: Sergey Shelukhin <se...@apache.org>
Committed: Tue Jul 26 13:28:18 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hive/llap/daemon/impl/LlapTokenChecker.java      | 9 ++++++---
 .../hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java  | 2 +-
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/6a7bc534/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
index 0a688f8..beb5c7f 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
@@ -118,6 +118,9 @@ public final class LlapTokenChecker {
   @VisibleForTesting
   static void checkPermissionsInternal(String kerberosName, List<LlapTokenIdentifier> tokens,
       String userName, String appId, Object hint) {
+    if (appId == null) {
+      appId = "";
+    }
     if (kerberosName != null && StringUtils.isBlank(appId) && kerberosName.equals(userName)) {
       return;
     }
@@ -127,8 +130,8 @@ public final class LlapTokenChecker {
         if (checkTokenPermissions(userName, appId, tokenUser, tokenAppId)) return;
       }
     }
-    throw new SecurityException("Unauthorized to access "
-        + userName + ", " + appId.hashCode() + " (" + hint + ")");
+    throw new SecurityException(
+        "Unauthorized to access " + userName + ", " + appId + " (" + hint + ")");
   }
 
   public static void checkPermissions(
@@ -139,7 +142,7 @@ public final class LlapTokenChecker {
     }
     if (!checkTokenPermissions(userName, appId, prm.userName, prm.appId)) {
       throw new SecurityException("Unauthorized to access "
-          + userName + ", " + appId.hashCode() + " (" + hint + ")");
+          + userName + ", " + appId + " (" + hint + ")");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/6a7bc534/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
----------------------------------------------------------------------
diff --git a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
index d4ded23..26d0b9b 100644
--- a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
+++ b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
@@ -65,7 +65,7 @@ public class TestLlapTokenChecker {
   private List<LlapTokenIdentifier> createTokens(String... args) {
     List<LlapTokenIdentifier> tokens = new ArrayList<>();
     for (int i = 0; i < args.length; i += 2) {
-      tokens.add(new LlapTokenIdentifier(null, null, new Text(args[i]), "c", args[i + 1], false));
+      tokens.add(new LlapTokenIdentifier(new Text(args[i]), null, null, "c", args[i + 1], false));
     }
     return tokens;
   }