[DRIVERS-1393] Support authorizedCollections option for listCollections helpers Created: 08/Sep/20 Updated: 13/Feb/23 |
|
| Status: | Implementing |
| Project: | Drivers |
| Component/s: | listCollections |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Jérôme Mainaud | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Changes: | Needed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Server Compat: | 4.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Quarter: | FY22Q4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Downstream Changes Summary: | Drivers should sync with mongodb/specifications@15302d2 which introduced the authorizedCollections option to the three listCollections methods: listCollections, listCollectionNames, listMongoCollections.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Driver Compliance: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
MongoDB 4.0 added an authorizedCollections boolean option to the listCollections command, which can be used to limit the command result to collections the user is authorized to use. This ticket should allow the users to set the authorizedCollections option on the listCollections, listCollectionNames, and listMongoCollections driver methods. |
| Comments |
| Comment by Githook User [ 16/Dec/21 ] |
|
Author: {'name': 'Neil Shweky', 'email': 'neilshweky@gmail.com', 'username': 'Neilshweky'}Message: DRIVERS-1393 listCollectionNames should use authorizedCollections argument (#1111)
|
| Comment by Jeremy Mikola [ 15/Dec/21 ] |
|
Per alexander.golin's previous comment:
The related spec change for the listDatabases helpers was mongodb/specifications@4d12e63 for SPEC-1342. Note that this option was introduced in a server's patch release (4.0.5), so it's not really feasible to check for server support using a wire version as we do for other options. According to this code comment from PHPLIB, servers before 4.0.5 ignore the option (as opposed to raising an error), but I haven't personally verified that. With respect to DRIVERS-685 and SPEC-1342, we should note that the default behavior for drivers is to not specify the option and only include the option in the outgoing command when it is specified by the user. Support for the option was added to all three listDatabases helpers. With respect to this issue, I think we should do the same. All three helpers for listCollections should add support for the option. The default behavior should be to leave it unspecified and only send it in the outgoing command when it is specified by the user. The spec change for listDatabases doesn't talk about checking for server-side support, so I think we don't have to worry about that here. Drivers can just document the server version that introduced the option and leave this up to our users. |
| Comment by Jérôme Mainaud [ 17/Sep/20 ] |
|
Hello, |
| Comment by Esha Bhargava [ 15/Sep/20 ] |
|
jmainaud@zeenea.com Thanks for reporting this issue! We have moved this to the DRIVERS project to discuss if this is something we should do for all our drivers. |