33
44from __future__ import annotations
55
6+ from pathlib import Path
67from typing import Optional
78
89import gooddata_api_client as api_client
@@ -25,6 +26,7 @@ def __init__(
2526 custom_headers : Optional [dict [str , str ]] = None ,
2627 extra_user_agent : Optional [str ] = None ,
2728 executions_cancellable : bool = False ,
29+ ssl_ca_cert : Optional [str ] = None ,
2830 ) -> None :
2931 """Take url, token for connecting to GoodData.CN.
3032
@@ -45,7 +47,14 @@ def __init__(
4547
4648 user_agent = f"{ USER_AGENT } { extra_user_agent } " if extra_user_agent is not None else USER_AGENT
4749
48- self ._api_config = api_client .Configuration (host = host )
50+ if ssl_ca_cert is not None :
51+ ssl_ca_cert_path = Path (ssl_ca_cert )
52+ if not ssl_ca_cert_path .exists ():
53+ raise ValueError (
54+ f"ssl_ca_cert file path specified but the file does not exist. Path: { ssl_ca_cert_path } ."
55+ )
56+
57+ self ._api_config = api_client .Configuration (host = host , ssl_ca_cert = ssl_ca_cert )
4958 self ._api_client = api_client .ApiClient (
5059 configuration = self ._api_config ,
5160 header_name = "Authorization" ,
0 commit comments