mistercrunch commented on a change in pull request #3652: Authentication:
Enable user impersonation for Superset to HiveServer2 using
hive.server2.proxy.user (a.fernandez)
URL:
https://github.com/apache/incubator-superset/pull/3652#discussion_r144464590
##########
File path: superset/db_engine_specs.py
##########
@@ -830,6 +854,34 @@ def _partition_query(
cls, table_name, limit=0, order_by=None, filters=None):
return "SHOW PARTITIONS {table_name}".format(**locals())
+ @classmethod
+ def modify_url_for_impersonation(cls, url, impersonate_user, username):
+ """
+ Modify the SQL Alchemy URL object with the user to impersonate if
applicable.
+ :param url: SQLAlchemy URL object
+ :param impersonate_user: Bool indicating if impersonation is enabled
+ :param username: Effective username
+ """
+ if impersonate_user is True and "auth" in url.query.keys() and
username is not None:
Review comment:
NIT: -`is not None`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services