Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsonld-signatures

Package Overview
Dependencies
Maintainers
4
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonld-signatures - npm Package Compare versions

Comparing version 3.1.1 to 3.1.2

6

CHANGELOG.md
# 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 @@

44

dist/node6/lib/ProofSet.js

@@ -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

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