@digitalbazaar/zcap
Advanced tools
Comparing version 7.0.1 to 7.1.0
# @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 @@ |
@@ -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", |
89007
1628