Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow injection of sessions #1111

Merged
merged 8 commits into from
Sep 23, 2022
Merged

Conversation

MrwanBaghdad
Copy link
Contributor

This PR allows injection of requests.Session objects.
This covers use cases when an end user may want to have more control over the session in case of proxies, custom authentication flows enforced by proxies in front of the Tableau server, and custom headers need to be injected to allow access to the Tableau server.

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @MrwanBaghdad to sign the Salesforce.com Contributor License Agreement.

@MrwanBaghdad
Copy link
Contributor Author

@jacalata Can you please take a look?

@jacalata jacalata changed the base branch from master to development-0.2x September 20, 2022 08:46
@jacalata
Copy link
Contributor

Very nice! We do have another call where it sets _session = requests.Session() in the _set_auth() method - does that need to be overridden or updated somehow as well?

I've also rebased this for you onto our new dev branch.

@jacalata jacalata changed the base branch from development-0.2x to development September 20, 2022 09:17
@MrwanBaghdad
Copy link
Contributor Author

@jacalata That's a good point. I've updated the PR to allow injection of a callable session_factory, which returns a request.Session object when called, that'd allow recreation of request.Session object by the end-user when the _clear_auth is called

@jacalata jacalata merged commit a62ad5a into tableau:development Sep 23, 2022
jacalata added a commit that referenced this pull request Feb 14, 2023
* Allow injection of sessions (#1111)
* show server info (#1118)
* Fix bug in exposing ExcelRequestOptions and test (#1123)
* Fix a few pylint errors (#1124)
* fix behavior when url has no protocol (#1125)
* Add permission control for Data Roles and Metrics (Issue #1063) (#1120)
* add option to pass specific datasources (#1150)
* allow user agent to be set by caller (#1166)
* Fix issues with connections publishing workbooks (#1171)
* Allow download to file-like objects (#1172)
* Add updated_at to JobItem class (#1182)
* fix revision references where xml returned does not match docs (#1176)
* Do not create empty connections list (#1178)
---------

Co-authored-by: Marwan Baghdad <[email protected]>
Co-authored-by: jorwoods <[email protected]>
Co-authored-by: Brian Cantoni <[email protected]>
Co-authored-by: TrimPeachu <[email protected]>
Co-authored-by: Stu Tomlinson <[email protected]>
Co-authored-by: Jeremy Harris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants