diff --git a/tests/cert-emails-test.js b/tests/cert-emails-test.js index d58dea80a63c7fe6f2e1e16a95168febe59f5e38..19ded2b42b2ee221e1b96ae3989da9a090341d0e 100755 --- a/tests/cert-emails-test.js +++ b/tests/cert-emails-test.js @@ -98,7 +98,11 @@ suite.addBatch({ } }, "cert key invoked with proper argument": { - topic: wsapi.post(cert_key_url, { email: 'syncer@somehost.com', pubkey: kp.publicKey.serialize() }), + topic: wsapi.post(cert_key_url, { + email: 'syncer@somehost.com', + pubkey: kp.publicKey.serialize(), + ephemeral: false + }), "returns a response with a proper content-type" : function(err, r) { assert.strictEqual(r.code, 200); }, @@ -143,7 +147,11 @@ suite.addBatch({ } }, "cert key invoked proper arguments but incorrect email address": { - topic: wsapi.post(cert_key_url, { email: 'syncer2@somehost.com', pubkey: kp.publicKey.serialize() }), + topic: wsapi.post(cert_key_url, { + email: 'syncer2@somehost.com', + pubkey: kp.publicKey.serialize(), + ephemeral: false + }), "returns a response with a proper error content-type" : function(err, r) { assert.strictEqual(r.code, 400); } diff --git a/tests/forgotten-email-test.js b/tests/forgotten-email-test.js index ed0fbc8ce9801f0e03ce04a9cd88bac833e5425e..9fc0bc43025b0ecf91e422d7d08c266fce6bb731 100755 --- a/tests/forgotten-email-test.js +++ b/tests/forgotten-email-test.js @@ -162,13 +162,21 @@ suite.addBatch({ // valid (this is so *until* someone clicks through) suite.addBatch({ "first email works": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'first@fakeemail.com', pass: 'firstfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'first@fakeemail.com', + pass: 'firstfakepass', + ephemeral: false + }), "should work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); } }, "second email works": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'second@fakeemail.com', pass: 'firstfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'second@fakeemail.com', + pass: 'firstfakepass', + ephemeral: false + }), "should work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); } @@ -192,13 +200,21 @@ suite.addBatch({ // password, and all other combinations should fail suite.addBatch({ "first email, first pass bad": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'first@fakeemail.com', pass: 'firstfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'first@fakeemail.com', + pass: 'firstfakepass', + ephemeral: false + }), "shouldn't work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, false); } }, "first email, second pass good": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'first@fakeemail.com', pass: 'secondfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'first@fakeemail.com', + pass: 'secondfakepass', + ephemeral: false + }), "should work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); } @@ -210,13 +226,21 @@ suite.addBatch({ } }, "second email, first pass good": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'second@fakeemail.com', pass: 'firstfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'second@fakeemail.com', + pass: 'firstfakepass', + ephemeral: false + }), "should work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); } }, "second email, second pass bad": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'second@fakeemail.com', pass: 'secondfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'second@fakeemail.com', + pass: 'secondfakepass', + ephemeral: false + }), "shouldn' work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, false); } diff --git a/tests/password-bcrypt-update-test.js b/tests/password-bcrypt-update-test.js index c403d6ef715d1250b6671128abd9a64b1b7af923..51d9660810960fc4a55c95ec269e5be901dc9ed4 100755 --- a/tests/password-bcrypt-update-test.js +++ b/tests/password-bcrypt-update-test.js @@ -117,7 +117,8 @@ suite.addBatch({ "re-authentication": { topic: wsapi.post('/wsapi/authenticate_user', { email: TEST_EMAIL, - pass: TEST_PASSWORD + pass: TEST_PASSWORD, + ephemeral: false }), "should work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); @@ -153,7 +154,8 @@ suite.addBatch({ "and re-authentication": { topic: wsapi.post('/wsapi/authenticate_user', { email: TEST_EMAIL, - pass: TEST_PASSWORD + pass: TEST_PASSWORD, + ephemeral: false }), "should still work": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); diff --git a/tests/password-update-test.js b/tests/password-update-test.js index 9d484f56f47025c365bedee2af4a39fac4caf7eb..a8cbf9fc9320c9c59438f75e8fa210129db07aa2 100755 --- a/tests/password-update-test.js +++ b/tests/password-update-test.js @@ -74,7 +74,8 @@ suite.addBatch({ "authenticating with the password": { topic: wsapi.post('/wsapi/authenticate_user', { email: TEST_EMAIL, - pass: OLD_PASSWORD + pass: OLD_PASSWORD, + ephemeral: false }), "works as expected": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); @@ -83,7 +84,8 @@ suite.addBatch({ "authenticating with the wrong password": { topic: wsapi.post('/wsapi/authenticate_user', { email: TEST_EMAIL, - pass: NEW_PASSWORD + pass: NEW_PASSWORD, + ephemeral: false }), "fails as expected": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, false); @@ -131,7 +133,8 @@ suite.addBatch({ "authenticating with the password": { topic: wsapi.post('/wsapi/authenticate_user', { email: TEST_EMAIL, - pass: NEW_PASSWORD + pass: NEW_PASSWORD, + ephemeral: false }), "works as expected": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, true); @@ -140,7 +143,8 @@ suite.addBatch({ "authenticating with the wrong password": { topic: wsapi.post('/wsapi/authenticate_user', { email: TEST_EMAIL, - pass: OLD_PASSWORD + pass: OLD_PASSWORD, + ephemeral: false }), "fails as expected": function(err, r) { assert.strictEqual(JSON.parse(r.body).success, false); diff --git a/tests/primary-then-secondary-test.js b/tests/primary-then-secondary-test.js index 6b47385a950056d788ba6c144def02c805cacb05..06a8230f9e05ac6a2dbb384a9edbea0659db211c 100755 --- a/tests/primary-then-secondary-test.js +++ b/tests/primary-then-secondary-test.js @@ -198,7 +198,8 @@ suite.addBatch({ "authentication with first email": { topic: wsapi.post('/wsapi/authenticate_user', { email: TEST_EMAIL, - pass: TEST_PASS + pass: TEST_PASS, + ephemeral: false }), "works": function(err, r) { assert.strictEqual(r.code, 200); @@ -207,7 +208,8 @@ suite.addBatch({ "authentication with second email": { topic: wsapi.post('/wsapi/authenticate_user', { email: SECONDARY_EMAIL, - pass: TEST_PASS + pass: TEST_PASS, + ephemeral: false }), "works": function(err, r) { assert.strictEqual(r.code, 200); diff --git a/tests/registration-status-wsapi-test.js b/tests/registration-status-wsapi-test.js index 394383c207dabeb1b78e1a924d4f91ec55064c37..f4515775c3d4e8789c18045abec75813ce43e3e4 100755 --- a/tests/registration-status-wsapi-test.js +++ b/tests/registration-status-wsapi-test.js @@ -35,7 +35,11 @@ suite.addBatch({ suite.addBatch({ "authentication as an unknown user": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'first@fakeemail.com', pass: 'secondfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'first@fakeemail.com', + pass: 'secondfakepass', + ephemeral: false + }), "fails": function (err, r) { assert.isFalse(JSON.parse(r.body).success); } @@ -234,7 +238,11 @@ suite.addBatch({ suite.addBatch({ "after re-registration, authenticating with new credetials": { - topic: wsapi.post('/wsapi/authenticate_user', { email: 'first@fakeemail.com', pass: 'secondfakepass' }), + topic: wsapi.post('/wsapi/authenticate_user', { + email: 'first@fakeemail.com', + pass: 'secondfakepass', + ephemeral: false + }), "works as you might expect": function (err, r) { assert.strictEqual(JSON.parse(r.body).success, true); } diff --git a/tests/stalled-mysql-test.js b/tests/stalled-mysql-test.js index a0753552763a36b9a1f434c1986e47b64cee4ca8..c4b1e18399de2253cb12e56eb3c1684f928f83e5 100755 --- a/tests/stalled-mysql-test.js +++ b/tests/stalled-mysql-test.js @@ -105,7 +105,8 @@ suite.addBatch({ "authenticate_user": { topic: wsapi.post('/wsapi/authenticate_user', { email: 'test@example.com', - pass: 'oogabooga' + pass: 'oogabooga', + ephemeral: false }), "fails with 503": function(err, r) { assert.strictEqual(r.code, 503); @@ -203,7 +204,8 @@ suite.addBatch({ "cert_key": { topic: wsapi.post('/wsapi/cert_key', { email: "test@whatev.er", - pubkey: "bogus" + pubkey: "bogus", + ephemeral: false }), "fails with 503": function(err, r) { assert.strictEqual(r.code, 503); diff --git a/tests/verifier-test.js b/tests/verifier-test.js index b2a455dc04807502630199c49333d5a9a42e7572..499855873f1eb3250de9603b7d79c8f390b71f60 100755 --- a/tests/verifier-test.js +++ b/tests/verifier-test.js @@ -97,7 +97,8 @@ suite.addBatch({ topic: function() { wsapi.post('/wsapi/cert_key', { email: TEST_EMAIL, - pubkey: g_keypair.publicKey.serialize() + pubkey: g_keypair.publicKey.serialize(), + ephemeral: false }).call(this); }, "works swimmingly": function(err, r) {