فهرست منبع

HUE-2247 [Impala] Support pass-through LDAP authentication

Ben White 11 سال پیش
والد
کامیت
d5c845ed1a

+ 11 - 6
apps/beeswax/src/beeswax/server/hive_server2_lib.py

@@ -351,9 +351,13 @@ class HiveServerClient:
       kerberos_principal_short_name = None
 
     if self.query_server['server_name'] == 'impala':
-      cluster_conf = cluster.get_cluster_conf_for_job_submission()
-      use_sasl = cluster_conf is not None and cluster_conf.SECURITY_ENABLED.get()
-      mechanism = HiveServerClient.HS2_MECHANISMS['KERBEROS']
+      if LDAP_PASSWORD.get(): # Force LDAP auth if ldap_password is provided
+        use_sasl = True
+        mechanism = HiveServerClient.HS2_MECHANISMS['NONE']
+      else:
+        cluster_conf = cluster.get_cluster_conf_for_job_submission()
+        use_sasl = cluster_conf is not None and cluster_conf.SECURITY_ENABLED.get()
+        mechanism = HiveServerClient.HS2_MECHANISMS['KERBEROS']
       impersonation_enabled = self.query_server['impersonation_enabled']
     else:
       hive_mechanism = hive_site.get_hiveserver2_authentication()
@@ -362,9 +366,10 @@ class HiveServerClient:
       use_sasl = hive_mechanism in ('KERBEROS', 'NONE')
       mechanism = HiveServerClient.HS2_MECHANISMS[hive_mechanism]
       impersonation_enabled = hive_site.hiveserver2_impersonation_enabled()
-      if LDAP_PASSWORD.get(): # HiveServer2 supports pass-through LDAP authentication.
-        ldap_username = LDAP_USERNAME.get()
-        ldap_password = LDAP_PASSWORD.get()
+
+    if LDAP_PASSWORD.get(): # Pass-through LDAP authentication
+      ldap_username = LDAP_USERNAME.get()
+      ldap_password = LDAP_PASSWORD.get()
 
     return use_sasl, mechanism, kerberos_principal_short_name, impersonation_enabled, ldap_username, ldap_password
 

+ 2 - 1
desktop/conf.dist/hue.ini

@@ -69,7 +69,8 @@
   # See http://www.openssl.org/docs/apps/ciphers.html for more information on cipher list format.
   ## ssl_cipher_list=DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2
 
-  # LDAP username and password of the hue user used for LDAP authentications. For example for LDAP Authentication with HiveServer2.
+  # LDAP username and password of the hue user used for LDAP authentications.
+  # Set it to use LDAP Authentication with HiveServer2 and Impala.
   ## ldap_username=hue
   ## ldap_password=
 

+ 2 - 1
desktop/conf/pseudo-distributed.ini.tmpl

@@ -78,7 +78,8 @@
   # See http://www.openssl.org/docs/apps/ciphers.html for more information on cipher list format.
   ## ssl_cipher_list=DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2
 
-  # LDAP username and password of the hue user used for LDAP authentications. For example for LDAP Authentication with HiveServer2.
+  # LDAP username and password of the hue user used for LDAP authentications.
+  # Set it to use LDAP Authentication with HiveServer2 and Impala.
   ## ldap_username=hue
   ## ldap_password=
 

+ 2 - 2
desktop/core/src/desktop/conf.py

@@ -85,13 +85,13 @@ SSL_CIPHER_LIST = Config(
 
 LDAP_PASSWORD = Config(
   key="ldap_password",
-  help=_("LDAP password of the hue user used for LDAP authentications. For example for LDAP Authentication with HiveServer2."),
+  help=_("LDAP password of the hue user used for LDAP authentications. For example for LDAP Authentication with HiveServer2/Impala."),
   private=True,
   default=None)
 
 LDAP_USERNAME = Config(
   key="ldap_username",
-  help=_("LDAP username of the hue user used for LDAP authentications. For example for LDAP Authentication with HiveServer2."),
+  help=_("LDAP username of the hue user used for LDAP authentications. For example for LDAP Authentication with HiveServer2/Impala."),
   private=True,
   default="hue")