Skip to content

Commit 8cc3d26

Browse files
authored
Merge pull request #130 from gauravsaralMs/users/gsaral/forceMsaPassThroughOption
adding option to enable force msa pass through header
2 parents 03207b0 + c370f03 commit 8cc3d26

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

vsts/vsts/git/v4_0/git_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def get_vsts_info(self, relative_remote_url):
2727
headers = {'Accept': 'application/json'}
2828
if self._suppress_fedauth_redirect:
2929
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
30+
if self._force_msa_pass_through:
31+
headers['X-VSS-ForceMsaPassThrough'] = 'true'
3032
response = self._send_request(request, headers)
3133
return self._deserialize('VstsInfo', response)
3234

vsts/vsts/git/v4_1/git_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ def get_vsts_info(self, relative_remote_url):
2626
headers = {'Accept': 'application/json'}
2727
if self._suppress_fedauth_redirect:
2828
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
29+
if self._force_msa_pass_through:
30+
headers['X-VSS-ForceMsaPassThrough'] = 'true'
2931
response = self._send_request(request, headers)
3032
return self._deserialize('VstsInfo', response)

vsts/vsts/vss_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def __init__(self, base_url=None, creds=None):
3838
self._all_host_types_locations = None
3939
self._locations = None
4040
self._suppress_fedauth_redirect = True
41+
self._force_msa_pass_through = True
4142
self.normalized_url = VssClient._normalize_url(base_url)
4243

4344
def add_user_agent(self, user_agent):
@@ -88,6 +89,8 @@ def _send(self, http_method, location_id, version, route_values=None,
8889
headers[key] = self.config.additional_headers[key]
8990
if self._suppress_fedauth_redirect:
9091
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
92+
if self._force_msa_pass_through:
93+
headers['X-VSS-ForceMsaPassThrough'] = 'true'
9194
if VssClient._session_header_key in VssClient._session_data and VssClient._session_header_key not in headers:
9295
headers[VssClient._session_header_key] = VssClient._session_data[VssClient._session_header_key]
9396
response = self._send_request(request=request, headers=headers, content=content)
@@ -173,6 +176,8 @@ def _get_resource_locations(self, all_host_types):
173176
headers = {'Accept': 'application/json'}
174177
if self._suppress_fedauth_redirect:
175178
headers['X-TFS-FedAuthRedirect'] = 'Suppress'
179+
if self._force_msa_pass_through:
180+
headers['X-VSS-ForceMsaPassThrough'] = 'true'
176181
response = self._send_request(request, headers=headers)
177182
wrapper = self._base_deserialize('VssJsonCollectionWrapper', response)
178183
if wrapper is None:

0 commit comments

Comments
 (0)