Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion gooddata-sdk/gooddata_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from __future__ import annotations

from pathlib import Path
from typing import Optional

import gooddata_api_client as api_client
Expand All @@ -25,6 +26,7 @@ def __init__(
custom_headers: Optional[dict[str, str]] = None,
extra_user_agent: Optional[str] = None,
executions_cancellable: bool = False,
ssl_ca_cert: Optional[str] = None,
) -> None:
"""Take url, token for connecting to GoodData.CN.

Expand All @@ -45,7 +47,14 @@ def __init__(

user_agent = f"{USER_AGENT} {extra_user_agent}" if extra_user_agent is not None else USER_AGENT

self._api_config = api_client.Configuration(host=host)
if ssl_ca_cert is not None:
ssl_ca_cert_path = Path(ssl_ca_cert)
if not ssl_ca_cert_path.exists():
raise ValueError(
f"ssl_ca_cert file path specified but the file does not exist. Path: {ssl_ca_cert_path}."
)

self._api_config = api_client.Configuration(host=host, ssl_ca_cert=ssl_ca_cert)
self._api_client = api_client.ApiClient(
configuration=self._api_config,
header_name="Authorization",
Expand Down
2 changes: 2 additions & 0 deletions gooddata-sdk/gooddata_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def create(
token_: str,
extra_user_agent_: Optional[str] = None,
*,
ssl_ca_cert: Optional[str] = None,
executions_cancellable: bool = False,
**custom_headers_: Optional[str],
) -> GoodDataSdk:
Expand All @@ -64,6 +65,7 @@ def create(
custom_headers=filtered_headers,
extra_user_agent=extra_user_agent_,
executions_cancellable=executions_cancellable,
ssl_ca_cert=ssl_ca_cert,
)
return cls(client)

Expand Down
Loading