temporal-python-sdk
temporal-python-sdk copied to clipboard
Add mTLS authentication support
Adds support for specifying TLS options for mTLS authentication during workflow client creation.
Tested against mTLS-enabled server @ 1.10.5 and mTLS-disabled server @ 1.7.0.
For SSLContext reference, see grpclib mTLS client example
Related to #7
Changes:
- Adds
TLSOptionsdataclass - Adds
tls_optionskwarg toWorkflowClient.new_clientmethod - If
TLSOptionsprovided, createsSSLContext - If
SSLContextcreated, providesSSLContexttogrcplib.client.Channel
Minimal config example:
from temporal.service_helpers import TLSOptions
from temporal.workflow import WorkflowClient
client = WorkflowClient.new_client(
host="temporal.local",
port=7233,
tls_options=TLSOptions(
ca_cert="/path/to/ca-cert",
client_cert="/path/to/client-cert",
client_key="/path/to/client-key",
)
)
We're using temporal-python-sdk and monkey patching in something similar. This would fit our use case if it is accepted 👍