-
Notifications
You must be signed in to change notification settings - Fork 11
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
Expose TLS and authentication options in mongodb_uri field #287
Closed
Closed
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
11629ab
Refactor URI generation
alcaeus e845ed3
Refactor sslParams variable name
alcaeus 2d1e27c
Expose TLS params in generated connection string
alcaeus fe89e8e
Expose auth params in generated connection string
alcaeus 39ca39b
Tests: fix SSL detection for newer servers
alcaeus 31f5dd3
Tests: correctly configure logger for server tests
alcaeus ddf4e12
Fix wrong comment style
alcaeus 028944f
Quote value for URI
alcaeus 72e4580
Copy ssl_params to avoid unwanted modification
alcaeus c2be548
Add changelog entry for mongodb_uri change
alcaeus 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 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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 modifies the
self.ssl_params
property. Why do we need to use DEFAULT_SSL_OPTIONS here? Isn't that already the default forself.ssl_params
?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 wasn't aware that this modifies the reference. sslParams for example doesn't contain
ssl=true
, it only contains the parameters necessary for the server (see sample orchestration files).DEFAULT_SSL_OPTIONS
is applied toself.kwargs
but notself.ssl_params
. What would be the right way to apply these default options?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.
Oh thanks for explaining that. In this case I don't think we should add any of the
self.ssl_params
to the client URI since those are ssl params for the server itself. I think we should do this:The above approach would need to add the
tlsInsecure=true
option to match thessl_cert_reqs=ssl.CERT_NONE
in DEFAULT_SSL_OPTIONS.Alternatively we can keep your current approach but make a copy of self.ssl_params to avoid modifying it:
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.
Update to copy the params.
DEFAULT_SSL_OPTIONS
by itself is not enough, as there are additional settings that come into play. The newSSL_TO_TLS_OPTION_MAPPINGS
variable indicates which of the fields from the configuration'ssslParams
andDEFAULT_SSL_OPTIONS
map to URI options for SSL. I can add additional tests to ensure we're not adding unknown or wrong URI options if you'd like.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.
self.ssl_params.copy()
SGTM