jsonld-signatures
Advanced tools
Comparing version 3.1.1 to 3.1.2
# jsonld-signatures ChangeLog | ||
## 3.1.2 - 2019-01-08 | ||
### Fixed | ||
- Fix ProofSet suite matching. | ||
- Ensure proof verification method matches key if given. | ||
## 3.1.1 - 2019-01-08 | ||
@@ -4,0 +10,0 @@ |
@@ -414,24 +414,32 @@ /*! | ||
return (yield Promise.all(matches.map(proof => { | ||
for (const s of suites) { | ||
if (s.matchProof({ | ||
proof, | ||
document, | ||
documentLoader, | ||
expansionMap | ||
})) { | ||
return s.verifyProof({ | ||
return (yield Promise.all(matches.map( | ||
/*#__PURE__*/ | ||
function () { | ||
var _ref = _asyncToGenerator(function* (proof) { | ||
for (const s of suites) { | ||
if (yield s.matchProof({ | ||
proof, | ||
document, | ||
purpose, | ||
documentLoader, | ||
expansionMap, | ||
compactProof | ||
}).catch(error => ({ | ||
verified: false, | ||
error | ||
})); | ||
expansionMap | ||
})) { | ||
return s.verifyProof({ | ||
proof, | ||
document, | ||
purpose, | ||
documentLoader, | ||
expansionMap, | ||
compactProof | ||
}).catch(error => ({ | ||
verified: false, | ||
error | ||
})); | ||
} | ||
} | ||
} | ||
}))).map((r, i) => r ? _objectSpread({ | ||
}); | ||
return function (_x3) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}()))).map((r, i) => r ? _objectSpread({ | ||
proof: matches[i] | ||
@@ -438,0 +446,0 @@ }, r) : null).filter(r => r); |
@@ -227,2 +227,45 @@ /*! | ||
matchProof({ | ||
proof, | ||
document, | ||
purpose, | ||
documentLoader, | ||
expansionMap | ||
}) { | ||
var _this5 = this, | ||
_superprop_callMatchProof = (..._args2) => super.matchProof(..._args2); | ||
return _asyncToGenerator(function* () { | ||
if (!(yield _superprop_callMatchProof({ | ||
proof, | ||
document, | ||
purpose, | ||
documentLoader, | ||
expansionMap | ||
}))) { | ||
return false; | ||
} | ||
if (!_this5.key) { | ||
// no key specified, so assume this suite matches and it can be retrieved | ||
return true; | ||
} | ||
let { | ||
verificationMethod | ||
} = proof; | ||
if (!verificationMethod) { | ||
verificationMethod = proof.creator; | ||
} // only match if the key specified matches the one in the proof | ||
if (typeof verificationMethod === 'object') { | ||
return verificationMethod.id === _this5.key.id; | ||
} | ||
return verificationMethod === _this5.key.id; | ||
})(); | ||
} | ||
}; |
@@ -318,5 +318,5 @@ /*! | ||
// verify each matching proof | ||
return (await Promise.all(matches.map(proof => { | ||
return (await Promise.all(matches.map(async proof => { | ||
for(const s of suites) { | ||
if(s.matchProof({proof, document, documentLoader, expansionMap})) { | ||
if(await s.matchProof({proof, document, documentLoader, expansionMap})) { | ||
return s.verifyProof({ | ||
@@ -323,0 +323,0 @@ proof, document, purpose, documentLoader, expansionMap, |
@@ -157,2 +157,23 @@ /*! | ||
} | ||
async matchProof({proof, document, purpose, documentLoader, expansionMap}) { | ||
if(!await super.matchProof( | ||
{proof, document, purpose, documentLoader, expansionMap})) { | ||
return false; | ||
} | ||
if(!this.key) { | ||
// no key specified, so assume this suite matches and it can be retrieved | ||
return true; | ||
} | ||
let {verificationMethod} = proof; | ||
if(!verificationMethod) { | ||
verificationMethod = proof.creator; | ||
} | ||
// only match if the key specified matches the one in the proof | ||
if(typeof verificationMethod === 'object') { | ||
return verificationMethod.id === this.key.id; | ||
} | ||
return verificationMethod === this.key.id; | ||
} | ||
}; |
{ | ||
"name": "jsonld-signatures", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"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", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
675244
7272