@@ -55,6 +55,8 @@ class iControlRESTTokenAuth(AuthBase):
5555 BigIP should consult when creating the token.
5656 :param str verify: The path to a CA bundle containing the \
5757 CA certificate for SSL validation
58+ :param proxies: A dict of proxy information for Requests to utilize \
59+ on this connection to the BigIP
5860
5961 If ``username`` is configured locally on the BigIP,
6062 ``login_provider_name`` should be ``"tmos"`` (default). Otherwise
@@ -63,10 +65,11 @@ class iControlRESTTokenAuth(AuthBase):
6365 of ``login_provider_name``.
6466 """
6567 def __init__ (self , username , password , login_provider_name = 'tmos' ,
66- verify = False , auth_provider = None ):
68+ verify = False , auth_provider = None , proxies = None ):
6769 self .username = username
6870 self .password = password
6971 self .login_provider_name = login_provider_name
72+ self .proxies = proxies
7073 self .token = None
7174 self .expiration = None
7275 self .attempts = 0
@@ -95,7 +98,7 @@ def get_auth_providers(self, netloc):
9598 """
9699 url = "https://%s/info/system?null" % (netloc )
97100
98- response = requests .get (url , verify = self .verify )
101+ response = requests .get (url , verify = self .verify , proxies = self . proxies )
99102 if not response .ok or not hasattr (response , "json" ):
100103 error_message = '%s Unexpected Error: %s for uri: %s\n Text: %r' % \
101104 (response .status_code ,
@@ -147,7 +150,8 @@ def get_new_token(self, netloc):
147150 login_url ,
148151 json = login_body ,
149152 verify = self .verify ,
150- auth = HTTPBasicAuth (self .username , self .password )
153+ auth = HTTPBasicAuth (self .username , self .password ),
154+ proxies = self .proxies ,
151155 )
152156 self .attempts += 1
153157 if not response .ok or not hasattr (response , "json" ):
0 commit comments