Skip to content

Commit

Permalink
Merge pull request #56 from bryantbhowell/4.9.3
Browse files Browse the repository at this point in the history
Added a swap_token() method to TableauRestApiConnection to help with wrapped REST API services where you might need to switch between many different user tokens on the backend
  • Loading branch information
Bryant Howell authored May 7, 2019
2 parents 05255f8 + 294752f commit 67ea06a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='tableau_tools',
version='4.9.2',
version='4.9.3',
packages=['tableau_tools', 'tableau_tools.tableau_rest_api', 'tableau_tools.tableau_documents', 'tableau_tools.examples'],
url='https://github.com/bryantbhowell/tableau_tools',
license='',
Expand Down
18 changes: 18 additions & 0 deletions tableau_rest_api/tableau_rest_api_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,24 @@ def signin(self, user_luid_to_impersonate=None):
self._request_obj.xml_request = None
self.end_log_block()

def swap_token(self, site_luid, user_luid, token):
"""
:type token: unicode
:type site_luid: unicode
:type user_luid: unicode
:return:
"""
self.start_log_block()
self.token = token
self.site_luid = site_luid
self.user_luid = user_luid
if self._request_obj is None:
self._request_obj = RestXmlRequest(None, self.token, self.logger, ns_map_url=self.ns_map['t'],
verify_ssl_cert=self.verify_ssl_cert)
else:
self._request_obj.token = self.token
self.end_log_block()

def signout(self, session_token=None):
"""
:type session_token: unicode
Expand Down

0 comments on commit 67ea06a

Please sign in to comment.