feat: Add option to disallow aggregation pipelines for the read-only master key#10517
feat: Add option to disallow aggregation pipelines for the read-only master key#10517mtrezza wants to merge 1 commit into
Conversation
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughAdds a new ChangesallowAggregationForReadOnlyMasterKey option and enforcement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.22.0)OpenGrep fatal error (exit code 2): [00.18][ERROR]: Error: exception Unix_error: No such file or directory stat spec/ParseQuery.Aggregate.spec.js Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10517 +/- ##
=======================================
Coverage 92.65% 92.65%
=======================================
Files 193 193
Lines 16969 16971 +2
Branches 248 248
=======================================
+ Hits 15723 15725 +2
Misses 1225 1225
Partials 21 21 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Issue
The
readOnlyMasterKeyis intended to provide read-only access. However, it can run aggregation pipelines via the aggregate endpoint, and an aggregation pipeline can contain write-capable stages (for example MongoDB$outand$merge). There is currently no way for an operator to prevent the read-only master key from running aggregation pipelines.Approach
allowAggregationForReadOnlyMasterKey(defaulttrue, current behavior). When set tofalse, the read-only master key cannot run aggregation pipelines via the aggregate endpoint.falsein the next major version.readOnlyMasterKeyoption documentation to clarify that it is a secret key for internal, server-side use only and must never be shipped, distributed, published, or exposed to untrusted parties.Tasks