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 2.1.2 to 2.1.3

7

CHANGELOG.md
# jsonld-signatures ChangeLog
## 2.1.3 - 2018-02-21
### Fixed
- Ensure `proofPurpose` property's objects are framed as
application suites containing references to public keys
not direct public keys.
## 2.1.2 - 2018-02-21

@@ -4,0 +11,0 @@

45

dist/node6/lib/Helper.js

@@ -108,3 +108,16 @@ /*!

for (let i = 0; i < framedOwners.length; ++i) {
const keys = jsonld.getValues(framedOwners[i], proofPurpose);
let keys;
// direct access to public keys
if (proofPurpose === 'publicKey') {
keys = jsonld.getValues(framedOwners[i], proofPurpose);
} else {
// FIXME: apply known application suite rules and allow for custom
// functions to be passed to handle unknown ones
// indirect access via application suites
keys = jsonld.getValues(framedOwners[i], proofPurpose).map(function (appSuite) {
return appSuite.publicKey;
});
}
if (keys.some(function (key) {

@@ -203,6 +216,34 @@ return typeof key === 'object' ? key.id === framedKey.id : key === framedKey.id;

'@context': constants.SECURITY_CONTEXT_URL,
'@requireAll': false
};
if (proofPurpose === 'publicKey') {
// direct access to public keys
frame.publicKey = { '@embed': '@never' };
} else {
// indirect access to public keys via application suites
frame[proofPurpose] = {
'@embed': '@always',
publicKey: { '@embed': '@never' }
};
}
const jsonld = _this5.injector.use('jsonld');
const opts = {};
if (options.documentLoader) {
opts.documentLoader = options.documentLoader;
}
const framed = yield jsonld.frame(owners, frame, opts);
return framed['@graph'];
})();
}
_frameAppSuite(owners, proofPurpose, options) {
var _this6 = this;
return _asyncToGenerator(function* () {
const frame = {
'@context': constants.SECURITY_CONTEXT_URL,
'@requireAll': false,
[proofPurpose]: { '@embed': '@never' }
};
const jsonld = _this5.injector.use('jsonld');
const jsonld = _this6.injector.use('jsonld');
const opts = {};

@@ -209,0 +250,0 @@ if (options.documentLoader) {

@@ -91,3 +91,15 @@ /*!

for(let i = 0; i < framedOwners.length; ++i) {
const keys = jsonld.getValues(framedOwners[i], proofPurpose);
let keys;
// direct access to public keys
if(proofPurpose === 'publicKey') {
keys = jsonld.getValues(framedOwners[i], proofPurpose);
} else {
// FIXME: apply known application suite rules and allow for custom
// functions to be passed to handle unknown ones
// indirect access via application suites
keys = jsonld.getValues(framedOwners[i], proofPurpose)
.map(appSuite => appSuite.publicKey);
}
if(keys.some(key => typeof key === 'object' ?

@@ -173,2 +185,26 @@ key.id === framedKey.id : key === framedKey.id)) {

'@context': constants.SECURITY_CONTEXT_URL,
'@requireAll': false
};
if(proofPurpose === 'publicKey') {
// direct access to public keys
frame.publicKey = {'@embed': '@never'};
} else {
// indirect access to public keys via application suites
frame[proofPurpose] = {
'@embed': '@always',
publicKey: {'@embed': '@never'}
};
}
const jsonld = this.injector.use('jsonld');
const opts = {};
if(options.documentLoader) {
opts.documentLoader = options.documentLoader;
}
const framed = await jsonld.frame(owners, frame, opts);
return framed['@graph'];
}
async _frameAppSuite(owners, proofPurpose, options) {
const frame = {
'@context': constants.SECURITY_CONTEXT_URL,
'@requireAll': false,

@@ -175,0 +211,0 @@ [proofPurpose]: {'@embed': '@never'}

2

package.json
{
"name": "jsonld-signatures",
"version": "2.1.2",
"version": "2.1.3",
"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

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