@@ -119,7 +119,8 @@ def __repr__(self):
119119class DropboxOAuth2FlowBase (object ):
120120
121121 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 ):
123124 if scope is not None and (len (scope ) == 0 or not isinstance (scope , list )):
124125 raise BadInputException ("Scope list must be of type list" )
125126 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
134135 self .consumer_secret = consumer_secret
135136 self .locale = locale
136137 self .token_access_type = token_access_type
137- self .requests_session = pinned_session ()
138+ self .requests_session = pinned_session (ca_certs = ca_certs )
138139 self .scope = scope
139140 self .include_granted_scopes = include_granted_scopes
140141 self ._timeout = timeout
@@ -273,7 +274,8 @@ class DropboxOAuth2FlowNoRedirect(DropboxOAuth2FlowBase):
273274 """
274275
275276 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;
277279 """
278280 Construct an instance.
279281
@@ -306,6 +308,8 @@ def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access
306308 client will wait for any single packet from the server. After the timeout the client
307309 will give up on connection. If `None`, client will wait forever. Defaults
308310 to 100 seconds.
311+ :param str ca_cert: path to CA certificate. If left blank, default certificate location \
312+ will be used
309313 """
310314 super (DropboxOAuth2FlowNoRedirect , self ).__init__ (
311315 consumer_key = consumer_key ,
@@ -315,7 +319,8 @@ def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access
315319 scope = scope ,
316320 include_granted_scopes = include_granted_scopes ,
317321 use_pkce = use_pkce ,
318- timeout = timeout
322+ timeout = timeout ,
323+ ca_certs = ca_certs
319324 )
320325
321326 def start (self ):
@@ -360,7 +365,8 @@ class DropboxOAuth2Flow(DropboxOAuth2FlowBase):
360365 def __init__ (self , consumer_key , redirect_uri , session ,
361366 csrf_token_session_key , consumer_secret = None , locale = None ,
362367 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 ):
364370 """
365371 Construct an instance.
366372
@@ -399,6 +405,8 @@ def __init__(self, consumer_key, redirect_uri, session,
399405 :param Optional[float] timeout: Maximum duration in seconds that client will wait for any
400406 single packet from the server. After the timeout the client will give up on connection.
401407 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
402410 """
403411
404412 super (DropboxOAuth2Flow , self ).__init__ (
@@ -409,7 +417,8 @@ def __init__(self, consumer_key, redirect_uri, session,
409417 scope = scope ,
410418 include_granted_scopes = include_granted_scopes ,
411419 use_pkce = use_pkce ,
412- timeout = timeout
420+ timeout = timeout ,
421+ ca_certs = ca_certs
413422 )
414423 self .redirect_uri = redirect_uri
415424 self .session = session
0 commit comments