Skip to content

Commit 240d04e

Browse files
committed
Update core submodule so that TLS object is not auto-created. Python SDK now sets TLS to True if api key provided with no TLS configuration (default TLS config)
1 parent 8db5178 commit 240d04e

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

temporalio/envconfig.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,10 @@ def to_client_connect_config(self) -> ClientConnectConfig:
238238
config["namespace"] = self.namespace
239239
if self.api_key is not None:
240240
config["api_key"] = self.api_key
241+
# Enable TLS with default TLS options
242+
config["tls"] = True
241243
if self.tls is not None:
244+
# Use specified TLS options
242245
config["tls"] = self.tls.to_connect_tls_config()
243246
if self.grpc_meta:
244247
config["rpc_metadata"] = self.grpc_meta

tests/test_envconfig.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,13 @@ def test_load_profile_api_key_enables_tls(tmp_path: Path):
223223
config_file.write_text(config_toml)
224224
profile = ClientConfigProfile.load(config_source=config_file)
225225
assert profile.api_key == "my-key"
226-
assert profile.tls is not None
226+
# No TLS object should have been created
227+
assert profile.tls is None
227228

228229
config = profile.to_client_connect_config()
229-
assert config.get("tls")
230+
# Expect to_client_connect_config call to set TLS to True
231+
# due to presence of api key.
232+
assert config.get("tls") is True
230233
assert config.get("api_key") == "my-key"
231234

232235

0 commit comments

Comments
 (0)