[SERVER-32942] mongo shell: for users authorized to certain namespace, make discovery easy Created: 26/Jan/18  Updated: 29/Oct/23  Resolved: 16/May/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 4.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Andrew Davidson Assignee: Spencer Jackson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by COMPASS-2245 As a user with limited permissions (r... Closed
is depended on by DRIVERS-1393 Support authorizedCollections option ... Implementing
is depended on by SERVER-40736 Test collection name autocompletion f... Closed
Documented
is documented by DOCS-11718 Docs for SERVER-32942: mongo shell: f... Closed
Duplicate
is duplicated by SERVER-25804 The listCollections command does not ... Closed
Related
related to COMPASS-3389 Confusing behavior when connecting wi... Closed
related to DRIVERS-1393 Support authorizedCollections option ... Implementing
is related to SERVER-35638 Shell auto-completion blocks when lis... Closed
is related to SERVER-38867 "show collections" no longer lists sy... Closed
is related to SERVER-36262 mongo shell: allow users to show dbs ... Closed
Backwards Compatibility: Minor Change
Sprint: Platforms 2018-02-26, Platforms 2018-03-12, Platforms 2018-03-26, Platforms 2018-04-09, Platforms 2018-04-23, Platforms 2018-05-07, Platforms 2018-05-21
Participants:

 Description   

For users that connect to an authentication-enabled database that are authorized to only certain namespaces, the mongo shell should look up the namespaces the user is authorized to (for example by using the connectionStatus command command)

and then, if they exist, show those namespaces to the user in shell helpers like "show dbs" or "show collections".

I suspect the fact that this is not baked into the shell's DNA today is a holdover from the fact that the shell was originally built when mongodb did not use auth by default...

We should first investigate implementing showCollections properly in the server and backporting it all the way to 3.2. If this doesn't work, we should modify the shell helpers to appear to have the correct behavior.



 Comments   
Comment by Githook User [ 16/May/18 ]

Author:

{'email': 'spencer.jackson@mongodb.com', 'username': 'spencerjackson', 'name': 'Spencer Jackson'}

Message: SERVER-32942: Let users listcollections their own collections
Branch: master
https://github.com/mongodb/mongo/commit/0a4f7b1ebf173984883d6e018ae88350015dfeb3

Comment by Asya Kamsky [ 31/Jan/18 ]

show dbs and show collections are just syntax sugar on top of server listDatabases and getCollectionNames command.

Generated at Thu Feb 08 04:31:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.