From 3c060766e788ab434b04eea6ec7ee708aee2951d Mon Sep 17 00:00:00 2001 From: Juan Carlos Picado Date: Sun, 27 Nov 2016 15:07:45 +0100 Subject: [PATCH 1/4] Fix #65 and also PR on fl4re#4 --- lib/GUI/entry.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/GUI/entry.hbs b/lib/GUI/entry.hbs index 6e63d371..a28fe423 100644 --- a/lib/GUI/entry.hbs +++ b/lib/GUI/entry.hbs @@ -8,7 +8,7 @@
- By: {{ _npmUser.name }} + By: {{ author.name }}
From 0210752ea5befad5a4124fa9cae5614bf2ad8772 Mon Sep 17 00:00:00 2001 From: Juan Carlos Picado Date: Mon, 5 Dec 2016 08:42:43 +0100 Subject: [PATCH 2/4] clean warnings on unit test --- lib/auth.js | 12 ++++++------ lib/index-api.js | 2 +- test/functional/lib/server.js | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/auth.js b/lib/auth.js index c1028e4a..c7044c9a 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -195,9 +195,9 @@ Auth.prototype.basic_middleware = function() { var scheme = parts[0] if (scheme === 'Basic') { - var credentials = Buffer(parts[1], 'base64').toString() + var credentials = new Buffer(parts[1], 'base64').toString() } else if (scheme === 'Bearer') { - var credentials = self.aes_decrypt(Buffer(parts[1], 'base64')).toString('utf8') + var credentials = self.aes_decrypt(new Buffer(parts[1], 'base64')).toString('utf8') if (!credentials) return next() } else { return next() @@ -286,7 +286,7 @@ Auth.prototype.cookie_middleware = function() { req.remote_user = AuthenticatedUser(user.u, user.g) req.remote_user.token = token next()*/ - var credentials = self.aes_decrypt(Buffer(token, 'base64')).toString('utf8') + var credentials = self.aes_decrypt(new Buffer(token, 'base64')).toString('utf8') if (!credentials) return next() var index = credentials.indexOf(':') @@ -314,13 +314,13 @@ Auth.prototype.issue_token = function(user) { t: ~~(Date.now()/1000), }, { indent: false }) - data = Buffer(data, 'utf8') + data = new Buffer(data, 'utf8') var mac = Crypto.createHmac('sha256', this.secret).update(data).digest() return Buffer.concat([ data, mac ]).toString('base64') } Auth.prototype.decode_token = function(str, expire_time) { - var buf = Buffer(str, 'base64') + var buf = new Buffer(str, 'base64') if (buf.length <= 32) throw Error[401]('invalid token') var data = buf.slice(0, buf.length - 32) @@ -355,7 +355,7 @@ Auth.prototype.aes_decrypt = function(buf) { var b1 = c.update(buf) var b2 = c.final() } catch(_) { - return Buffer(0) + return new Buffer(0) } return Buffer.concat([ b1, b2 ]) } diff --git a/lib/index-api.js b/lib/index-api.js index 224573fb..f53d152e 100644 --- a/lib/index-api.js +++ b/lib/index-api.js @@ -364,7 +364,7 @@ module.exports = function(config, auth, storage) { }) // this is dumb and memory-consuming, but what choices do we have? - stream.end(Buffer(data.data, 'base64')) + stream.end(new Buffer(data.data, 'base64')) stream.done() } diff --git a/test/functional/lib/server.js b/test/functional/lib/server.js index 4a1af0ef..0a720b14 100644 --- a/test/functional/lib/server.js +++ b/test/functional/lib/server.js @@ -27,7 +27,7 @@ Server.prototype.request = function(options) { } Server.prototype.auth = function(user, pass) { - this.authstr = 'Basic '+(Buffer(user+':'+pass)).toString('base64') + this.authstr = 'Basic '+(new Buffer(user+':'+pass)).toString('base64') return this.request({ uri: '/-/user/org.couchdb.user:'+encodeURIComponent(user)+'/-rev/undefined', method: 'PUT', From d6dd63f01201d8cdcd4d0cad96d214b6c89fddb9 Mon Sep 17 00:00:00 2001 From: Juan Carlos Picado Date: Mon, 5 Dec 2016 08:52:52 +0100 Subject: [PATCH 3/4] add travis node 4,6 and 7 --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 40ff1cf8..b157262e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: node_js node_js: - '0.10' - '0.12' + - '4' + - '6' + - '7' - '1' - '2' - 'iojs' From 32cc6ea61767a81aeda934e5ffe7aac2864cfc42 Mon Sep 17 00:00:00 2001 From: Juan Carlos Picado Date: Mon, 5 Dec 2016 20:33:11 +0100 Subject: [PATCH 4/4] Removed testing support for 0.10 and 0.12 (already deprecated) --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b157262e..6a51a5aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: node_js node_js: - - '0.10' - - '0.12' - '4' - '6' - '7'