hawk
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -222,2 +222,15 @@ // Load modules | ||
// Authenticate payload hash - used when payload cannot be provided during authenticate() | ||
/* | ||
calculatedHash: the payload hash calculated using Crypto.calculatePayloadHash() | ||
artifacts: from authenticate callback | ||
*/ | ||
exports.authenticatePayloadHash = function (calculatedHash, artifacts) { | ||
return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash); | ||
}; | ||
// Generate a Server-Authorization header for a given response | ||
@@ -224,0 +237,0 @@ |
{ | ||
"name": "hawk", | ||
"description": "HTTP Hawk Authentication Scheme", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "contributors": [], |
@@ -548,3 +548,3 @@ ![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) | ||
At if version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental | ||
As of version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental | ||
and is likely to change. This also means your feedback and contribution are very welcome. Feel free to open issues with questions | ||
@@ -551,0 +551,0 @@ and suggestions. |
@@ -685,3 +685,13 @@ // Load modules | ||
}); | ||
describe('#authenticatePayloadHash', function () { | ||
it('checks payload hash', function (done) { | ||
expect(Hawk.server.authenticatePayloadHash('abcdefg', { hash: 'abcdefg' })).to.equal(true); | ||
expect(Hawk.server.authenticatePayloadHash('1234567', { hash: 'abcdefg' })).to.equal(false); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
286744
3598