Comparing version 7.0.2 to 7.0.3
@@ -7,2 +7,3 @@ 'use strict'; | ||
const Boom = require('boom'); | ||
const Hoek = require('hoek'); | ||
@@ -57,3 +58,3 @@ | ||
throw new Error('Invalid argument type'); | ||
throw Boom('Invalid argument type'); | ||
} | ||
@@ -73,7 +74,7 @@ | ||
throw new Error('Invalid credentials'); | ||
throw Boom('Invalid credentials'); | ||
} | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
throw new Error('Unknown algorithm'); | ||
throw Boom('Unknown algorithm'); | ||
} | ||
@@ -158,3 +159,3 @@ | ||
catch (err) { | ||
throw new Error('Invalid WWW-Authenticate header'); | ||
throw Boom('Invalid WWW-Authenticate header'); | ||
} | ||
@@ -169,3 +170,3 @@ | ||
if (tsm !== wwwAttributes.tsm) { | ||
throw Object.assign(new Error('Invalid server timestamp hash'), result); | ||
throw Boom('Invalid server timestamp hash', { decorate: result }); | ||
} | ||
@@ -187,3 +188,3 @@ } | ||
catch (err) { | ||
throw Object.assign(new Error('Invalid Server-Authorization header'), result); | ||
throw Boom('Invalid Server-Authorization header', { decorate: result }); | ||
} | ||
@@ -198,3 +199,3 @@ | ||
if (mac !== serverAuthAttributes.mac) { | ||
throw Object.assign(new Error('Bad response mac'), result); | ||
throw Boom('Bad response mac', { decorate: result }); | ||
} | ||
@@ -209,3 +210,3 @@ | ||
if (!serverAuthAttributes.hash) { | ||
throw Object.assign(new Error('Missing response hash attribute'), result); | ||
throw Boom('Missing response hash attribute', { decorate: result }); | ||
} | ||
@@ -215,3 +216,3 @@ | ||
if (calculatedHash !== serverAuthAttributes.hash) { | ||
throw Object.assign(new Error('Bad response payload mac'), result); | ||
throw Boom('Bad response payload mac', { decorate: result }); | ||
} | ||
@@ -255,3 +256,3 @@ | ||
throw new Error('Invalid inputs'); | ||
throw Boom('Invalid inputs'); | ||
} | ||
@@ -273,7 +274,7 @@ | ||
throw new Error('Invalid credentials'); | ||
throw Boom('Invalid credentials'); | ||
} | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
throw new Error('Unknown algorithm'); | ||
throw Boom('Unknown algorithm'); | ||
} | ||
@@ -342,3 +343,3 @@ | ||
throw new Error('Invalid inputs'); | ||
throw Boom('Invalid inputs'); | ||
} | ||
@@ -358,7 +359,7 @@ | ||
throw new Error('Invalid credentials'); | ||
throw Boom('Invalid credentials'); | ||
} | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
throw new Error('Unknown algorithm'); | ||
throw Boom('Unknown algorithm'); | ||
} | ||
@@ -365,0 +366,0 @@ |
@@ -130,3 +130,3 @@ 'use strict'; | ||
throw Object.assign(Boom.badRequest('Missing attributes'), { artifacts }); | ||
throw Boom.badRequest('Missing attributes', { decorate: { artifacts } }); | ||
} | ||
@@ -140,3 +140,3 @@ | ||
catch (err) { | ||
throw Object.assign(err, { artifacts }); | ||
throw Boom.boomify(err, { decorate: { artifacts } }); | ||
} | ||
@@ -153,7 +153,7 @@ | ||
throw Object.assign(Boom.internal('Invalid credentials'), result); | ||
throw Boom('Invalid credentials', { decorate: result }); | ||
} | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
throw Object.assign(Boom.internal('Unknown algorithm'), result); | ||
throw Boom('Unknown algorithm', { decorate: result }); | ||
} | ||
@@ -267,3 +267,3 @@ | ||
throw new Error('Invalid inputs'); | ||
throw Boom('Invalid inputs'); | ||
} | ||
@@ -282,7 +282,7 @@ | ||
throw new Error('Invalid credentials'); | ||
throw Boom('Invalid credentials'); | ||
} | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
throw new Error('Unknown algorithm'); | ||
throw Boom('Unknown algorithm'); | ||
} | ||
@@ -418,3 +418,3 @@ | ||
catch (err) { | ||
throw Object.assign(err, { bewit }); | ||
throw Boom(err, { decorate: { bewit } }); | ||
} | ||
@@ -431,7 +431,7 @@ | ||
throw Object.assign(Boom.internal('Invalid credentials'), result); | ||
throw Boom('Invalid credentials', { decorate: result }); | ||
} | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
throw Object.assign(Boom.internal('Unknown algorithm'), result); | ||
throw Boom('Unknown algorithm', { decorate: result }); | ||
} | ||
@@ -501,7 +501,7 @@ | ||
throw Object.assign(Boom.internal('Invalid credentials'), result); | ||
throw Boom('Invalid credentials', { decorate: result }); | ||
} | ||
if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) { | ||
throw Object.assign(Boom.internal('Unknown algorithm'), result); | ||
throw Boom('Unknown algorithm', { decorate: result }); | ||
} | ||
@@ -508,0 +508,0 @@ |
{ | ||
"name": "hawk", | ||
"description": "HTTP Hawk Authentication Scheme", | ||
"version": "7.0.2", | ||
"version": "7.0.3", | ||
"author": "Eran Hammer <eran@hammer.io> (http://hueniverse.com)", | ||
@@ -16,7 +16,7 @@ "repository": "git://github.com/hueniverse/hawk", | ||
"engines": { | ||
"node": ">=8.8.0" | ||
"node": ">=8.9.0" | ||
}, | ||
"dependencies": { | ||
"hoek": "5.x.x", | ||
"boom": "6.x.x", | ||
"boom": "7.x.x", | ||
"cryptiles": "4.x.x", | ||
@@ -23,0 +23,0 @@ "sntp": "3.x.x" |
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
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
1413
111356
- Removedboom@6.0.0(transitive)
Updatedboom@7.x.x