-
Notifications
You must be signed in to change notification settings - Fork 4
Mongo driver 4 rc no auth defaults #93
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
Codecov Report
@@ Coverage Diff @@
## mongo-driver-4-rc #93 +/- ##
=====================================================
+ Coverage 87.08% 89.48% +2.40%
=====================================================
Files 8 8
Lines 813 742 -71
=====================================================
- Hits 708 664 -44
+ Misses 105 78 -27
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
56ce065 to
5b28284
Compare
c9af7a5 to
43e0cf9
Compare
| - **BREAKING**: Remove all defaults for `authSource`. | ||
| - **BREAKING**: Remove `config.mongodb.username`. | ||
| - **BREAKING**: Remove `config.mongodb.password`. | ||
| - **BREAKING**: Remove setting username, password, and or authSource from `urls.create`. |
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.
Can you add something here that says that all of these options, if needed, must be provided via the database url config option?
| bedrock.config.mongodb.password = 'password'; // default: password | ||
|
|
||
| // the mongodb database 'my_project_dev' and the 'my_project' user will | ||
| // be created on start up following a prompt for the admin user credentials |
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.
These comments need to be brought into sync with these changes.
| connectOptions.auth = { | ||
| username: 'me', | ||
| password: 'password' | ||
| }; |
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.
We don't want to support this, only url options, right?
| // the `authSource` is database to authenticate against | ||
| // it should be specified or it will default to the database | ||
| // you're connecting to | ||
| connectOptions.authSource = 'my_provider_auth_db'; |
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 should be removed too, right? It looks like it can be done via the url. We want there to be just one way to do these things if possible.
| // omit a username and password if those are provided as | ||
| // `config.mongodb.username` and `config.mongodb.password`, otherwise those | ||
| // `config.mongodb.connnectOptions.auth.username` and | ||
| // `config.mongodb.connectOptions.auth.password`, otherwise those |
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.
We'll want to bring these comments in sync after removing the extra options.
|
Closing in favor of #107. |
This was tested locally with a server with authentication on.
The following was the result:
Additionally I tested what happens if someone sets
connectOptions.authconfig.mongodb.usernameconfig.mongodb.password./lib/authn.jsto./lib/connect.jsurls.createPR Mystery that needs to be solved:
authobject, but the ci tests failed which suggests there is an edge case where theauthobject is failing when the authSource is not the database being connected to.Resolves this issue, by removing auth defaults: #54