external-systems 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of external-systems might be problematic. Click here for more details.

@@ -16,4 +16,4 @@
16
16
  # The version is set during the publishing step (since we can't know the version in advance)
17
17
  # using the autorelease bot
18
18
 
19
- __version__ = "0.1.0"
19
+ __version__ = "0.2.0"
@@ -29,6 +29,7 @@ from ._connections import HttpsConnection
29
29
  from ._proxies import create_proxy_session
30
30
  from ._refreshable import DefaultSessionCredentialsManager, Refreshable, RefreshHandler
31
31
  from ._sockets import create_socket
32
+ from ._utils import read_file
32
33
 
33
34
  log = logging.getLogger(__name__)
34
35
 
@@ -46,6 +47,7 @@ class Source:
46
47
  egress_proxy_token: Optional[str],
47
48
  source_configuration: Optional[Any],
48
49
  credentials_refresh_handler: Optional[RefreshHandler[SourceCredentials]] = None,
50
+ ca_bundle_path: Optional[str] = None,
49
51
  ):
50
52
  self._source_parameters = source_parameters
51
53
  self._on_prem_proxy_service_uris = on_prem_proxy_service_uris
@@ -53,6 +55,7 @@ class Source:
53
55
  self._source_configuration = source_configuration
54
56
  self._egress_proxy_token = egress_proxy_token
55
57
  self._credentials_refresh_handler = credentials_refresh_handler
58
+ self._custom_ca_bundle_path = ca_bundle_path
56
59
 
57
60
  @cached_property
58
61
  def secrets(self) -> Mapping[str, str]:
@@ -84,11 +87,17 @@ class Source:
84
87
 
85
88
  new_ca_contents = []
86
89
 
87
- # If requests env var is set, add all existing CAs
88
- requests_ca_bundle_path = os.environ.get("REQUESTS_CA_BUNDLE")
89
- if requests_ca_bundle_path is not None:
90
- with open(requests_ca_bundle_path) as requests_ca_bundle_file:
91
- new_ca_contents.append(requests_ca_bundle_file.read())
90
+ # If a custom CA bundle path is provided, use it.
91
+ # Otherwise, use the requests CA bundle path if it is set.
92
+ ca_bundle_path = (
93
+ self._custom_ca_bundle_path
94
+ if self._custom_ca_bundle_path is not None
95
+ else os.environ.get("REQUESTS_CA_BUNDLE")
96
+ )
97
+
98
+ # Copy the CA bundle contents to the new CA bundle file.
99
+ if ca_bundle_path:
100
+ new_ca_contents.append(read_file(ca_bundle_path))
92
101
 
93
102
  # Add all CAs for the source
94
103
  for required_ca in self._source_parameters.server_certificates.values():
@@ -23,3 +23,8 @@ def has_expiration_property(source_credentials: SourceCredentials) -> bool:
23
23
  """
24
24
 
25
25
  return hasattr(source_credentials, "expiration")
26
+
27
+
28
+ def read_file(path: str) -> str:
29
+ with open(path) as file:
30
+ return file.read()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: external-systems
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: A Python library for interacting with Foundry Sources
5
5
  License: Apache-2.0
6
6
  Keywords: Palantir,Foundry,Sources,Compute Modules,Python Functions,Transforms
@@ -22,7 +22,7 @@ Description-Content-Type: text/markdown
22
22
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/external-systems)
23
23
  [![PyPI](https://img.shields.io/pypi/v/external-systems)](https://pypi.org/project/external-systems/)
24
24
  [![License](https://img.shields.io/badge/License-Apache%202.0-lightgrey.svg)](https://opensource.org/licenses/Apache-2.0)
25
-
25
+ <a href="https://autorelease.general.dmz.palantir.tech/palantir/external-systems"><img src="https://img.shields.io/badge/Perform%20an-Autorelease-success.svg" alt="Autorelease"></a>
26
26
 
27
27
  > [!WARNING]
28
28
  > This SDK is incubating and subject to change.
@@ -1,5 +1,5 @@
1
1
  external_systems/__init__.py,sha256=xXDUDD6_qRO-nHuXZx-fXp0R0vc3N_OOsB1F5mF_kpU,651
2
- external_systems/_version.py,sha256=edsEuFM8fnpvqgnm1a9kDAaQcgfl58B_iUMYwpkVdRw,747
2
+ external_systems/_version.py,sha256=0lRj_OZOFZq3DBCkEhXRBxwz0CJxq1Napd0Pbl0sZXk,747
3
3
  external_systems/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  external_systems/sources/__init__.py,sha256=aqXbMIy_pnyIC1uPRzQfApLCbhYB4N8iRFnpOX4RdAk,1156
5
5
  external_systems/sources/_api.py,sha256=NV7oNIgzSWz4ROFW8uPpUJjDN5vfFzdTs3yKC37S39k,3262
@@ -7,9 +7,9 @@ external_systems/sources/_connections.py,sha256=h82npEks29NALAAfMHrXcSnB7TY_OLeX
7
7
  external_systems/sources/_proxies.py,sha256=igWRL-kpQ_IlZyJwI_s66rDe0oQ68ltGeFNydgoiR4w,5071
8
8
  external_systems/sources/_refreshable.py,sha256=0pa5XW0_2gTMW-ZymKhlhh3Kka_bWTWffThKvrTTifc,4421
9
9
  external_systems/sources/_sockets.py,sha256=oCCUEpLvHLhYXljRiBc11YAWJCZOd-wpUFjl8CaueX0,4285
10
- external_systems/sources/_sources.py,sha256=fYEkVOVCuEHpJytRWw-TCXzHmefoAhAny5853fONajU,10529
11
- external_systems/sources/_utils.py,sha256=_GDyJOzPHQudEbrPsRhXMs8u6AaHpgJQIq8H9xSYJZk,913
12
- external_systems-0.1.0.dist-info/LICENSE.txt,sha256=NAk6Uc9K_N_J5V75k9qECpzUnO-ujT-mKK_jk_mboUE,569
13
- external_systems-0.1.0.dist-info/METADATA,sha256=isfctYmHoIoGFyNpoFu1W0GqOyW-mTK79UG1nvsVVMI,2513
14
- external_systems-0.1.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
15
- external_systems-0.1.0.dist-info/RECORD,,
10
+ external_systems/sources/_sources.py,sha256=zb3QTACRR0MV0y2KZFXPdmWrZAQyrvLaaJ53wnqpP1E,10800
11
+ external_systems/sources/_utils.py,sha256=EmUKKiKRDOZ2cZs7FZ4qCSan_lq1K_tquh3kxleB-jA,1004
12
+ external_systems-0.2.0.dist-info/LICENSE.txt,sha256=NAk6Uc9K_N_J5V75k9qECpzUnO-ujT-mKK_jk_mboUE,569
13
+ external_systems-0.2.0.dist-info/METADATA,sha256=4DYu6tUbWETeeerDDAgLdr_ySu0pSew0O-OOvTsLx6w,2694
14
+ external_systems-0.2.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
15
+ external_systems-0.2.0.dist-info/RECORD,,