Comparing version 1.1.0-pre to 1.1.1
@@ -27,5 +27,5 @@ /* | ||
options: { | ||
// Required | ||
credentials: { | ||
@@ -36,5 +36,5 @@ id: 'dh37fgj492je', | ||
}, | ||
// Optional | ||
ext: 'application-specific', // Application specific data sent via the ext attribute | ||
@@ -65,2 +65,3 @@ timestamp: Date.now() / 1000, // A pre-calculated timestamp in seconds | ||
result.err = 'Invalid argument type'; | ||
return result; | ||
@@ -81,3 +82,3 @@ } | ||
// Invalid credential object | ||
result.err = 'Invalid credential object'; | ||
return result; | ||
@@ -87,2 +88,3 @@ } | ||
if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
result.err = 'Unknown algorithm'; | ||
return result; | ||
@@ -373,3 +375,9 @@ } | ||
hawk.utils.storage.setItem('hawk_ntp_offset', offset); | ||
try { | ||
hawk.utils.storage.setItem('hawk_ntp_offset', offset); | ||
} | ||
catch (err) { | ||
console.error('[hawk] could not write to storage.'); | ||
console.error(err); | ||
} | ||
}, | ||
@@ -376,0 +384,0 @@ |
@@ -57,2 +57,3 @@ // Load modules | ||
result.err = 'Invalid argument type'; | ||
return result; | ||
@@ -73,3 +74,3 @@ } | ||
// Invalid credential object | ||
result.err = 'Invalid credential object'; | ||
return result; | ||
@@ -79,2 +80,3 @@ } | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
result.err = 'Unknown algorithm'; | ||
return result; | ||
@@ -81,0 +83,0 @@ } |
@@ -5,2 +5,3 @@ // Export sub-modules | ||
exports.sntp = require('sntp'); | ||
exports.server = require('./server'); | ||
@@ -16,2 +17,1 @@ exports.client = require('./client'); | ||
{ | ||
"name": "hawk", | ||
"description": "HTTP Hawk Authentication Scheme", | ||
"version": "1.1.0-pre", | ||
"version": "1.1.1", | ||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "contributors": [], |
@@ -551,7 +551,5 @@ ![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png) | ||
**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, others are actively porting it to other | ||
platforms. There is already a [PHP](https://github.com/alexbilbie/PHP-Hawk), | ||
[.NET](https://github.com/pcibraro/hawknet), and [JAVA](https://github.com/wealdtech/hawk) libraries available. The full list | ||
is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port). Please add an issue if you are working on another | ||
port. A cross-platform test-suite is in the works. | ||
**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, it has been ported to other languages. | ||
The full list is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port&state=closed). Please add an issue if you are | ||
working on another port. A cross-platform test-suite is in the works. | ||
@@ -558,0 +556,0 @@ ### Why isn't the algorithm part of the challenge or dynamically negotiated? |
@@ -795,2 +795,24 @@ // Load modules | ||
}); | ||
describe('#setNtpOffset', function (done) { | ||
it('catches localStorage errors', function (done) { | ||
var orig = Browser.utils.storage.setItem; | ||
var error = console.error; | ||
var count = 0; | ||
console.error = function () { if (count++ === 2) { console.error.error; } }; | ||
Browser.utils.storage.setItem = function () { | ||
Browser.utils.storage.setItem = orig; | ||
throw new Error() | ||
}; | ||
expect(function () { | ||
Browser.utils.setNtpOffset(100); | ||
}).not.to.throw(); | ||
done(); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
284934
3565
1
626