Permalink
Browse files

Some cleanup from the bcrypt upgrade to v0.7.1.

* Change the last bcrypt.get_rounds to bcrypt.getRounds.
* Remove the bcrypt require from tests where it is not needed.
* Remove exports.get_rounds from bcrypt.js, it has been deprecated.
  • Loading branch information...
1 parent 364003e commit 07d256144ea35aaa4b593461148cf3422f399fb7 @shane-tomlinson shane-tomlinson committed Aug 8, 2012
View
@@ -46,7 +46,7 @@ exports.compare = function(pass, hash, cb) {
})
};
-exports.get_rounds = exports.getRounds = function(hash) {
+exports.getRounds = function(hash) {
return bcrypt.getRounds(hash);
};
@@ -104,7 +104,7 @@ exports.process = function(req, res) {
} else {
logger.info("bcrypt rounds of password for " + uid +
" successfully updated (from " +
- bcrypt.get_rounds(hash) + " to "
+ bcrypt.getRounds(hash) + " to "
+ config.get('bcrypt_work_factor') + ")");
}
});
View
@@ -13,7 +13,6 @@ start_stop = require('./lib/start-stop.js'),
wsapi = require('./lib/wsapi.js'),
db = require('../lib/db.js'),
config = require('../lib/configuration.js'),
-bcrypt = require('bcrypt'),
http = require('http');
var suite = vows.describe('heartbeat');
@@ -58,7 +57,7 @@ start_stop.addStartupBatches(suite);
suite.addBatch({
"stopping the browserid process": {
topic: function() {
- process.kill(parseInt(process.env['BROWSERID_PID'], 10), 'SIGSTOP');
+ process.kill(parseInt(process.env['BROWSERID_PID'], 10), 'SIGSTOP');
this.callback();
},
"then doing a deep __heartbeat__ on router": {
@@ -88,7 +87,7 @@ suite.addBatch({
},
"but upon SIGCONT": {
topic: function(e, code) {
- process.kill(parseInt(process.env['BROWSERID_PID'], 10), 'SIGCONT');
+ process.kill(parseInt(process.env['BROWSERID_PID'], 10), 'SIGCONT');
this.callback();
},
"a deep heartbeat": {
@@ -119,7 +118,7 @@ suite.addBatch({
suite.addBatch({
"stopping the static process": {
topic: function() {
- process.kill(parseInt(process.env['STATIC_PID'], 10), 'SIGSTOP');
+ process.kill(parseInt(process.env['STATIC_PID'], 10), 'SIGSTOP');
this.callback();
},
"then doing a deep __heartbeat__ on router": {
@@ -149,7 +148,7 @@ suite.addBatch({
},
"but upon SIGCONT": {
topic: function(e, code) {
- process.kill(parseInt(process.env['STATIC_PID'], 10), 'SIGCONT');
+ process.kill(parseInt(process.env['STATIC_PID'], 10), 'SIGCONT');
this.callback();
},
"a deep heartbeat": {
@@ -94,7 +94,7 @@ suite.addBatch({
"is bcrypted with the expected number of rounds": function(err, r) {
assert.isNull(err);
assert.equal(typeof r, 'string');
- assert.equal(config.get('bcrypt_work_factor'), bcrypt.get_rounds(r));
+ assert.equal(config.get('bcrypt_work_factor'), bcrypt.getRounds(r));
}
}
});
@@ -143,7 +143,7 @@ suite.addBatch({
"its bcrypted with 8 rounds": function(err, r) {
assert.isNull(err);
assert.equal(typeof r, 'string');
- assert.equal(8, bcrypt.get_rounds(r));
+ assert.equal(8, bcrypt.getRounds(r));
}
}
}
@@ -12,8 +12,7 @@ vows = require('vows'),
start_stop = require('./lib/start-stop.js'),
wsapi = require('./lib/wsapi.js'),
db = require('../lib/db.js'),
-config = require('../lib/configuration.js'),
-bcrypt = require('bcrypt');
+config = require('../lib/configuration.js');
var suite = vows.describe('password-length');
@@ -12,8 +12,7 @@ vows = require('vows'),
start_stop = require('./lib/start-stop.js'),
wsapi = require('./lib/wsapi.js'),
db = require('../lib/db.js'),
-config = require('../lib/configuration.js'),
-bcrypt = require('bcrypt');
+config = require('../lib/configuration.js');
var suite = vows.describe('session-context');
@@ -14,7 +14,6 @@ start_stop = require('./lib/start-stop.js'),
wsapi = require('./lib/wsapi.js'),
db = require('../lib/db.js'),
config = require('../lib/configuration.js'),
-bcrypt = require('bcrypt'),
primary = require('./lib/primary.js'),
ca = require('../lib/keysigner/ca.js'),
jwcrypto = require('jwcrypto');
@@ -12,8 +12,7 @@ vows = require('vows'),
start_stop = require('./lib/start-stop.js'),
wsapi = require('./lib/wsapi.js'),
db = require('../lib/db.js'),
-config = require('../lib/configuration.js'),
-bcrypt = require('bcrypt');
+config = require('../lib/configuration.js');
var suite = vows.describe('session-prolong');

0 comments on commit 07d2561

Please sign in to comment.