summaryrefslogtreecommitdiff
path: root/jstests/auth/localhostAuthBypass.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/auth/localhostAuthBypass.js')
-rw-r--r--jstests/auth/localhostAuthBypass.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/jstests/auth/localhostAuthBypass.js b/jstests/auth/localhostAuthBypass.js
index 6cb315650ef..cd56e3bc160 100644
--- a/jstests/auth/localhostAuthBypass.js
+++ b/jstests/auth/localhostAuthBypass.js
@@ -79,17 +79,13 @@ var assertCannotRunCommands = function(mongo) {
{param: "userCacheInvalidationIntervalSecs", val: 300}
];
params.forEach(function(p) {
- var cmd = {
- setParameter: 1
- };
+ var cmd = {setParameter: 1};
cmd[p.param] = p.val;
assert.commandFailedWithCode(
mongo.getDB("admin").runCommand(cmd), authorizeErrorCode, "setParameter: " + p.param);
});
params.forEach(function(p) {
- var cmd = {
- getParameter: 1
- };
+ var cmd = {getParameter: 1};
cmd[p.param] = 1;
assert.commandFailedWithCode(
mongo.getDB("admin").runCommand(cmd), authorizeErrorCode, "getParameter: " + p.param);
@@ -167,8 +163,8 @@ var runNonlocalTest = function(host) {
assertCannotRunCommands(mongo);
assert.throws(function() {
- mongo.getDB("admin")
- .createUser({user: username, pwd: password, roles: jsTest.adminUserRoles});
+ mongo.getDB("admin").createUser(
+ {user: username, pwd: password, roles: jsTest.adminUserRoles});
});
assert.throws(function() {
mongo.getDB("$external")