@bedrock/vc-verifier 23.6.1 → 24.0.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/LICENSE.md CHANGED
@@ -1,8 +1,7 @@
1
1
  Bedrock Non-Commercial License v1.0
2
2
  ===================================
3
3
 
4
- Copyright (c) 2011-2022 Digital Bazaar, Inc.
5
- All rights reserved.
4
+ Copyright (c) 2011-2026 Digital Bazaar, Inc.
6
5
 
7
6
  Summary
8
7
  =======
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Bedrock VC Verifier API module _(@bedrock/vc-verifier)_
2
2
 
3
- [![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/bedrock-vc-verifier/main.yml)](https://github.com/digitalbazaar/bedrock-vc-verifier/actions/workflows/main.yml)
4
- [![NPM Version](https://img.shields.io/npm/v/bedrock-vc-verifier.svg)](https://npm.im/bedrock-vc-verifier)
3
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/digitalbazaar/bedrock-vc-verifier/main.yaml)](https://github.com/digitalbazaar/bedrock-vc-verifier/actions/workflows/main.yaml)
4
+ [![NPM Version](https://img.shields.io/npm/v/@bedrock/vc-verifier.svg)](https://npm.im/@bedrock/vc-verifier)
5
5
 
6
6
  > A VC Verifier API library for use with Bedrock applications.
7
7
 
@@ -25,7 +25,10 @@ TBD
25
25
 
26
26
  ## Install
27
27
 
28
- - Node.js 18+ is required.
28
+ This software requires and supports maintained recent versions of Node.js.
29
+ Updates may remove support for older unmaintained platform versions. Please use
30
+ dependency version lock files and testing to ensure compatibility with this
31
+ software.
29
32
 
30
33
  ### NPM
31
34
 
package/lib/challenges.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2022-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2022-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as database from '@bedrock/mongodb';
@@ -85,7 +85,7 @@ function _decodeChallenge({challenge}) {
85
85
  multihash: true,
86
86
  expectedSize: 16
87
87
  }));
88
- } catch(e) {
88
+ } catch {
89
89
  throw new BedrockError(
90
90
  'Invalid challenge.', 'DataError', {
91
91
  httpStatusCode: 400,
@@ -157,7 +157,7 @@ async function _use({challenge, explain = false} = {}) {
157
157
  const collection = database.collections[COLLECTION_NAME];
158
158
  const query = {'challenge.value': challenge};
159
159
  const $inc = {
160
- 'challenge.uses': 1,
160
+ 'challenge.uses': 1
161
161
  };
162
162
  const $set = {
163
163
  'meta.updated': Date.now()
package/lib/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2019-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2019-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import {config} from '@bedrock/core';
5
5
  import '@bedrock/app-identity';
@@ -27,10 +27,7 @@ cfg.documentLoader = {
27
27
 
28
28
  cfg.supportedSuites = [
29
29
  'bbs-2023',
30
- 'Ed25519Signature2018',
31
30
  'Ed25519Signature2020',
32
- 'eddsa-2022',
33
- 'ecdsa-2019',
34
31
  'ecdsa-rdfc-2019',
35
32
  'eddsa-rdfc-2022',
36
33
  'ecdsa-jcs-2019',
package/lib/di.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2018-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2018-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as vc from '@digitalbazaar/vc';
5
5
  import {createCheckStatus} from './status.js';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2019-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2019-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import {
@@ -87,7 +87,7 @@ export async function createDocumentLoader({
87
87
  try {
88
88
  // try to resolve URL through built-in doc loader
89
89
  return await brDocLoader(url);
90
- } catch(e) {
90
+ } catch {
91
91
  // FIXME: improve to check for `NotFoundError` once `e.name`
92
92
  // supports it
93
93
  }
@@ -113,7 +113,7 @@ export async function createDocumentLoader({
113
113
 
114
114
  async function _resolve({didResolver, didUrl}) {
115
115
  // split on `?` query or `#` fragment
116
- const [did] = didUrl.split(/(?=[\?#])/);
116
+ const [did] = didUrl.split(/(?=[?#])/);
117
117
 
118
118
  // fetch DID document using DID resolver, assume DID param is prepended
119
119
  const url = didResolver.url.endsWith('/') ?
package/lib/envelopes.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2019-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2019-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as mdl from './mdl.js';
@@ -88,6 +88,6 @@ function _throwUnknownFormat(format) {
88
88
  details: {
89
89
  httpStatusCode: 400,
90
90
  public: true
91
- },
91
+ }
92
92
  });
93
93
  }
package/lib/http.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2018-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2018-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import {createChallenge, verifyChallenge} from './challenges.js';
@@ -76,7 +76,7 @@ export async function addRoutes({app, service} = {}) {
76
76
  try {
77
77
  const {
78
78
  options = {},
79
- verifiableCredential: credential,
79
+ verifiableCredential: credential
80
80
  } = req.body;
81
81
 
82
82
  const {checks} = options;
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2021-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2021-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import {
package/lib/iso18013-7.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2025-2026 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2025-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import {oid4vp} from '@digitalbazaar/oid4-client';
5
5
 
package/lib/mdl.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2025-2026 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2025-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import {addDocumentRoutes, documentStores} from '@bedrock/service-agent';
@@ -45,7 +45,7 @@ export async function verifyEnvelopedPresentation({
45
45
  details: {
46
46
  httpStatusCode: 400,
47
47
  public: true
48
- },
48
+ }
49
49
  });
50
50
  }
51
51
 
@@ -66,7 +66,7 @@ export async function verifyEnvelopedPresentation({
66
66
  details: {
67
67
  httpStatusCode: 400,
68
68
  public: true
69
- },
69
+ }
70
70
  });
71
71
  }
72
72
 
package/lib/status.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2019-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2019-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import {
@@ -122,17 +122,18 @@ export function createCheckStatus({config} = {}) {
122
122
  }
123
123
  return result;
124
124
  } catch(error) {
125
+ let _error = error;
125
126
  if(!(error instanceof BedrockError)) {
126
127
  // always expose cause message and name; expose cause details as
127
128
  // BedrockError if error is marked public
128
129
  const details = error.details?.public ? error.details : {};
129
- error = new BedrockError(error.message, {
130
+ _error = new BedrockError(error.message, {
130
131
  name: error.name || 'OperationError',
131
132
  details: {...details, public: true},
132
133
  cause: error
133
134
  });
134
135
  }
135
- return {verified: false, error};
136
+ return {verified: false, error: _error};
136
137
  }
137
138
  };
138
139
  }
@@ -199,7 +200,7 @@ async function _expandIfTerseEntry({credentialStatus, cache}) {
199
200
 
200
201
  if(!webLoader) {
201
202
  throw new BedrockError(
202
- `Web loader disabled; cannot load credential status list(s) for `
203
+ `Web loader disabled; cannot load credential status list(s) for ` +
203
204
  `status type "${credentialStatus.type}".`, {
204
205
  name: 'NotSupportedError',
205
206
  details: {
package/lib/suites.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2018-2024 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2018-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import {
@@ -18,17 +18,10 @@ import {
18
18
  createVerifyCryptosuite as createEddsaJcs2022VerifyCryptoSuite
19
19
  } from '@digitalbazaar/eddsa-jcs-2022-cryptosuite';
20
20
  import {DataIntegrityProof} from '@digitalbazaar/data-integrity';
21
- import {
22
- cryptosuite as ecdsa2019CryptoSuite
23
- } from '@digitalbazaar/ecdsa-2019-cryptosuite';
24
21
  import {
25
22
  cryptosuite as ecdsaRdfc2019CryptoSuite
26
23
  } from '@digitalbazaar/ecdsa-rdfc-2019-cryptosuite';
27
- import {Ed25519Signature2018} from '@digitalbazaar/ed25519-signature-2018';
28
24
  import {Ed25519Signature2020} from '@digitalbazaar/ed25519-signature-2020';
29
- import {
30
- cryptosuite as eddsa2022CryptoSuite
31
- } from '@digitalbazaar/eddsa-2022-cryptosuite';
32
25
  import {
33
26
  cryptosuite as eddsaRdfc2022CryptoSuite
34
27
  } from '@digitalbazaar/eddsa-rdfc-2022-cryptosuite';
@@ -44,13 +37,7 @@ const SUPPORTED_CRYPTOSUITES = new Map([
44
37
  ['ecdsa-xi-2023', options => createEcdsaXi2023Cryptosuite(options)]
45
38
  ]);
46
39
 
47
- const SUPPORTED_LEGACY_CRYPTOSUITES = new Map([
48
- ['ecdsa-2019', ecdsa2019CryptoSuite],
49
- ['eddsa-2022', eddsa2022CryptoSuite],
50
- ]);
51
-
52
40
  const SUPPORTED_LEGACY_SUITES = new Map([
53
- ['Ed25519Signature2018', Ed25519Signature2018],
54
41
  ['Ed25519Signature2020', Ed25519Signature2020]
55
42
  ]);
56
43
 
@@ -67,12 +54,6 @@ export function createSuites({options} = {}) {
67
54
  if(LegacySuite) {
68
55
  return new LegacySuite();
69
56
  }
70
- const LegacyCryptosuite = SUPPORTED_LEGACY_CRYPTOSUITES.get(supportedSuite);
71
- if(LegacyCryptosuite) {
72
- return new DataIntegrityProof({
73
- cryptosuite: LegacyCryptosuite, legacyContext: true
74
- });
75
- }
76
57
  throw new Error(`Unsupported suite ${supportedSuite}`);
77
58
  });
78
59
  return suite;
package/lib/vcb.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2024-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2024-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as cborld from '@digitalbazaar/cborld';
@@ -19,7 +19,7 @@ const AAMVA_IIN_TO_VCB_LOCATION = new Map([
19
19
  // VCB spec, i.e., test vector intentionally invalid issuer
20
20
  ['000000', {subfile: 'ZZ', field: 'ZZA', encoding: 'base64url'}],
21
21
  // US state of CA
22
- ['636014', {subfile: 'ZC', field: 'ZCE', encoding: 'base64'}],
22
+ ['636014', {subfile: 'ZC', field: 'ZCE', encoding: 'base64'}]
23
23
  ]);
24
24
 
25
25
  const SUPPORTED_BARCODE_FORMATS = new Set([
@@ -208,6 +208,6 @@ function _throwUnknownFormat(format) {
208
208
  details: {
209
209
  httpStatusCode: 400,
210
210
  public: true
211
- },
211
+ }
212
212
  });
213
213
  }
package/lib/vcjwt.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2019-2024 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2019-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as EcdsaMultikey from '@digitalbazaar/ecdsa-multikey';
@@ -540,7 +540,7 @@ function _jwtPayloadToPresentation({verifyResult, challenge} = {}) {
540
540
  return {
541
541
  '@context': VC_CONTEXT_2,
542
542
  id: `data:application/jwt,${vc}`,
543
- type: 'EnvelopedVerifiableCredential',
543
+ type: 'EnvelopedVerifiableCredential'
544
544
  };
545
545
  });
546
546
  }
package/lib/verify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2018-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2018-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import * as di from './di.js';
5
5
  import {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-verifier",
3
- "version": "23.6.1",
3
+ "version": "24.0.0",
4
4
  "type": "module",
5
5
  "description": "Bedrock VC Verifier",
6
6
  "main": "./lib/index.js",
@@ -9,7 +9,7 @@
9
9
  "schemas/**/*.js"
10
10
  ],
11
11
  "scripts": {
12
- "lint": "eslint --ext .cjs,.js ."
12
+ "lint": "eslint"
13
13
  },
14
14
  "repository": {
15
15
  "type": "git",
@@ -25,52 +25,49 @@
25
25
  },
26
26
  "homepage": "https://github.com/digitalbazaar/bedrock-vc-verifier",
27
27
  "dependencies": {
28
- "@auth0/mdl": "^3.0.0",
28
+ "@auth0/mdl": "^3.0.1",
29
29
  "@digitalbazaar/bbs-2023-cryptosuite": "^2.0.1",
30
- "@digitalbazaar/cborld": "^8.0.0",
30
+ "@digitalbazaar/cborld": "^8.1.0",
31
31
  "@digitalbazaar/data-integrity": "^2.5.0",
32
- "@digitalbazaar/ecdsa-2019-cryptosuite": "^2.0.0",
33
32
  "@digitalbazaar/ecdsa-jcs-2019-cryptosuite": "^1.0.0",
34
33
  "@digitalbazaar/ecdsa-multikey": "^1.8.0",
35
- "@digitalbazaar/ecdsa-rdfc-2019-cryptosuite": "^1.2.0",
34
+ "@digitalbazaar/ecdsa-rdfc-2019-cryptosuite": "^1.3.0",
36
35
  "@digitalbazaar/ecdsa-sd-2023-cryptosuite": "^3.4.1",
37
- "@digitalbazaar/ecdsa-xi-2023-cryptosuite": "^1.1.0",
36
+ "@digitalbazaar/ecdsa-xi-2023-cryptosuite": "^1.2.0",
38
37
  "@digitalbazaar/ed25519-multikey": "^1.3.1",
39
- "@digitalbazaar/ed25519-signature-2018": "^4.1.0",
40
38
  "@digitalbazaar/ed25519-signature-2020": "^5.4.0",
41
- "@digitalbazaar/eddsa-2022-cryptosuite": "^1.0.0",
42
39
  "@digitalbazaar/eddsa-jcs-2022-cryptosuite": "^1.0.0",
43
- "@digitalbazaar/eddsa-rdfc-2022-cryptosuite": "^1.2.0",
44
- "@digitalbazaar/oid4-client": "^5.8.0",
40
+ "@digitalbazaar/eddsa-rdfc-2022-cryptosuite": "^1.3.0",
41
+ "@digitalbazaar/oid4-client": "^5.10.0",
45
42
  "@digitalbazaar/pdf417-dl-canonicalizer": "^1.2.1",
46
- "@digitalbazaar/vc": "^7.2.0",
43
+ "@digitalbazaar/vc": "^7.3.0",
47
44
  "@digitalbazaar/vc-bitstring-status-list": "^2.0.1",
48
45
  "@digitalbazaar/vc-revocation-list": "^7.0.0",
49
46
  "@digitalbazaar/vc-status-list": "^8.0.1",
50
47
  "@digitalbazaar/vpqr": "^6.0.0",
51
48
  "assert-plus": "^1.0.0",
52
49
  "bnid": "^3.0.0",
53
- "body-parser": "^1.20.3",
54
- "cors": "^2.8.5",
55
- "jose": "^6.0.10",
56
- "serialize-error": "^12.0.0"
50
+ "body-parser": "^1.20.5",
51
+ "cors": "^2.8.6",
52
+ "jose": "^6.2.3",
53
+ "serialize-error": "^13.0.1"
57
54
  },
58
55
  "peerDependencies": {
59
- "@bedrock/app-identity": "^4.0.0",
56
+ "@bedrock/app-identity": "^4.2.0",
60
57
  "@bedrock/core": "^6.3.0",
61
58
  "@bedrock/credentials-context": "^5.0.3",
62
59
  "@bedrock/data-integrity-context": "^4.0.3",
63
60
  "@bedrock/did-context": "^6.0.0",
64
61
  "@bedrock/did-io": "^10.4.0",
65
- "@bedrock/express": "^8.3.1",
62
+ "@bedrock/express": "^8.6.3",
66
63
  "@bedrock/https-agent": "^4.1.0",
67
64
  "@bedrock/jsonld-document-loader": "^5.2.1",
68
- "@bedrock/mongodb": "^11.0.0",
65
+ "@bedrock/mongodb": "^11.0.1",
69
66
  "@bedrock/multikey-context": "^3.0.0",
70
67
  "@bedrock/security-context": "^9.0.0",
71
68
  "@bedrock/service-agent": "^10.3.1",
72
- "@bedrock/service-context-store": "^13.1.0",
73
- "@bedrock/service-core": "^11.4.0",
69
+ "@bedrock/service-context-store": "^13.2.0",
70
+ "@bedrock/service-core": "^11.5.0",
74
71
  "@bedrock/validation": "^7.1.1",
75
72
  "@bedrock/vc-barcodes-context": "^1.0.0",
76
73
  "@bedrock/vc-revocation-list-context": "^5.0.0",
@@ -78,12 +75,10 @@
78
75
  "@bedrock/veres-one-context": "^16.0.0"
79
76
  },
80
77
  "devDependencies": {
81
- "eslint": "^8.57.1",
82
- "eslint-config-digitalbazaar": "^5.2.0",
83
- "eslint-plugin-jsdoc": "^50.6.8",
84
- "eslint-plugin-unicorn": "^56.0.1"
78
+ "@digitalbazaar/eslint-config": "^8.0.1",
79
+ "eslint": "^9.39.4"
85
80
  },
86
81
  "engines": {
87
- "node": ">=18"
82
+ "node": ">=20"
88
83
  }
89
84
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright (c) 2022-2025 Digital Bazaar, Inc. All rights reserved.
2
+ * Copyright (c) 2022-2026 Digital Bazaar, Inc.
3
3
  */
4
4
  import {schemas} from '@bedrock/validation';
5
5
 
@@ -66,7 +66,7 @@ function verifiableCredential() {
66
66
  minItems: 1,
67
67
  // this first type must be VerifiableCredential
68
68
  items: [
69
- {const: 'VerifiableCredential'},
69
+ {const: 'VerifiableCredential'}
70
70
  ],
71
71
  // additional types must be strings
72
72
  additionalItems: {
@@ -122,7 +122,7 @@ export function verifiablePresentation() {
122
122
  minItems: 1,
123
123
  // this first type must be VerifiablePresentation
124
124
  items: [
125
- {const: 'VerifiablePresentation'},
125
+ {const: 'VerifiablePresentation'}
126
126
  ],
127
127
  // additional types must be strings
128
128
  additionalItems: {