@bedrock/vc-verifier 22.1.1 → 22.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/di.js CHANGED
@@ -46,7 +46,7 @@ export async function verifyCredential({
46
46
  // ensure all proofs are verified in order to return `verified`
47
47
  let {verified} = result;
48
48
  verified = !!(verified && result?.results?.every(({verified}) => verified));
49
- return {...result, verified};
49
+ return {...result, verified, credential};
50
50
  }
51
51
 
52
52
  export async function verifyPresentation({
@@ -59,7 +59,8 @@ export async function verifyPresentation({
59
59
  documentLoader: await createDocumentLoader({config}),
60
60
  suite: createSuites(),
61
61
  unsignedPresentation: !checks.includes('proof'),
62
- checkStatus: _checkStatus
62
+ checkStatus: _checkStatus,
63
+ includeCredentials: true
63
64
  };
64
65
  return vc.verify(verifyOptions);
65
66
  }
package/lib/verify.js CHANGED
@@ -36,9 +36,13 @@ export async function verifyPresentation({
36
36
  const result = await di.verifyPresentation({
37
37
  config, presentation, challenge, domain, checks
38
38
  });
39
- if(result.verified || !result.presentationResult?.verified) {
40
- // the whole VP and all its VCs were verified or the VP itself failed
41
- // verification, so no extra work needed below
39
+ // if the whole VP and all its VCs were verified or if the VP itself
40
+ // was checked and it failed verification, there is no extra work to be
41
+ // done and we can return early; it is important to note that the
42
+ // presence of `presentationResult` must be confirmed here to ensure that
43
+ // if an unprotected presentation was used and this was allowed, the VC
44
+ // checks will continue below
45
+ if(result.verified || result.presentationResult?.verified === false) {
42
46
  return result;
43
47
  }
44
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-verifier",
3
- "version": "22.1.1",
3
+ "version": "22.2.0",
4
4
  "type": "module",
5
5
  "description": "Bedrock VC Verifier",
6
6
  "main": "./lib/index.js",
@@ -41,7 +41,7 @@
41
41
  "@digitalbazaar/eddsa-jcs-2022-cryptosuite": "^1.0.0",
42
42
  "@digitalbazaar/eddsa-rdfc-2022-cryptosuite": "^1.2.0",
43
43
  "@digitalbazaar/pdf417-dl-canonicalizer": "^1.2.1",
44
- "@digitalbazaar/vc": "^7.1.2",
44
+ "@digitalbazaar/vc": "^7.2.0",
45
45
  "@digitalbazaar/vc-bitstring-status-list": "^2.0.1",
46
46
  "@digitalbazaar/vc-revocation-list": "^7.0.0",
47
47
  "@digitalbazaar/vc-status-list": "^8.0.1",