diff options
author | Mike Grundy <michael.grundy@10gen.com> | 2016-02-04 12:31:28 -0500 |
---|---|---|
committer | Mike Grundy <michael.grundy@10gen.com> | 2016-02-05 15:00:52 -0500 |
commit | 56aa683f83f8bda0a4e0f09566034f12f9a4d4d7 (patch) | |
tree | 594bdcce536ac08ee882fe86ac73aef61dea8e52 /jstests/ssl | |
parent | f48ed9956e605bfe9816cbaf045652d8e003897e (diff) | |
download | mongo-56aa683f83f8bda0a4e0f09566034f12f9a4d4d7.tar.gz |
SERVER-22341 fix jslint errors in jstests/ssl with eslint --fix
Diffstat (limited to 'jstests/ssl')
-rw-r--r-- | jstests/ssl/disable_x509.js | 16 | ||||
-rw-r--r-- | jstests/ssl/initial_sync1_x509.js | 2 | ||||
-rw-r--r-- | jstests/ssl/mixed_mode_repl.js | 4 | ||||
-rw-r--r-- | jstests/ssl/mixed_mode_sharded.js | 2 | ||||
-rw-r--r-- | jstests/ssl/set_parameter_ssl.js | 4 | ||||
-rw-r--r-- | jstests/ssl/sharding_with_x509.js | 16 | ||||
-rw-r--r-- | jstests/ssl/ssl_cert_password.js | 8 | ||||
-rw-r--r-- | jstests/ssl/ssl_fips.js | 4 | ||||
-rw-r--r-- | jstests/ssl/ssl_hostname_validation.js | 6 | ||||
-rw-r--r-- | jstests/ssl/upgrade_to_x509_ssl.js | 2 | ||||
-rw-r--r-- | jstests/ssl/x509_client.js | 42 |
11 files changed, 53 insertions, 53 deletions
diff --git a/jstests/ssl/disable_x509.js b/jstests/ssl/disable_x509.js index 51de95dee63..7aaf6ff1317 100644 --- a/jstests/ssl/disable_x509.js +++ b/jstests/ssl/disable_x509.js @@ -1,6 +1,6 @@ // Test enabling and disabling the MONGODB-X509 auth mech -var CLIENT_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=KernelUser,CN=client" +var CLIENT_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=KernelUser,CN=client"; var conn = MongoRunner.runMongod({smallfiles: "", auth: "", @@ -10,29 +10,29 @@ var conn = MongoRunner.runMongod({smallfiles: "", // Find out if this build supports the authenticationMechanisms startup parameter. // If it does, restart with and without the MONGODB-X509 mechanisms enabled. -var cmdOut = conn.getDB('admin').runCommand({getParameter: 1, authenticationMechanisms: 1}) +var cmdOut = conn.getDB('admin').runCommand({getParameter: 1, authenticationMechanisms: 1}); if (cmdOut.ok) { MongoRunner.stopMongod(conn); conn = MongoRunner.runMongod({ restart: conn, setParameter: "authenticationMechanisms=MONGODB-X509" }); - external = conn.getDB("$external") + external = conn.getDB("$external"); // Add user using localhost exception external.createUser({user: CLIENT_USER, roles:[ {'role':'userAdminAnyDatabase', 'db':'admin'}, - {'role':'readWriteAnyDatabase', 'db':'admin'}]}) + {'role':'readWriteAnyDatabase', 'db':'admin'}]}); // Localhost exception should not be in place anymore - assert.throws( function() { test.foo.findOne()}, {}, "read without login" ) + assert.throws( function() { test.foo.findOne();}, {}, "read without login" ); assert( external.auth({user: CLIENT_USER, mechanism: 'MONGODB-X509'}), - "authentication with valid user failed" ) + "authentication with valid user failed" ); MongoRunner.stopMongod(conn); conn = MongoRunner.runMongod({ restart: conn, setParameter: "authenticationMechanisms=SCRAM-SHA-1" }); - external = conn.getDB("$external") + external = conn.getDB("$external"); assert( !external.auth({user: CLIENT_USER, mechanism: 'MONGODB-X509'}), - "authentication with disabled auth mechanism succeeded" ) + "authentication with disabled auth mechanism succeeded" ); } diff --git a/jstests/ssl/initial_sync1_x509.js b/jstests/ssl/initial_sync1_x509.js index 9674056eba9..84f59d29556 100644 --- a/jstests/ssl/initial_sync1_x509.js +++ b/jstests/ssl/initial_sync1_x509.js @@ -80,4 +80,4 @@ x509_options2 = Object.merge(common_options, clusterAuthMode: "x509"}); var replTest = new ReplSetTest({nodes : {node0 : x509_options1, node1 : x509_options2}}); var conns = replTest.startSet(); -assert.throws( function() { replTest.initiate() } ); +assert.throws( function() { replTest.initiate(); } ); diff --git a/jstests/ssl/mixed_mode_repl.js b/jstests/ssl/mixed_mode_repl.js index e5d7297c7e3..b2aab8ec8dc 100644 --- a/jstests/ssl/mixed_mode_repl.js +++ b/jstests/ssl/mixed_mode_repl.js @@ -1,7 +1,7 @@ // This test is related to mixed_mode_repl_nossl.js in // the sslSpecial test set. This test must be run with --use-ssl -load("jstests/ssl/libs/ssl_helpers.js") +load("jstests/ssl/libs/ssl_helpers.js"); // Verify that requireSSL allows ssl connections print("=== Testing requireSSL/requireSSL cluster ==="); @@ -12,7 +12,7 @@ print("=== Testing allowSSL/preferSSL cluster ==="); replShouldSucceed("allow-prefer", allowSSL, preferSSL); // Test mixed sslMode preferSSL/requireSSL -print("=== Testing preferSSL/requireSSL cluster ===") +print("=== Testing preferSSL/requireSSL cluster ==="); replShouldSucceed("prefer-require", preferSSL, requireSSL); // Test mixed sslMode disabled/preferSSL - should fail diff --git a/jstests/ssl/mixed_mode_sharded.js b/jstests/ssl/mixed_mode_sharded.js index efee241ff0c..8abaf77dabf 100644 --- a/jstests/ssl/mixed_mode_sharded.js +++ b/jstests/ssl/mixed_mode_sharded.js @@ -7,7 +7,7 @@ load("jstests/ssl/libs/ssl_helpers.js"); print("=== Testing requireSSL/requireSSL cluster ==="); mixedShardTest(requireSSL, requireSSL, true); -print("=== Testing preferSSL/requireSSL cluster ===") +print("=== Testing preferSSL/requireSSL cluster ==="); mixedShardTest(preferSSL, requireSSL, true); mixedShardTest(requireSSL, preferSSL, true); diff --git a/jstests/ssl/set_parameter_ssl.js b/jstests/ssl/set_parameter_ssl.js index 98a4065b8a0..92486f663d9 100644 --- a/jstests/ssl/set_parameter_ssl.js +++ b/jstests/ssl/set_parameter_ssl.js @@ -1,7 +1,7 @@ // Test changing the --sslMode and --clusterAuthMode parameters using setParameter -var SERVER_CERT = "jstests/libs/server.pem" -var CA_CERT = "jstests/libs/ca.pem" +var SERVER_CERT = "jstests/libs/server.pem"; +var CA_CERT = "jstests/libs/ca.pem"; function testSSLTransition(oldMode, newMode, shouldSucceed) { var conn = MongoRunner.runMongod({ diff --git a/jstests/ssl/sharding_with_x509.js b/jstests/ssl/sharding_with_x509.js index aee7ac0e15f..8a7e747c6ad 100644 --- a/jstests/ssl/sharding_with_x509.js +++ b/jstests/ssl/sharding_with_x509.js @@ -24,14 +24,14 @@ var st = new ShardingTest({ name : "sharding_with_x509" , st.s.getDB('admin').createUser({user: 'admin', pwd: 'pwd', roles: ['root']}); st.s.getDB('admin').auth('admin', 'pwd'); -var coll = st.s.getCollection( "test.foo" ) +var coll = st.s.getCollection( "test.foo" ); -st.shardColl( coll, { _id : 1 }, false ) +st.shardColl( coll, { _id : 1 }, false ); // Create an index so we can find by num later -coll.ensureIndex({ insert : 1 }) +coll.ensureIndex({ insert : 1 }); -print( "starting insertion phase" ) +print( "starting insertion phase" ); // Insert a bunch of data var toInsert = 2000; @@ -41,7 +41,7 @@ for( var i = 0; i < toInsert; i++ ){ } assert.writeOK(bulk.execute()); -print( "starting updating phase" ) +print( "starting updating phase" ); // Update a bunch of data var toUpdate = toInsert; @@ -52,7 +52,7 @@ for( var i = 0; i < toUpdate; i++ ){ } assert.writeOK(bulk.execute()); -print( "starting deletion" ) +print( "starting deletion" ); // Remove a bunch of data var toDelete = toInsert / 2; @@ -63,7 +63,7 @@ for( var i = 0; i < toDelete; i++ ){ assert.writeOK(bulk.execute()); // Make sure the right amount of data is there -assert.eq( coll.find().count(), toInsert / 2 ) +assert.eq( coll.find().count(), toInsert / 2 ); // Finish -st.stop() +st.stop(); diff --git a/jstests/ssl/ssl_cert_password.js b/jstests/ssl/ssl_cert_password.js index 8fa23eaabeb..b50fec9101c 100644 --- a/jstests/ssl/ssl_cert_password.js +++ b/jstests/ssl/ssl_cert_password.js @@ -97,11 +97,11 @@ assert.eq(22, c.findOne().a, "did not find correct value in document after mongoimport"); // Test that mongofiles supports ssl -var mongofiles_ssl_dbname = "mongofiles_ssl" +var mongofiles_ssl_dbname = "mongofiles_ssl"; mongofiles_db = md.getDB(mongofiles_ssl_dbname); -source_filename = 'jstests/ssl/ssl_cert_password.js' -filename = 'ssl_cert_password.js' +source_filename = 'jstests/ssl/ssl_cert_password.js'; +filename = 'ssl_cert_password.js'; exit_code = runMongoProgram("mongofiles", "-d", mongofiles_ssl_dbname, "put", source_filename, "--port", md.port, @@ -113,7 +113,7 @@ assert.eq(exit_code, 0, "Failed to start mongofiles with ssl"); md5 = md5sumFile(source_filename); -file_obj = mongofiles_db.fs.files.findOne() +file_obj = mongofiles_db.fs.files.findOne(); assert(file_obj, "failed to find file object in mongofiles_ssl db using gridfs"); md5_stored = file_obj.md5; md5_computed = mongofiles_db.runCommand({filemd5: file_obj._id}).md5; diff --git a/jstests/ssl/ssl_fips.js b/jstests/ssl/ssl_fips.js index 2f52e0a27ae..2630377fe36 100644 --- a/jstests/ssl/ssl_fips.js +++ b/jstests/ssl/ssl_fips.js @@ -17,9 +17,9 @@ var mongo = runMongoProgram("mongo", // if mongo shell didn't start/connect properly if (mongo != 0) { print("mongod failed to start, checking for FIPS support"); - mongoOutput = rawMongoProgramOutput() + mongoOutput = rawMongoProgramOutput(); assert(mongoOutput.match(/this version of mongodb was not compiled with FIPS support/) || - mongoOutput.match(/FIPS_mode_set:fips mode not supported/)) + mongoOutput.match(/FIPS_mode_set:fips mode not supported/)); } else { // verify that auth works, SERVER-18051 diff --git a/jstests/ssl/ssl_hostname_validation.js b/jstests/ssl/ssl_hostname_validation.js index 6ec02381094..7c60226f0ec 100644 --- a/jstests/ssl/ssl_hostname_validation.js +++ b/jstests/ssl/ssl_hostname_validation.js @@ -1,10 +1,10 @@ // Test SSL server certificate hostname validation // for client-server and server-server connections -var CA_CERT = "jstests/libs/ca.pem" +var CA_CERT = "jstests/libs/ca.pem"; var SERVER_CERT = "jstests/libs/server.pem"; var CN_CERT = "jstests/libs/localhostnameCN.pem"; var SAN_CERT = "jstests/libs/localhostnameSAN.pem"; -var CLIENT_CERT = "jstests/libs/client.pem" +var CLIENT_CERT = "jstests/libs/client.pem"; var BAD_SAN_CERT = "jstests/libs/badSAN.pem"; function testCombination(certPath, allowInvalidHost, allowInvalidCert, shouldSucceed) { @@ -74,7 +74,7 @@ ssl_options = {sslMode : "requireSSL", replTest = new ReplSetTest({nodes : {node0 : ssl_options, node1 : ssl_options}}); replTest.startSet(); -assert.throws( function() { replTest.initiate() } ); +assert.throws( function() { replTest.initiate(); } ); replTest.stopSet(); // 3. Initiate ReplSetTest with invalid certs but set allowInvalidHostnames diff --git a/jstests/ssl/upgrade_to_x509_ssl.js b/jstests/ssl/upgrade_to_x509_ssl.js index fef4d1ca848..2ff79bcd7bf 100644 --- a/jstests/ssl/upgrade_to_x509_ssl.js +++ b/jstests/ssl/upgrade_to_x509_ssl.js @@ -15,7 +15,7 @@ function authAllNodes() { var status = rst.nodes[n].getDB("admin").auth("root", "pwd"); assert.eq(status, 1); } -}; +} load("jstests/ssl/libs/ssl_helpers.js"); diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js index 725a3a4ae59..769909f14b4 100644 --- a/jstests/ssl/x509_client.js +++ b/jstests/ssl/x509_client.js @@ -6,7 +6,7 @@ var conn = MongoRunner.runMongod({smallfiles: "", sslCAFile: "jstests/libs/ca.pem"}); conn.getDB('admin').createUser({user: "root", pwd: "pass", roles: ["root"]}); conn.getDB('admin').auth("root", "pass"); -var cmdOut = conn.getDB('admin').runCommand({getParameter: 1, authenticationMechanisms: 1}) +var cmdOut = conn.getDB('admin').runCommand({getParameter: 1, authenticationMechanisms: 1}); if (cmdOut.ok) { TestData.authMechanism = "MONGODB-X509"; // SERVER-10353 } @@ -14,56 +14,56 @@ conn.getDB('admin').dropAllUsers(); conn.getDB('admin').logout(); MongoRunner.stopMongod(conn); -var SERVER_CERT = "jstests/libs/server.pem" -var CA_CERT = "jstests/libs/ca.pem" +var SERVER_CERT = "jstests/libs/server.pem"; +var CA_CERT = "jstests/libs/ca.pem"; -var SERVER_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=Kernel,CN=server" -var INTERNAL_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=Kernel,CN=internal" -var CLIENT_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=KernelUser,CN=client" -var INVALID_CLIENT_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=KernelUser,CN=invalid" +var SERVER_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=Kernel,CN=server"; +var INTERNAL_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=Kernel,CN=internal"; +var CLIENT_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=KernelUser,CN=client"; +var INVALID_CLIENT_USER = "C=US,ST=New York,L=New York City,O=MongoDB,OU=KernelUser,CN=invalid"; function authAndTest(mongo) { - external = mongo.getDB("$external") + external = mongo.getDB("$external"); test = mongo.getDB("test"); // It should be impossible to create users with the same name as the server's subject assert.throws( function() { external.createUser({user: SERVER_USER, roles: [{'role':'userAdminAnyDatabase', 'db':'admin'}] - }) - }, {}, "Created user with same name as the server's x.509 subject") + }); + }, {}, "Created user with same name as the server's x.509 subject"); // It should be impossible to create users with names recognized as cluster members assert.throws( function() { external.createUser({user: INTERNAL_USER, roles: [{'role':'userAdminAnyDatabase', 'db':'admin'}] - }) - }, {}, "Created user which would be recognized as a cluster member") + }); + }, {}, "Created user which would be recognized as a cluster member"); // Add user using localhost exception external.createUser({user: CLIENT_USER, roles:[ {'role':'userAdminAnyDatabase', 'db':'admin'}, - {'role':'readWriteAnyDatabase', 'db':'admin'}]}) + {'role':'readWriteAnyDatabase', 'db':'admin'}]}); // It should be impossible to create users with an internal name assert.throws( function() {external.createUser({user: SERVER_USER, roles: [ - {'role':'userAdminAnyDatabase', 'db':'admin'}]})}) + {'role':'userAdminAnyDatabase', 'db':'admin'}]});}); // Localhost exception should not be in place anymore - assert.throws( function() { test.foo.findOne()}, {}, "read without login" ) + assert.throws( function() { test.foo.findOne();}, {}, "read without login" ); assert( !external.auth({user: INVALID_CLIENT_USER, mechanism: 'MONGODB-X509'}), - "authentication with invalid user failed" ) + "authentication with invalid user failed" ); assert( external.auth({user: CLIENT_USER, mechanism: 'MONGODB-X509'}), - "authentication with valid user failed" ) + "authentication with valid user failed" ); // Check that we can add a user and read data test.createUser({user: "test", pwd: "test", roles:[ - {'role': 'readWriteAnyDatabase', 'db': 'admin'}]}) - test.foo.findOne() + {'role': 'readWriteAnyDatabase', 'db': 'admin'}]}); + test.foo.findOne(); external.logout(); - assert.throws( function() { test.foo.findOne()}, {}, "read after logout" ) + assert.throws( function() { test.foo.findOne();}, {}, "read after logout" ); } print("1. Testing x.509 auth to mongod"); @@ -88,4 +88,4 @@ var st = new ShardingTest({ shards : 1, useHostname: false, }}); -authAndTest(new Mongo("localhost:" + st.s0.port)) +authAndTest(new Mongo("localhost:" + st.s0.port)); |