Skip to content

Commit 90f978c

Browse files
authored
mTLS adding commnets to code blocks + README updates (#121)
Signed-off-by: [email protected] <[email protected]>
1 parent 232bcd8 commit 90f978c

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

new_samples/client_samples/helloworld_tls/README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ https://github.com/cadence-workflow/cadence/blob/e1267de12f8bc670fc84fab456d3495
1919
```
2020

2121
4. **Start cadence server with TLS**
22-
```bash
23-
./cadence-server --env development --zone tls start
24-
```
22+
To enable mTLS in Cadence server, you need to configure TLS settings and start the server with the appropriate environment configuration.
23+
Starting the Server with TLS
24+
Use the --zone flag to specify the TLS configuration when starting the Cadence server:
25+
26+
./cadence-server --env development --zone tls start
27+
28+
This will load [config/development.yaml](https://github.com/cadence-workflow/cadence/blob/e1267de12f8bc670fc84fab456d3495c8fc2f8a8/config/development.yaml) + [config/development_tls.yaml](https://github.com/cadence-workflow/cadence/blob/e1267de12f8bc670fc84fab456d3495c8fc2f8a8/config/development_tls.yaml).
29+
See [CONTRIBUTING.md](https://github.com/cadence-workflow/cadence/blob/e1267de12f8bc670fc84fab456d3495c8fc2f8a8/CONTRIBUTING.md#4-run) for more details.
2530

2631
## Running the Sample
2732

new_samples/client_samples/helloworld_tls/hello_world_tls.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ func withTLSDialOption() (grpc.DialOption, error) {
8080
RootCAs: caCertPool,
8181
Certificates: []tls.Certificate{clientCert},
8282
}
83+
// Create TLS credentials from the TLS configuration
8384
creds := credentials.NewTLS(&tlsConfig)
85+
// Create a gRPC dial option with TLS credentials for secure connection
8486
grpc.DialerCredentials(creds)
87+
// Return the gRPC dial option configured with TLS credentials
8588
return grpc.DialerCredentials(creds), nil
8689
}

new_samples/worker/worker.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ func StartWorker() {
7373

7474
func BuildCadenceClient(dialOptions ...grpc.DialOption) workflowserviceclient.Interface {
7575
grpcTransport := grpc.NewTransport()
76+
// Create a single peer chooser that identifies the host/port and configures
77+
// a gRPC dialer with TLS credentials
7678
myChooser := peer.NewSingle(
7779
yarpchostport.Identify(HostPort),
7880
grpcTransport.NewDialer(dialOptions...),
@@ -91,6 +93,8 @@ func BuildCadenceClient(dialOptions ...grpc.DialOption) workflowserviceclient.In
9193

9294
clientConfig := dispatcher.ClientConfig(CadenceService)
9395

96+
// Create a compatibility adapter that wraps proto-based YARPC clients
97+
// to provide a unified interface for domain, workflow, worker, and visibility APIs
9498
return compatibility.NewThrift2ProtoAdapter(
9599
apiv1.NewDomainAPIYARPCClient(clientConfig),
96100
apiv1.NewWorkflowAPIYARPCClient(clientConfig),

0 commit comments

Comments
 (0)