Skip to content
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

feat(NODE-3728): Allow to pass authorizedCollections option to the db.listCollections method #3021

Conversation

gribnoysup
Copy link
Contributor

Description

This patch allows to pass authorizedCollections option when using db.listCollections method

What is changing?

ListCollectionsOperation class now has authorizedCollections defined and handled in a similar fashion to the nameOnly option

Is there new documentation needed for these changes?

Not needed (I think)

What is the motivation for this change?

This adds support for a listCollections command option that is helpful when you want to fetch a list of collections for the user that might not have enough privileges to list them otherwise. A full description can be found in the listCollections command docs

Double check the following

  • Ran npm run check:lint script
  • Ran npm run test script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: <type>(NODE-xxxx)<!>: <description>
  • Changes are covered by tests

@gribnoysup gribnoysup force-pushed the node-3728-add-authorized-collections-option-support branch from 6152200 to 76e51b2 Compare November 1, 2021 15:29
@dariakp dariakp added the tracked-in-jira Ticket filed in MongoDB's Jira system label Nov 2, 2021
@dariakp
Copy link
Contributor

dariakp commented Nov 2, 2021

@gribnoysup There was a CI issue that blocked all tests from running which necessitated a change to main for the fix, could you rebase your branch to pull them in here?

@durran durran self-requested a review November 3, 2021 13:31
@durran durran added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Nov 3, 2021
@gribnoysup gribnoysup force-pushed the node-3728-add-authorized-collections-option-support branch from 76e51b2 to 516e28d Compare November 3, 2021 14:58
@gribnoysup
Copy link
Contributor Author

Thanks for the heads-up @dariakp! Rebased on main

@durran durran added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Nov 4, 2021
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple suggested changes to (hopefully) better match the test descriptions to what is being tested

test/unit/operations/list_collections.test.js Outdated Show resolved Hide resolved
test/unit/operations/list_collections.test.js Outdated Show resolved Hide resolved
@gribnoysup
Copy link
Contributor Author

@dariakp ty for the feedback! Applied suggestions in fa8a514

Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dariakp dariakp merged commit e1234a7 into mongodb:main Nov 5, 2021
@gribnoysup gribnoysup deleted the node-3728-add-authorized-collections-option-support branch November 5, 2021 18:36
ljhaywar pushed a commit that referenced this pull request Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team tracked-in-jira Ticket filed in MongoDB's Jira system
Projects
None yet
4 participants