summaryrefslogtreecommitdiff
path: root/jstests/ssl/x509_client.js
diff options
context:
space:
mode:
authorAndreas Nilsson <andreas.nilsson@10gen.com>2013-10-11 16:45:40 -0400
committerAndreas Nilsson <andreas.nilsson@10gen.com>2013-10-11 18:24:19 -0400
commitbb421d824fbff1c70ac94fd60772b356a2b3074e (patch)
tree3f97b5df514dc9f5dc302cb5a3829b8d745f8600 /jstests/ssl/x509_client.js
parent179e7c1cdc5d80515892d5d938624a2d70350d4f (diff)
downloadmongo-bb421d824fbff1c70ac94fd60772b356a2b3074e.tar.gz
SERVER-7961 Adapted x509_client.js to new user document format
Diffstat (limited to 'jstests/ssl/x509_client.js')
-rw-r--r--jstests/ssl/x509_client.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js
index 0d027fdf84e..53881efcc93 100644
--- a/jstests/ssl/x509_client.js
+++ b/jstests/ssl/x509_client.js
@@ -1,7 +1,7 @@
// If we are running in use-x509 passthrough mode, turn it off or else the auth
// part of this test will not work correctly
-TestData.useX509 = false
+TestData.useX509 = false;
var SERVER_CERT = "jstests/libs/server.pem"
var CA_CERT = "jstests/libs/ca.pem"
@@ -16,8 +16,8 @@ function authAndTest(mongo) {
// Add user using localhost exception
external.addUser({user: CLIENT_USER, roles:[
- {'name':'userAdminAnyDatabase', 'db':'admin', 'hasRole':true, 'canDelegate':true},
- {'name':'readWriteAnyDatabase', 'db':'admin', 'hasRole':true, 'canDelegate':true}]})
+ {'role':'userAdminAnyDatabase', 'db':'admin'},
+ {'role':'readWriteAnyDatabase', 'db':'admin'}]})
// Localhost exception should not be in place anymore
assert.throws( function() { test.foo.findOne()}, {}, "read without login" )
@@ -29,19 +29,19 @@ function authAndTest(mongo) {
// Check that we can add a user and read data
test.addUser({user: "test", pwd: "test", roles:[
- {'name': 'readWriteAnyDatabase', 'db': 'admin', 'hasRole': true, 'canDelegate': true}]})
+ {'role': 'readWriteAnyDatabase', 'db': 'admin'}]})
test.foo.findOne()
-
+
external.logout();
assert.throws( function() { test.foo.findOne()}, {}, "read after logout" )
}
print("1. Testing x.509 auth to mongod");
var mongo = MongoRunner.runMongod({port : port,
- sslMode : "sslOnly",
- sslPEMKeyFile : SERVER_CERT,
- sslCAFile : CA_CERT,
- auth:""});
+ sslMode : "sslOnly",
+ sslPEMKeyFile : SERVER_CERT,
+ sslCAFile : CA_CERT,
+ auth:""});
authAndTest(mongo);
stopMongod(port);