[SERVER-33803] db.getUsers() doesn't output authenticationRestrictions option Created: 11/Mar/18  Updated: 27/Oct/23  Resolved: 12/Mar/18

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 3.6.2
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Alexey Butalov Assignee: Kelsey Schubert
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
is documented by DOCS-11433 db.getUsers() should mention showAuth... Closed
Operating System: ALL
Steps To Reproduce:

Command:

db.createUser(
{
user: "user1",
pwd : "123",
  "roles" : [{
      "role" : "read",
      "db" : "test"
    }],
  "authenticationRestrictions" : [{
      "clientSource" : ["192.0.2.0"],
      "serverAddress" : ["198.51.100.0"]
    }]
})

Participants:

 Description   

db.getUsers() doesn't output authenticationRestrictions option.
Command

db.getUser("user1")

Output:

{
    "_id" : "test.user1",
    "user" : "user1",
    "db" : "test",
    "roles" : [
        {
            "role" : "read",
            "db" : "test"
        }
    ]
}

System table:

{
    "_id" : "test.user1",
    "user" : "user1",
    "db" : "test",
    "credentials" : {
        "SCRAM-SHA-1" : {
            "iterationCount" : 10000,
            "salt" : "lzMnQfgicY/TfSRwllZTTQ==",
            "storedKey" : "q6QviU2ZkYO4CVeRX51oNCsrzdU=",
            "serverKey" : "D7QX56EUW6f/1+Ent6Kv6tglZAQ="
        }
    },
    "authenticationRestrictions" : [
        {
            "clientSource" : [
                "192.0.2.0"
            ],
            "serverAddress" : [
                "198.51.100.0"
            ]
        }
    ],
    "roles" : [
        {
            "role" : "read",
            "db" : "test"
        }
    ]
}

Server version: 3.6.2
Platform: Windows x64



 Comments   
Comment by Kelsey Schubert [ 12/Mar/18 ]

Hi alexeybut,

Thanks for reporting this expected behavior.

To get authenticationRestrictions please execute the following:

db.getUsers({showAuthenticationRestrictions: 1})

I'm sorry that the option to show showAuthenticationRestrictions was overlooked in our documentation, and I've opened DOCS-11433 to remedy this issue. Please feel free to vote for DOCS-11433.

Thanks again,
Kelsey

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