[MongoDB] Reduce permissions required #113
Merged
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.
Currently, we always use a global changestream, which needs the
readAnyDatabase
permission on Atlas.This is needed when sync rules reference multiple databases in the same cluster. We want to use a single changestream for the entire replication process, so having
read
permissions for each individual database is not sufficient when using multiple databases. Replicating multiple databses is not a common use case though, and the permissions needed is a problem for some users.This now changes to opening a changestream on the specific database if only the default database is used. This effectively reduces the required permissions to just
read@mydb
.So overall the current permissions required for Atlas are:
And after the change it would be:
Note that for the beta, we'd likely use document pre/post-images for each replicated collection, which requires the
collMod
permission if we set it up automatically. This would require thedbAdmin@mydb
permission on Atlas. However, users will still have the option to instead configure that manually and just useread@mydb
.