forked from Isilon/isilon_data_insights_connector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
isi_api_client_7_2.py
33 lines (28 loc) · 1.4 KB
/
isi_api_client_7_2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import isi_api_client
import isi_sdk_7_2
import urllib3
class IsiApiClient_7_2(isi_sdk_7_2.ApiClient, isi_api_client.IsiApiClient):
"""
isi_sdk_7_2 compatible version of a multi-thread and multi-client safe
implementation of the ApiClient. The ApiClient that is generated by Swagger
Codegen uses a singleton for authentication so it won't work for
multi-thread or multi-client scenarios where each thread or client needs to
authenticate with a different Isilon cluster. This version will work
for that situation.
"""
def __init__(self, host, verify_ssl):
# unfortunately there's no way to make the verify_ssl configuration
# work in a multi-thread/client safe way (at least not with the current
# Swagger implementation).
isi_sdk_7_2.configuration.verify_ssl = verify_ssl
super(IsiApiClient_7_2, self).__init__(host=host)
def update_params_for_auth(self, headers, querys, auth_settings):
"""
Overrides the isi_sdk_7_2.ApiClient's version of this function by using
self._username and self._password for BasicAuth instead of
isi_sdk.Configuration().username and isi_sdk.Configuration().password.
"""
headers["Authorization"] = \
urllib3.util.make_headers(
basic_auth=self._username + ":" \
+ self._password).get("authorization")