Closed timvaillancourt closed 6 years ago
Hi @timvaillancourt, This looks like a great addition, and thank you for taking the time to implement it. It is really appreciated!
I have one remark though. Could you please add some unit tests for using the AuthenticationRestriction
? The existing UpsertUser
unit tests should be a good template.
A success and failure case unit tests would be greatly appreciated.
It will be a nice addition when it is merged :)
Whoops, sounds good @szank. I will add unit tests shortly
@szank I've added a test for this. Please review, thanks
EDIT: I made a few more commits to clean up the way I wrote the tests. 100% done this time
Thanks @timvaillancourt !
This PR adds support for MongoDB user authenticationRestrictions, added in 3.6:
https://docs.mongodb.com/manual/reference/method/db.createUser/#authentication-restrictions
Example user with authenticationRestrictions, post-change:
If it's valuable I can add checks to confirm a valid IP or CIDR was passed as 'clientSource' or 'serverAddress', please let me know.