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.
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
Expose TLS and authentication options in mongodb_uri field #287
Changes from 6 commits
11629ab
e845ed3
2d1e27c
fe89e8e
39ca39b
31f5dd3
ddf4e12
028944f
72e4580
c2be548
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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