Skip to content

Commit f2a40b6

Browse files
committed
Fix --tls=false being ignored when --api-key is present
The SDK (v1.39.0+) auto-enables TLS when API-key credentials are set, unless ConnectionOptions.TLSDisabled is true. The envconfig package (v0.1.0) predates this field and does not set it when TLS is explicitly disabled, so the SDK re-enables TLS despite the user's --tls=false. Bridge the gap by setting TLSDisabled in the CLI after profile.ToClientOptions() when the profile has TLS explicitly disabled. Bump cliext SDK dependency to v1.40.0 The cliext module was on go.temporal.io/sdk v1.32.1 while the root module uses v1.40.0. This caused the ConnectionOptions.TLSDisabled field (added in v1.39.0) to be unresolved when editing cliext.
1 parent 3faa05f commit f2a40b6

3 files changed

Lines changed: 34 additions & 114 deletions

File tree

cliext/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ func (b *ClientOptionsBuilder) Build(ctx context.Context) (client.Options, error
200200
return client.Options{}, fmt.Errorf("failed to build client options: %w", err)
201201
}
202202

203+
if profile.TLS != nil && profile.TLS.Disabled {
204+
clientOpts.ConnectionOptions.TLSDisabled = true
205+
}
206+
203207
// Set client authority if provided.
204208
if cfg.ClientAuthority != "" {
205209
clientOpts.ConnectionOptions.Authority = cfg.ClientAuthority

cliext/go.mod

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ require (
77
github.com/mattn/go-isatty v0.0.20
88
github.com/spf13/pflag v1.0.10
99
github.com/stretchr/testify v1.10.0
10-
go.temporal.io/sdk v1.32.1
10+
go.temporal.io/sdk v1.40.0
1111
go.temporal.io/sdk/contrib/envconfig v0.1.0
1212
golang.org/x/oauth2 v0.33.0
13-
google.golang.org/grpc v1.66.0
13+
google.golang.org/grpc v1.67.1
1414
)
1515

1616
require (
@@ -19,22 +19,20 @@ require (
1919
github.com/gogo/protobuf v1.3.2 // indirect
2020
github.com/golang/mock v1.6.0 // indirect
2121
github.com/google/uuid v1.6.0 // indirect
22-
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
22+
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect
2323
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
24-
github.com/nexus-rpc/sdk-go v0.3.0 // indirect
25-
github.com/pborman/uuid v1.2.1 // indirect
24+
github.com/nexus-rpc/sdk-go v0.5.1 // indirect
2625
github.com/pmezard/go-difflib v1.0.0 // indirect
2726
github.com/robfig/cron v1.2.0 // indirect
2827
github.com/stretchr/objx v0.5.2 // indirect
29-
go.temporal.io/api v1.44.1 // indirect
30-
golang.org/x/exp v0.0.0-20231127185646-65229373498e // indirect
31-
golang.org/x/net v0.38.0 // indirect
32-
golang.org/x/sync v0.12.0 // indirect
33-
golang.org/x/sys v0.31.0 // indirect
34-
golang.org/x/text v0.23.0 // indirect
28+
go.temporal.io/api v1.62.1 // indirect
29+
golang.org/x/net v0.39.0 // indirect
30+
golang.org/x/sync v0.13.0 // indirect
31+
golang.org/x/sys v0.32.0 // indirect
32+
golang.org/x/text v0.24.0 // indirect
3533
golang.org/x/time v0.3.0 // indirect
3634
google.golang.org/genproto/googleapis/api v0.0.0-20240827150818-7e3bb234dfed // indirect
3735
google.golang.org/genproto/googleapis/rpc v0.0.0-20240827150818-7e3bb234dfed // indirect
38-
google.golang.org/protobuf v1.34.2 // indirect
36+
google.golang.org/protobuf v1.36.6 // indirect
3937
gopkg.in/yaml.v3 v3.0.1 // indirect
4038
)

0 commit comments

Comments
 (0)