-
Notifications
You must be signed in to change notification settings - Fork 141
Make env config TLS disabled field optional
#1105
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
088a8c6
Update config TLS field to be Optional
THardy98 ef6d5c0
Improve test coverage, more e2e tests
THardy98 c4e55a5
Formatting & linting
THardy98 9423e82
Add tri-state tests for TLS
THardy98 8db5178
Remove useless disable_file parameter for ClientConfig.load
THardy98 240d04e
Update core submodule so that TLS object is not auto-created. Python …
THardy98 a689df3
Merge branch 'main' into envconfig_tls_disabled_optional
THardy98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
IIRC, the default of TLS (i.e. neither true nor false) was that it was implicitly enabled if there was an API key present, otherwise implicitly disabled. I think we need to respect that behavior in the SDKs (IIRC, Go does).
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.
that is the behaviour of this function, we only return
False(instead of aTLSConfig) ifdisabledis explicitly enabledUh oh!
There was an error while loading. Please reload this page.
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.
or are you saying that if a user supplies an api key AND sets
disabledto explicitlytrue, that the api-key would take precedence?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.
For example, this case:
technically, TLS is enabled here, there's no restriction as long as don't set
disabledastrue. We'd basically pass an emptyTLSConfigto the client on theconnectcallThere 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.
the test in this commit lays out the various cases:
9423e82
Uh oh!
There was an error while loading. Please reload this page.
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.
The issue actually is at
to_client_connect_config. So ifClientConfigProfile.api_keyis presentCleintConfigProfile.tlsisNone, doestlsget enabled? It doesn't seem so from the code, but it should.Uh oh!
There was an error while loading. Please reload this page.
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.
This is done in core:
though now, given that we have logic in lang to transform to/from object that should represent the TOML, this may no longer be desired/accurate.
Probably the best solution here is to change
pub tls: Option<ClientConfigTLS>in core to:alternatively, we keep core as is and make the change upstream in the bridge, with the logic being something like "if received TLS object is
ClientConfigTLS::default(), then transform totrue"or we remove
apply_api_key_tls_logicfrom core altogether and have lang implement this logicThere 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 am leaning towards the latter, will open a PR
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.
latest commit covers this case