jsonld-signatures
Advanced tools
Comparing version 11.3.2 to 11.4.0
@@ -28,3 +28,4 @@ /*! | ||
if(proof.challenge !== this.challenge) { | ||
throw new Error('The challenge is not as expected; ' + | ||
throw new Error( | ||
'The challenge is not as expected; ' + | ||
`challenge="${proof.challenge}", expected="${this.challenge}"`); | ||
@@ -34,5 +35,13 @@ } | ||
// check domain | ||
if(this.domain !== undefined && proof.domain !== this.domain) { | ||
throw new Error('The domain is not as expected; ' + | ||
`domain="${proof.domain}", expected="${this.domain}"`); | ||
if(this.domain !== undefined) { | ||
// `proof.domain` must equal `this.domain` OR if `proof.domain` is | ||
// an array, the array must include `this.domain` as an element | ||
const {domain} = proof; | ||
if(!(domain === this.domain || | ||
(Array.isArray(domain) && domain.includes(this.domain)))) { | ||
throw new Error( | ||
'The domain is not as expected; ' + | ||
`domain=${JSON.stringify(domain)}, ` + | ||
`expected=${JSON.stringify(this.domain)}`); | ||
} | ||
} | ||
@@ -39,0 +48,0 @@ |
{ | ||
"name": "jsonld-signatures", | ||
"version": "11.3.2", | ||
"version": "11.4.0", | ||
"description": "An implementation of the Linked Data Signatures specifications for JSON-LD in JavaScript.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/digitalbazaar/jsonld-signatures", |
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
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
68479
1553
0