[SERVER-12870] Required field "credentials" not allowed in "createUser" command Created: 24/Feb/14  Updated: 06/Mar/14  Resolved: 03/Mar/14

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc1

Type: Bug Priority: Major - P3
Reporter: Shaun Verch Assignee: Spencer Brody (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

> db.getSiblingDB("$external").createUser({user:"fuu",pwd:"bar",roles:[]})
2014-02-24T15:59:04.404-0500 Error: couldn't add user: User documents for users defined on '$external' must have 'credentials' field set to {external: true} at src/mongo/shell/db.js:1007
> db.getSiblingDB("$external").createUser({user:"fuu",pwd:"bar",roles:[],credentials:{external:true}})
2014-02-24T15:59:11.985-0500 Error: couldn't add user: "credentials" is not a valid argument to createUser at src/mongo/shell/db.js:1007



 Comments   
Comment by Githook User [ 03/Mar/14 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: SERVER-12870 Better error message when prividing a pwd arg when creating an external user
Branch: master
https://github.com/mongodb/mongo/commit/1cd312b6faa138b39db2b94a2d7258cda15c68a1

Comment by Andy Schwerin [ 26/Feb/14 ]

This is a messaging issue. The createUser command should be generating the error message about a "pwd" argument to the command being illegal when the database is $external, but instead we're relying on the underlying user document validator to check the correctness of the user document we build.

In essence, we're catching the error here instead of here.

Generated at Thu Feb 08 03:29:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.