New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@digitalbazaar/zcap

Package Overview
Dependencies
Maintainers
6
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalbazaar/zcap - npm Package Compare versions

Comparing version 7.0.1 to 7.1.0

6

CHANGELOG.md
# @digitalbazaar/zcap ChangeLog
## 7.1.0 - 2022-01-14
### Added
- Include `dereferencedChain` in purpose result when verifying a
capability invocation or delegation proof.
## 7.0.1 - 2022-01-11

@@ -4,0 +10,0 @@

14

lib/CapabilityDelegation.js

@@ -40,4 +40,2 @@ /*!

* verify the capability chain.
* @param {object} [verifiedParentCapability] - The previously verified
* parent capability, if any.
*/

@@ -52,3 +50,4 @@ constructor({

maxChainLength, maxClockSkew, maxDelegationTtl,
suite, verifiedParentCapability,
suite,
_verifiedParentCapability,
// for testing purposes only, not documented intentionally

@@ -63,3 +62,4 @@ _capabilityChain,

expectedRootCapability ||
inspectCapabilityChain || suite || verifiedParentCapability;
inspectCapabilityChain || suite ||
_verifiedParentCapability;

@@ -111,3 +111,3 @@ if(hasCreateProofParams && hasVerifyProofParams) {

} else {
this.verifiedParentCapability = verifiedParentCapability;
this._verifiedParentCapability = _verifiedParentCapability;
}

@@ -238,3 +238,5 @@ }

// see if the parent capability has already been verified
const {verifiedParentCapability} = this;
const {
_verifiedParentCapability: verifiedParentCapability
} = this;
if(verifiedParentCapability) {

@@ -241,0 +243,0 @@ // simple case, just validate against parent and return, we have been

@@ -220,2 +220,5 @@ /*!

// include dereferenced chain result
validateResult.dereferencedChain = dereferencedChain;
return validateResult;

@@ -306,3 +309,3 @@ } catch(error) {

*
* @return {object} {verified, error, verifiedParentCapability}.
* @return {object} {verified, error}.
*/

@@ -328,15 +331,6 @@ async _verifyCapabilityChain({

/* Note: `verifiedParentCapability` will prevent repetitive checking of
the same segments of the chain (once a parent is verified, its chain is
not checked again when checking its children). */
let verifiedParentCapability = null;
try {
// 1. If the chain only has the root, exit early.
if(dereferencedChain.length === 1) {
return {
verified: true,
verifiedParentCapability,
capabilityChainMeta
};
return {verified: true};
}

@@ -373,3 +367,6 @@

const zcap = delegatedCapabilities[i];
verifiedParentCapability = delegatedCapabilities[i - 1] || root;
/* Note: Passing `_verifiedParentCapability` will prevent repetitive
checking of the same segments of the chain (once a parent is verified,
its chain is not checked again when checking its children). */
const _verifiedParentCapability = delegatedCapabilities[i - 1] || root;

@@ -386,4 +383,4 @@ // verify proof on zcap if no result has been computed yet (one

expectedRootCapability,
verifiedParentCapability,
maxDelegationTtl
maxDelegationTtl,
_verifiedParentCapability
}),

@@ -522,3 +519,3 @@ documentLoader,

return {verified: true, verifiedParentCapability, capabilityChainMeta};
return {verified: true};
} catch(error) {

@@ -525,0 +522,0 @@ return {verified: false, error};

{
"name": "@digitalbazaar/zcap",
"version": "7.0.1",
"version": "7.1.0",
"description": "Authorization Capabilities reference implementation.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/digitalbazaar/zcap",

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