-
Notifications
You must be signed in to change notification settings - Fork 272
💥 [BREAKING] enable TLS if api key specified #2126
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
cretz
left a comment
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.
(leaving main review to Go SDK owners, just a couple of notes here)
| // TLS configures connection level security credentials. | ||
| TLS *tls.Config | ||
|
|
||
| // TLSDisabled explicitly disables TLS. When true, TLS will not be used even |
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.
When true, TLS will not be used
Reading the code here, this is not true, TLS will still be enable if the TLS field is set. IMO you should either 1) disallow both this being true and the TLS field being set (my preference), or 2) document that this being true means anything in the TLS field is ignored, and then respect that in code.
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.
Ah I should've tested this. Added validation to make it mutually exclusive + test
|
|
||
| func (apiKeyCredentials) applyToOptions(*ConnectionOptions) error { return nil } | ||
| func (apiKeyCredentials) applyToOptions(opts *ConnectionOptions) error { | ||
| // Auto-enable TLS when API key is provided and TLS is not explicitly set/disabled |
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.
Might as well document to users that we do this where API key is set by users (i.e. in the Godoc on the NewAPIKey* functions)
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.
added a little line to the new api key methods noting the auto TLS behavior
|
I'll note there is another approach where you instead add a method to |
Added validation to make |
cretz
left a comment
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.
LGTM, but would want to wait for Go SDK owner(s) approval. No preference on approach @Quinn-With-Two-Ns said vs what's here (hopefully it's rarely/never used anyways, heh)
… methods that api key can enable TLS
f148251 to
2a0a678
Compare
What was changed
DWISOTT
Part of Assume TLS enabled if API key provided in SDKs features#687
How was this tested:
internals/credentials_test.goAny docs updates needed?
Maybe