DI-1113. Authentication: Enable user impersonation for Superset to HiveServer2 using hive.server2.proxy.user (a.fernandez) (#3652)

This commit is contained in:
Alejandro Fernandez
2017-10-16 20:15:16 -07:00
committed by Maxime Beauchemin
parent 08f09b4761
commit adef519583
7 changed files with 153 additions and 23 deletions

View File

@@ -276,13 +276,15 @@ class CoreTests(SupersetTestCase):
assert self.get_resp('/health') == "OK"
assert self.get_resp('/ping') == "OK"
def test_testconn(self):
def test_testconn(self, username='admin'):
self.login(username=username)
database = self.get_main_database(db.session)
# validate that the endpoint works with the password-masked sqlalchemy uri
data = json.dumps({
'uri': database.safe_sqlalchemy_uri(),
'name': 'main'
'name': 'main',
'impersonate_user': False
})
response = self.client.post('/superset/testconn', data=data, content_type='application/json')
assert response.status_code == 200
@@ -291,7 +293,8 @@ class CoreTests(SupersetTestCase):
# validate that the endpoint works with the decrypted sqlalchemy uri
data = json.dumps({
'uri': database.sqlalchemy_uri_decrypted,
'name': 'main'
'name': 'main',
'impersonate_user': False
})
response = self.client.post('/superset/testconn', data=data, content_type='application/json')
assert response.status_code == 200