-
Notifications
You must be signed in to change notification settings - Fork 72
add support for --tls flag (#203) #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reason to do custom parsing? (instead of c.Bool(..))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm doing custom parsing to keep consistency with your code above:
Line 214 in 6a16f1c
| disableHostNameVerificationS := c.String(common.FlagTLSDisableHostVerification) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
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