Skip to content
This repository has been archived by the owner on Apr 20, 2019. It is now read-only.

Commit

Permalink
add linting, remove 0.12 and iojs add v4 and other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydbenson committed Sep 16, 2015
1 parent 32c4d3b commit a011c3d
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 105 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ language: node_js

node_js:
- 0.10
- 0.12
- iojs
- 4

sudo: false
9 changes: 0 additions & 9 deletions Makefile

This file was deleted.

1 change: 0 additions & 1 deletion index.js

This file was deleted.

8 changes: 4 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ internals.hawk = function (server, options) {
var payloadHash = Hawk.crypto.initializePayloadHash(request.auth.credentials.algorithm, request.headers['content-type']);
payloadHash.update(chunk);

request.on('peek', function (chunk) {
request.on('peek', function (chunk2) {

payloadHash.update(chunk);
payloadHash.update(chunk2);
});

request.once('finish', function () {
Expand All @@ -58,7 +58,7 @@ internals.hawk = function (server, options) {
if (err) {
return reply(err, null, result);
}

return reply.continue(result);
});
},
Expand Down Expand Up @@ -121,7 +121,7 @@ internals.bewit = function (server, options) {
if (err) {
return reply(err, null, result);
}

return reply.continue(result);
});
}
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Hawk authentication plugin",
"version": "3.0.0",
"repository": "git://github.com/hapijs/hapi-auth-hawk",
"main": "index",
"main": "lib/index.js",
"keywords": [
"hapi",
"plugin",
Expand All @@ -28,7 +28,8 @@
"lab": "5.x.x"
},
"scripts": {
"test": "make test-cov"
"test": "lab -r console -t 100 -a code -L",
"test-cov-html": "lab -r html -o coverage.html -a code -L"
},
"licenses": [
{
Expand Down
12 changes: 4 additions & 8 deletions test/bewit.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,15 @@ describe('bewit scheme', function () {
if (credentials[id]) {
return callback(credentials[id].err, credentials[id].cred);
}
else {
return callback(null, null);
}
return callback(null, null);
};

var getBewit = function (id, path) {

if (credentials[id] && credentials[id].cred) {
return Hawk.uri.getBewit('http://example.com:8080' + path, { credentials: credentials[id].cred, ttlSec: 60 });
}
else {
return '';
}
return '';
};

var bewitHandler = function (request, reply) {
Expand All @@ -74,7 +70,7 @@ describe('bewit scheme', function () {
server.route([
{ method: 'GET', path: '/bewit', handler: bewitHandler, config: { auth: 'default' } },
{ method: 'GET', path: '/bewitOptional', handler: bewitHandler, config: { auth: { mode: 'optional', strategy: 'default' } } },
{ method: 'GET', path: '/bewitScope', handler: bewitHandler, config: { auth: { scope: 'x', strategy: 'default' } } },
{ method: 'GET', path: '/bewitScope', handler: bewitHandler, config: { auth: { scope: 'x', strategy: 'default' } } }
]);

done();
Expand Down Expand Up @@ -135,7 +131,7 @@ describe('bewit scheme', function () {
var bewit = getBewit('john', '/bewit');
var request = { method: 'GET', url: '/bewit?bewit=' + bewit, headers: { custom: 'example.com:8080' } };

var server = new Hapi.Server();
server = new Hapi.Server();
server.connection();
server.register(require('../'), function (err) {

Expand Down
Loading

0 comments on commit a011c3d

Please sign in to comment.