ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-13899. Support Impersonation for Hive (Henning Kropp via smohanty)
Date Tue, 17 Nov 2015 02:56:47 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b5ad10adc -> 6e69ef00d


AMBARI-13899. Support Impersonation for Hive (Henning Kropp via smohanty)


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

Branch: refs/heads/trunk
Commit: 6e69ef00d39e5d803832d4f74aed9ba3e41bbeca
Parents: b5ad10a
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Mon Nov 16 18:55:36 2015 -0800
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Mon Nov 16 18:55:36 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/ambari/view/hive/client/Connection.java    | 6 ++++++
 .../main/java/org/apache/ambari/view/hive/client/Utils.java    | 1 +
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6e69ef00/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
index 0e42d99..d8210ba 100644
--- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
+++ b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
@@ -476,6 +476,12 @@ public class Connection {
       @Override
       public TOpenSessionResp body() throws HiveClientException {
         TOpenSessionReq openReq = new TOpenSessionReq();
+        Map<String, String> openConf = new HashMap<String, String>();
+        if(authParams.containsKey(Utils.HiveAuthenticationParams.HS2_PROXY_USER)){
+          openConf.put(Utils.HiveAuthenticationParams.HS2_PROXY_USER,
+                       authParams.get(Utils.HiveAuthenticationParams.HS2_PROXY_USER));
+        }
+        openReq.setConfiguration(openConf);
         try {
           return client.OpenSession(openReq);
         } catch (TException e) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e69ef00/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
index cada587..f9efc1c 100644
--- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
+++ b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
@@ -68,6 +68,7 @@ public class Utils {
     public static final String AUTH_SIMPLE = "noSasl";
     public static final String AUTH_TOKEN = "delegationToken";
     public static final String AUTH_USER = "user";
+    public static final String HS2_PROXY_USER = "hive.server2.proxy.user";
     public static final String AUTH_PRINCIPAL = "principal";
     public static final String AUTH_PASSWD = "password";
     public static final String AUTH_KERBEROS_AUTH_TYPE = "kerberosAuthType";


Mime
View raw message