Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-33803

db.getUsers() doesn't output authenticationRestrictions option

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.6.2
    • Component/s: Admin
    • Labels:
      None
    • ALL
    • Hide

      Command:

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

      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

            Assignee:
            kelsey.schubert@mongodb.com Kelsey Schubert
            Reporter:
            alexeybut Alexey Butalov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: