Class: Temporalio::EnvConfig::ClientConfigTLS
- Inherits:
-
Object
- Object
- Temporalio::EnvConfig::ClientConfigTLS
- Defined in:
- lib/temporalio/env_config.rb
Overview
TLS configuration for Temporal client connections.
This class provides methods for creating, serializing, and converting TLS configuration objects used by Temporal clients.
Class Method Summary collapse
-
.from_h(hash) ⇒ ClientConfigTLS?
Create a ClientConfigTLS from a hash.
Instance Method Summary collapse
-
#initialize(disabled: nil, server_name: nil, server_root_ca_cert: nil, client_cert: nil, client_private_key: nil) ⇒ ClientConfigTLS
constructor
Set default values.
-
#to_client_tls_options ⇒ Connection::TLSOptions, false
Create a TLS configuration for use with connections.
-
#to_h ⇒ Hash
Convert to a hash that can be used for TOML serialization.
Constructor Details
#initialize(disabled: nil, server_name: nil, server_root_ca_cert: nil, client_cert: nil, client_private_key: nil) ⇒ ClientConfigTLS
Set default values
49 50 51 52 |
# File 'lib/temporalio/env_config.rb', line 49 def initialize(disabled: nil, server_name: nil, server_root_ca_cert: nil, client_cert: nil, client_private_key: nil) super end |
Class Method Details
.from_h(hash) ⇒ ClientConfigTLS?
Create a ClientConfigTLS from a hash
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/temporalio/env_config.rb', line 36 def self.from_h(hash) return nil if hash.nil? || hash.empty? new( disabled: hash[:disabled], server_name: hash[:server_name], server_root_ca_cert: hash_to_source(hash[:server_ca_cert]), client_cert: hash_to_source(hash[:client_cert]), client_private_key: hash_to_source(hash[:client_key]) ) end |
Instance Method Details
#to_client_tls_options ⇒ Connection::TLSOptions, false
Create a TLS configuration for use with connections
68 69 70 71 72 73 74 75 76 77 |
# File 'lib/temporalio/env_config.rb', line 68 def return false if disabled Client::Connection::TLSOptions.new( domain: server_name, server_root_ca_cert: read_source(server_root_ca_cert), client_cert: read_source(client_cert), client_private_key: read_source(client_private_key) ) end |
#to_h ⇒ Hash
Convert to a hash that can be used for TOML serialization
56 57 58 59 60 61 62 63 64 |
# File 'lib/temporalio/env_config.rb', line 56 def to_h { disabled:, server_name:, server_ca_cert: server_root_ca_cert ? source_to_hash(server_root_ca_cert) : nil, client_cert: client_cert ? source_to_hash(client_cert) : nil, client_key: client_private_key ? source_to_hash(client_private_key) : nil }.compact end |