@hapi/statehood
Advanced tools
Comparing version 7.0.4 to 8.0.0
@@ -82,3 +82,3 @@ 'use strict'; | ||
this.settings = Hoek.applyToDefaults(internals.defaults, options || {}); | ||
this.settings = Hoek.applyToDefaults(internals.defaults, options ?? {}); | ||
Validate.assert(this.settings, internals.schema, 'Invalid state definition defaults'); | ||
@@ -95,3 +95,3 @@ | ||
const settings = Hoek.applyToDefaults(this.settings, options || {}, { nullOverride: true }); | ||
const settings = Hoek.applyToDefaults(this.settings, options ?? {}, { nullOverride: true }); | ||
Validate.assert(settings, internals.schema, 'Invalid state definition: ' + name); | ||
@@ -161,3 +161,3 @@ | ||
const value = state[name]; | ||
const definition = this.cookies[name] || this.settings; | ||
const definition = this.cookies[name] ?? this.settings; | ||
@@ -243,3 +243,3 @@ // Validate cookie | ||
const base = this.cookies[cookie.name] || this.settings; | ||
const base = this.cookies[cookie.name] ?? this.settings; | ||
let definition = cookie.options ? Hoek.applyToDefaults(base, cookie.options, { nullOverride: true }) : base; | ||
@@ -419,3 +419,3 @@ | ||
const macOptions = Hoek.clone(definition.sign.integrity || Iron.defaults.integrity); | ||
const macOptions = Hoek.clone(definition.sign.integrity ?? Iron.defaults.integrity); | ||
macOptions.salt = hmacSalt; | ||
@@ -444,3 +444,3 @@ const mac = await Iron.hmacWithPassword(definition.sign.password, macOptions, [internals.macPrefix, name, unsigned].join('\n')); | ||
if (definition.encoding === 'iron') { | ||
return await Iron.unseal(value, definition.password, definition.iron || Iron.defaults); | ||
return await Iron.unseal(value, definition.password, definition.iron ?? Iron.defaults); | ||
} | ||
@@ -494,3 +494,3 @@ | ||
if (options.encoding === 'iron') { | ||
return Iron.seal(value, options.password, options.iron || Iron.defaults); | ||
return Iron.seal(value, options.password, options.iron ?? Iron.defaults); | ||
} | ||
@@ -521,3 +521,3 @@ | ||
const mac = await Iron.hmacWithPassword(options.password, options.integrity || Iron.defaults.integrity, [internals.macPrefix, name, value].join('\n')); | ||
const mac = await Iron.hmacWithPassword(options.password, options.integrity ?? Iron.defaults.integrity, [internals.macPrefix, name, value].join('\n')); | ||
const signed = value + '.' + mac.salt + '*' + mac.digest; | ||
@@ -524,0 +524,0 @@ return signed; |
@@ -1,3 +0,4 @@ | ||
Copyright (c) 2014-2020, Sideway Inc, and project contributors | ||
Copyright (c) 2014, Walmart. | ||
Copyright (c) 2014-2022, Project contributors | ||
Copyright (c) 2014-2020, Sideway Inc | ||
Copyright (c) 2014, Walmart. | ||
All rights reserved. | ||
@@ -4,0 +5,0 @@ |
{ | ||
"name": "@hapi/statehood", | ||
"description": "HTTP State Management Utilities", | ||
"version": "7.0.4", | ||
"version": "8.0.0", | ||
"repository": "git://github.com/hapijs/statehood", | ||
@@ -22,14 +22,14 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@hapi/boom": "9.x.x", | ||
"@hapi/bounce": "2.x.x", | ||
"@hapi/bourne": "2.x.x", | ||
"@hapi/cryptiles": "5.x.x", | ||
"@hapi/hoek": "9.x.x", | ||
"@hapi/iron": "6.x.x", | ||
"@hapi/validate": "1.x.x" | ||
"@hapi/boom": "^10.0.0", | ||
"@hapi/bounce": "^3.0.0", | ||
"@hapi/bourne": "^3.0.0", | ||
"@hapi/cryptiles": "^6.0.0", | ||
"@hapi/hoek": "^10.0.0", | ||
"@hapi/iron": "^7.0.0", | ||
"@hapi/validate": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"@hapi/code": "8.x.x", | ||
"@hapi/code": "^9.0.0", | ||
"@hapi/eslint-plugin": "*", | ||
"@hapi/lab": "24.x.x" | ||
"@hapi/lab": "^25.0.1" | ||
}, | ||
@@ -36,0 +36,0 @@ "scripts": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
18210
0
+ Added@hapi/b64@6.0.1(transitive)
+ Added@hapi/boom@10.0.1(transitive)
+ Added@hapi/bounce@3.0.1(transitive)
+ Added@hapi/bourne@3.0.0(transitive)
+ Added@hapi/cryptiles@6.0.1(transitive)
+ Added@hapi/hoek@10.0.111.0.4(transitive)
+ Added@hapi/iron@7.0.1(transitive)
+ Added@hapi/topo@6.0.2(transitive)
+ Added@hapi/validate@2.0.1(transitive)
- Removed@hapi/b64@5.0.0(transitive)
- Removed@hapi/boom@9.1.4(transitive)
- Removed@hapi/bounce@2.0.0(transitive)
- Removed@hapi/bourne@2.1.0(transitive)
- Removed@hapi/cryptiles@5.1.0(transitive)
- Removed@hapi/hoek@9.3.0(transitive)
- Removed@hapi/iron@6.0.0(transitive)
- Removed@hapi/topo@5.1.0(transitive)
- Removed@hapi/validate@1.1.3(transitive)
Updated@hapi/boom@^10.0.0
Updated@hapi/bounce@^3.0.0
Updated@hapi/bourne@^3.0.0
Updated@hapi/cryptiles@^6.0.0
Updated@hapi/hoek@^10.0.0
Updated@hapi/iron@^7.0.0
Updated@hapi/validate@^2.0.0