Socket
Socket
Sign inDemoInstall

hawk

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hawk - npm Package Compare versions

Comparing version 1.1.0-pre to 1.1.1

20

lib/browser.js

@@ -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();
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc