@@ -119,7 +119,8 @@ def __repr__(self):
119
119
class DropboxOAuth2FlowBase (object ):
120
120
121
121
def __init__ (self , consumer_key , consumer_secret = None , locale = None , token_access_type = None ,
122
- scope = None , include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ):
122
+ scope = None , include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ,
123
+ ca_certs = None ):
123
124
if scope is not None and (len (scope ) == 0 or not isinstance (scope , list )):
124
125
raise BadInputException ("Scope list must be of type list" )
125
126
if token_access_type is not None and token_access_type not in TOKEN_ACCESS_TYPES :
@@ -134,7 +135,7 @@ def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access
134
135
self .consumer_secret = consumer_secret
135
136
self .locale = locale
136
137
self .token_access_type = token_access_type
137
- self .requests_session = pinned_session ()
138
+ self .requests_session = pinned_session (ca_certs = ca_certs )
138
139
self .scope = scope
139
140
self .include_granted_scopes = include_granted_scopes
140
141
self ._timeout = timeout
@@ -273,7 +274,8 @@ class DropboxOAuth2FlowNoRedirect(DropboxOAuth2FlowBase):
273
274
"""
274
275
275
276
def __init__ (self , consumer_key , consumer_secret = None , locale = None , token_access_type = None ,
276
- scope = None , include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ): # noqa: E501;
277
+ scope = None , include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ,
278
+ ca_certs = None ): # noqa: E501;
277
279
"""
278
280
Construct an instance.
279
281
@@ -306,6 +308,8 @@ def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access
306
308
client will wait for any single packet from the server. After the timeout the client
307
309
will give up on connection. If `None`, client will wait forever. Defaults
308
310
to 100 seconds.
311
+ :param str ca_cert: path to CA certificate. If left blank, default certificate location \
312
+ will be used
309
313
"""
310
314
super (DropboxOAuth2FlowNoRedirect , self ).__init__ (
311
315
consumer_key = consumer_key ,
@@ -315,7 +319,8 @@ def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access
315
319
scope = scope ,
316
320
include_granted_scopes = include_granted_scopes ,
317
321
use_pkce = use_pkce ,
318
- timeout = timeout
322
+ timeout = timeout ,
323
+ ca_certs = ca_certs
319
324
)
320
325
321
326
def start (self ):
@@ -360,7 +365,8 @@ class DropboxOAuth2Flow(DropboxOAuth2FlowBase):
360
365
def __init__ (self , consumer_key , redirect_uri , session ,
361
366
csrf_token_session_key , consumer_secret = None , locale = None ,
362
367
token_access_type = None , scope = None ,
363
- include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ):
368
+ include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ,
369
+ ca_certs = None ):
364
370
"""
365
371
Construct an instance.
366
372
@@ -399,6 +405,8 @@ def __init__(self, consumer_key, redirect_uri, session,
399
405
:param Optional[float] timeout: Maximum duration in seconds that client will wait for any
400
406
single packet from the server. After the timeout the client will give up on connection.
401
407
If `None`, client will wait forever. Defaults to 100 seconds.
408
+ :param str ca_cert: path to CA certificate. If left blank, default certificate location \
409
+ will be used
402
410
"""
403
411
404
412
super (DropboxOAuth2Flow , self ).__init__ (
@@ -409,7 +417,8 @@ def __init__(self, consumer_key, redirect_uri, session,
409
417
scope = scope ,
410
418
include_granted_scopes = include_granted_scopes ,
411
419
use_pkce = use_pkce ,
412
- timeout = timeout
420
+ timeout = timeout ,
421
+ ca_certs = ca_certs
413
422
)
414
423
self .redirect_uri = redirect_uri
415
424
self .session = session
0 commit comments