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 0.5.0 to 0.5.1

4

lib/index.js

@@ -25,3 +25,3 @@ // Load modules

/*
* req - node's Http.IncomingMessage object or an object as follows:
* req - node's HTTP request object or an object as follows:
*

@@ -105,3 +105,3 @@ * var request = {

// Convert node Http.IncomingMessage to API request
// Convert node Http request object to a request configuration object

@@ -108,0 +108,0 @@ var request = Utils.parseRequest(req, options);

@@ -27,3 +27,3 @@ // Load modules

// Convert node Http.IncomingMessage to API request
// Convert node Http request object to a request configuration object

@@ -30,0 +30,0 @@ var request = Utils.parseRequest(req, options);

// Load modules
var Http = require('http');
var Hoek = require('hoek');

@@ -101,3 +100,3 @@

if (req instanceof Http.IncomingMessage == false) {
if (!req.headers) {
return req;

@@ -104,0 +103,0 @@ }

{
"name": "hawk",
"description": "HTTP Hawk Authentication Scheme",
"version": "0.5.0",
"version": "0.5.1",
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "contributors": [],

@@ -6,3 +6,3 @@ ![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png)

Current version: **0.5.0**
Current version: **0.5.1**

@@ -9,0 +9,0 @@ [![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk)

@@ -54,8 +54,11 @@ // Load modules

it('should generate a header then successfully parse it (IncomingMessage)', function (done) {
it('should generate a header then successfully parse it (node request)', function (done) {
var req = new Http.IncomingMessage();
req.method = 'GET';
req.url = '/resource/4?filter=a';
req.headers.host = 'example.com:8080';
var req = {
method: 'GET',
url: '/resource/4?filter=a',
headers: {
host: 'example.com:8080'
}
};

@@ -357,6 +360,9 @@ credentialsFunc('123456', function (err, credentials) {

var req = new Http.IncomingMessage();
req.headers.authorization = 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"';
req.method = 'GET';
req.url = '/resource/4?filter=a';
var req = {
method: 'GET',
url: '/resource/4?filter=a',
headers: {
authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
}
};

@@ -553,7 +559,10 @@ Hawk.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Date.now() }, function (err, credentials, attributes) {

var req = new Http.IncomingMessage();
req.headers.host = ':10',
req.headers.authorization = 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"';
req.method = 'GET';
req.url = '/resource/4?filter=a';
var req = {
method: 'GET',
url: '/resource/4?filter=a',
headers: {
host: ':8080',
authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
}
};

@@ -570,7 +579,10 @@ Hawk.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Date.now() }, function (err, credentials, attributes) {

var req = new Http.IncomingMessage();
req.headers.host = 'example.com:something',
req.headers.authorization = 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"';
req.method = 'GET';
req.url = '/resource/4?filter=a';
var req = {
method: 'GET',
url: '/resource/4?filter=a',
headers: {
host: 'example.com:something',
authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
}
};

@@ -577,0 +589,0 @@ Hawk.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Date.now() }, function (err, credentials, attributes) {

@@ -153,6 +153,9 @@ // Load modules

var req = new Http.IncomingMessage();
req.headers.host = 'example.com:something',
req.method = 'GET';
req.url = '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ';
var req = {
method: 'GET',
url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
headers: {
host: 'example.com:something'
}
};

@@ -159,0 +162,0 @@ Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {

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