add support for --tls flag (#203)#210
Conversation
* refactor: add new flag --tls, to create tls connection by host from given address * refactor: rollback spaces * refactor: rollback spaces * refactor: change definition of flag * refactor: change the logic. (If we have server name, then it is not need to get tls flag) * refactor: rename TLS flag from "FlagEnableTLS" to "FlagTLS" * refactor: change error message * refactor: rewrite comment
| return nil, fmt.Errorf("unable to read TLS disable host verification flag: %w", err) | ||
| } | ||
| enableTLSS := c.String(common.FlagTLS) | ||
| enableTLS, err := strconv.ParseBool(enableTLSS) |
There was a problem hiding this comment.
what's the reason to do custom parsing? (instead of c.Bool(..))
There was a problem hiding this comment.
I'm doing custom parsing to keep consistency with your code above:
Line 214 in 6a16f1c
There was a problem hiding this comment.
ok so these values are accepted with strconv.ParseBool, true: "1", "t", "T", "true", "TRUE", "True", false: "0", "f", "F", "false", "FALSE", "False"
I'd go with the c.Bool for consistency with the rest of the CLI
Co-authored-by: Ruslan <11838981+feedmeapples@users.noreply.github.com>
|
Tests fail due to recent regression unrelated to the current PR, specifically verifying RC code in |
|
And could you also check the PR with the same issue temporalio/tctl#360. |
What was changed
--tlsflag with checking on error. And added the logic that when the flag is activated, the host is taken from the address/localhost--tlsflag--tlsflag name. And added--tlsflag to SharedFlag sliceWhy?
I am connecting to my server over a TLS connection and I had to duplicate my host from the
--addressflag to the--tls_server_nameflag. This cluttered up the command, as well as misleading.Checklist
Closes #203
How was this tested:
Related to same issue
temporalio/tctl#360