@bedrock/vc-verifier 6.0.0 → 9.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.
@@ -8,7 +8,7 @@ jobs:
8
8
  timeout-minutes: 10
9
9
  strategy:
10
10
  matrix:
11
- node-version: [14.x]
11
+ node-version: [16.x]
12
12
  steps:
13
13
  - uses: actions/checkout@v2
14
14
  - name: Use Node.js ${{ matrix.node-version }}
@@ -24,12 +24,12 @@ jobs:
24
24
  timeout-minutes: 10
25
25
  services:
26
26
  mongodb:
27
- image: mongo:4.2
27
+ image: mongo:4.4
28
28
  ports:
29
29
  - 27017:27017
30
30
  strategy:
31
31
  matrix:
32
- node-version: [14.x]
32
+ node-version: [14.x, 16.x]
33
33
  steps:
34
34
  - uses: actions/checkout@v2
35
35
  - name: Use Node.js ${{ matrix.node-version }}
@@ -50,12 +50,12 @@ jobs:
50
50
  timeout-minutes: 10
51
51
  services:
52
52
  mongodb:
53
- image: mongo:4.2
53
+ image: mongo:4.4
54
54
  ports:
55
55
  - 27017:27017
56
56
  strategy:
57
57
  matrix:
58
- node-version: [14.x]
58
+ node-version: [16.x]
59
59
  steps:
60
60
  - uses: actions/checkout@v2
61
61
  - name: Use Node.js ${{ matrix.node-version }}
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # bedrock-vc-verifier ChangeLog
2
2
 
3
+ ## 9.0.0 - 2022-05-05
4
+
5
+ ### Changed
6
+ - **BREAKING**: Update peer deps:
7
+ - `@bedrock/service-agent@5`
8
+ - `@bedrock/service-context-store@6`.
9
+ - **BREAKING**: The updated peer dependencies use a new EDV client with a
10
+ new blind attribute version. This version is incompatible with previous
11
+ versions and a manual migration must be performed to update all
12
+ EDV documents to use the new blind attribute version -- or a new
13
+ deployment is required.
14
+
15
+ ## 8.0.0 - 2022-04-29
16
+
17
+ ### Changed
18
+ - **BREAKING**: Update peer deps:
19
+ - `@bedrock/core@6`
20
+ - `@bedrock/credentials-context@3`
21
+ - `@bedrock/did-context@4`
22
+ - `@bedrock/did-io@8`
23
+ - `@bedrock/express@8`
24
+ - `@bedrock/https-agent@4`
25
+ - `@bedrock/jsonld-document-loader@3`
26
+ - `@bedrock/mongodb@10`
27
+ - `@bedrock/security-context@7`
28
+ - `@bedrock/service-agent@4`
29
+ - `@bedrock/service-context-store@5`
30
+ - `@bedrock/service-core@5`
31
+ - `@bedrock/validation@7`
32
+ - `@bedrock/vc-status-list-context@3`
33
+ - `@bedrock/vc-revocation-list-context@3`
34
+ - `@bedrock/veres-one-context@14`.
35
+
36
+ ## 7.0.0 - 2022-04-23
37
+
38
+ ### Changed
39
+ - **BREAKING**: Update `@digitalbazaar/vc-status-list` and
40
+ `@bedrock/vc-status-list-context` to v3.0.
41
+
3
42
  ## 6.0.0 - 2022-04-06
4
43
 
5
44
  ### Changed
package/lib/challenges.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as database from '@bedrock/mongodb';
6
6
  import assert from 'assert-plus';
7
- import {createRequire} from 'module';
7
+ import {createRequire} from 'node:module';
8
8
  const require = createRequire(import.meta.url);
9
9
  const {generateId, decodeId} = require('bnid');
10
10
 
package/lib/http.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  verifyPresentationBody
14
14
  } from '../schemas/bedrock-vc-verifier.js';
15
15
  import {createDocumentLoader} from './documentLoader.js';
16
- import {createRequire} from 'module';
16
+ import {createRequire} from 'node:module';
17
17
  import {createValidateMiddleware as validate} from '@bedrock/validation';
18
18
  import {metering, middleware} from '@bedrock/service-core';
19
19
  const require = createRequire(import.meta.url);
package/lib/status.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
4
  import assert from 'assert-plus';
5
- import {createRequire} from 'module';
5
+ import {createRequire} from 'node:module';
6
6
  const require = createRequire(import.meta.url);
7
7
  const {
8
8
  checkStatus: statusListCheckStatus,
@@ -18,11 +18,7 @@ handlerMap.set('RevocationList2020Status', {
18
18
  checkStatus: revocationListCheckStatus,
19
19
  statusTypeMatches: revocationListStatusTypeMatches
20
20
  });
21
- handlerMap.set('RevocationList2021Status', {
22
- checkStatus: statusListCheckStatus,
23
- statusTypeMatches: statusListStatusTypeMatches
24
- });
25
- handlerMap.set('SuspensionList2021Status', {
21
+ handlerMap.set('StatusList2021Entry', {
26
22
  checkStatus: statusListCheckStatus,
27
23
  statusTypeMatches: statusListStatusTypeMatches
28
24
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/vc-verifier",
3
- "version": "6.0.0",
3
+ "version": "9.0.0",
4
4
  "type": "module",
5
5
  "description": "Bedrock VC Verifier",
6
6
  "main": "./lib/index.js",
@@ -24,7 +24,7 @@
24
24
  "@digitalbazaar/ed25519-signature-2018": "^2.1.0",
25
25
  "@digitalbazaar/ed25519-signature-2020": "^3.0.0",
26
26
  "@digitalbazaar/vc": "^2.1.0",
27
- "@digitalbazaar/vc-status-list": "^2.1.0",
27
+ "@digitalbazaar/vc-status-list": "^3.0.0",
28
28
  "assert-plus": "^1.0.0",
29
29
  "bnid": "^2.1.0",
30
30
  "body-parser": "^1.19.0",
@@ -32,22 +32,22 @@
32
32
  "vc-revocation-list": "^3.0.0"
33
33
  },
34
34
  "peerDependencies": {
35
- "@bedrock/core": "^5.0.0",
36
- "@bedrock/credentials-context": "^2.0.0",
37
- "@bedrock/did-context": "^3.0.0",
38
- "@bedrock/did-io": "^7.0.0",
39
- "@bedrock/express": "^7.0.0",
40
- "@bedrock/https-agent": "^3.0.0",
41
- "@bedrock/jsonld-document-loader": "^2.0.0",
42
- "@bedrock/mongodb": "^9.0.0",
43
- "@bedrock/security-context": "^6.0.0",
44
- "@bedrock/service-agent": "^3.0.0",
45
- "@bedrock/service-context-store": "^4.0.0",
46
- "@bedrock/service-core": "^4.0.0",
47
- "@bedrock/vc-status-list-context": "^2.0.0",
48
- "@bedrock/vc-revocation-list-context": "^2.0.0",
49
- "@bedrock/veres-one-context": "^13.0.0",
50
- "@bedrock/validation": "^6.0.0"
35
+ "@bedrock/core": "^6.0.0",
36
+ "@bedrock/credentials-context": "^3.0.0",
37
+ "@bedrock/did-context": "^4.0.0",
38
+ "@bedrock/did-io": "^8.0.0",
39
+ "@bedrock/express": "^8.0.0",
40
+ "@bedrock/https-agent": "^4.0.0",
41
+ "@bedrock/jsonld-document-loader": "^3.0.0",
42
+ "@bedrock/mongodb": "^10.0.0",
43
+ "@bedrock/security-context": "^7.0.0",
44
+ "@bedrock/service-agent": "^5.0.0",
45
+ "@bedrock/service-context-store": "^6.0.0",
46
+ "@bedrock/service-core": "^5.0.0",
47
+ "@bedrock/vc-status-list-context": "^4.0.0",
48
+ "@bedrock/vc-revocation-list-context": "^3.0.0",
49
+ "@bedrock/veres-one-context": "^14.0.0",
50
+ "@bedrock/validation": "^7.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "eslint": "^7.32.0",
@@ -5,12 +5,12 @@ import * as bedrock from '@bedrock/core';
5
5
  import * as helpers from './helpers.js';
6
6
  import {agent} from '@bedrock/https-agent';
7
7
  import {createContextDocumentLoader} from '@bedrock/service-context-store';
8
- import {createRequire} from 'module';
8
+ import {createRequire} from 'node:module';
9
9
  import {documentStores} from '@bedrock/service-agent';
10
+ import {httpClient} from '@digitalbazaar/http-client';
10
11
  import {mockData} from './mock.data.js';
11
12
  const require = createRequire(import.meta.url);
12
13
  const {CapabilityAgent} = require('@digitalbazaar/webkms-client');
13
- const {httpClient} = require('@digitalbazaar/http-client');
14
14
 
15
15
  const {baseUrl} = mockData;
16
16
  const serviceType = 'vc-verifier';
@@ -1,21 +1,19 @@
1
1
  /*!
2
2
  * Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
- import * as bedrock from '@bedrock/core';
5
4
  import * as helpers from './helpers.js';
6
5
  import {agent} from '@bedrock/https-agent';
7
- import {createRequire} from 'module';
6
+ import {createRequire} from 'node:module';
8
7
  import {documentLoader as brDocLoader} from '@bedrock/jsonld-document-loader';
8
+ import {httpClient} from '@digitalbazaar/http-client';
9
+ import {klona} from 'klona';
9
10
  import {mockData} from './mock.data.js';
10
11
  const require = createRequire(import.meta.url);
11
12
  const {CapabilityAgent} = require('@digitalbazaar/webkms-client');
12
13
  const didKeyDriver = require('@digitalbazaar/did-method-key').driver();
13
14
  const {Ed25519Signature2020} = require('@digitalbazaar/ed25519-signature-2020');
14
- const {httpClient} = require('@digitalbazaar/http-client');
15
15
  const vc = require('@digitalbazaar/vc');
16
16
 
17
- const {util: {clone}} = bedrock;
18
-
19
17
  const {baseUrl} = mockData;
20
18
  const serviceType = 'vc-verifier';
21
19
 
@@ -96,7 +94,7 @@ describe('verify APIs', () => {
96
94
  });
97
95
  describe('/credentials/verify', () => {
98
96
  it('verifies a valid credential', async () => {
99
- const verifiableCredential = clone(mockCredential);
97
+ const verifiableCredential = klona(mockCredential);
100
98
  let error;
101
99
  let result;
102
100
  try {
@@ -132,7 +130,7 @@ describe('verify APIs', () => {
132
130
  r.verified.should.equal(true);
133
131
  });
134
132
  it('does not verify an invalid credential', async () => {
135
- const badCredential = clone(mockCredential);
133
+ const badCredential = klona(mockCredential);
136
134
  // change the degree name
137
135
  badCredential.credentialSubject.degree.name =
138
136
  'Bachelor of Science in Nursing';
@@ -172,7 +170,7 @@ describe('verify APIs', () => {
172
170
  const signingKey = methodFor({purpose: 'assertionMethod'});
173
171
  const suite = new Ed25519Signature2020({key: signingKey});
174
172
 
175
- const verifiableCredential = clone(mockCredential);
173
+ const verifiableCredential = klona(mockCredential);
176
174
  const presentation = vc.createPresentation({
177
175
  holder: 'did:test:foo',
178
176
  id: 'urn:uuid:3e793029-d699-4096-8e74-5ebd956c3137',
@@ -238,7 +236,7 @@ describe('verify APIs', () => {
238
236
  const signingKey = methodFor({purpose: 'assertionMethod'});
239
237
  const suite = new Ed25519Signature2020({key: signingKey});
240
238
 
241
- const verifiableCredential = clone(mockCredential);
239
+ const verifiableCredential = klona(mockCredential);
242
240
  const presentation = vc.createPresentation({
243
241
  holder: 'foo',
244
242
  id: 'urn:uuid:3e793029-d699-4096-8e74-5ebd956c3137',
@@ -285,7 +283,7 @@ describe('verify APIs', () => {
285
283
  const signingKey = methodFor({purpose: 'assertionMethod'});
286
284
  const suite = new Ed25519Signature2020({key: signingKey});
287
285
 
288
- const verifiableCredential = clone(mockCredential);
286
+ const verifiableCredential = klona(mockCredential);
289
287
  const presentation = vc.createPresentation({
290
288
  holder: 'foo',
291
289
  id: 'urn:uuid:3e793029-d699-4096-8e74-5ebd956c3137',
@@ -333,7 +331,7 @@ describe('verify APIs', () => {
333
331
  const signingKey = methodFor({purpose: 'assertionMethod'});
334
332
  const suite = new Ed25519Signature2020({key: signingKey});
335
333
 
336
- const badCredential = clone(mockCredential);
334
+ const badCredential = klona(mockCredential);
337
335
  // change the degree name
338
336
  badCredential.credentialSubject.degree.name =
339
337
  'Bachelor of Science in Nursing';
@@ -1,28 +1,27 @@
1
1
  /*!
2
2
  * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
- import * as bedrock from '@bedrock/core';
5
4
  import * as helpers from './helpers.js';
6
5
  import {agent} from '@bedrock/https-agent';
7
- import {createRequire} from 'module';
6
+ import {createRequire} from 'node:module';
8
7
  import {documentLoader as brDocLoader} from '@bedrock/jsonld-document-loader';
9
8
  import express from 'express';
10
- import {fileURLToPath} from 'url';
11
- import fs from 'fs';
12
- import https from 'https';
9
+ import {fileURLToPath} from 'node:url';
10
+ import fs from 'node:fs';
11
+ import {httpClient} from '@digitalbazaar/http-client';
12
+ import https from 'node:https';
13
+ import {klona} from 'klona';
13
14
  import {mockData} from './mock.data.js';
14
- import path from 'path';
15
+ import path from 'node:path';
15
16
  const require = createRequire(import.meta.url);
16
17
  const {CapabilityAgent} = require('@digitalbazaar/webkms-client');
17
18
  const {Ed25519Signature2020} = require('@digitalbazaar/ed25519-signature-2020');
18
19
  const {Ed25519VerificationKey2020} =
19
20
  require('@digitalbazaar/ed25519-verification-key-2020');
20
- const {httpClient} = require('@digitalbazaar/http-client');
21
21
  const revocationListCtx = require('vc-revocation-list-context');
22
22
  const statusListCtx = require('@digitalbazaar/vc-status-list-context');
23
23
  const vc = require('@digitalbazaar/vc');
24
24
 
25
- const {util: {clone}} = bedrock;
26
25
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
27
26
 
28
27
  const {baseUrl} = mockData;
@@ -84,7 +83,7 @@ function _startServer({app}) {
84
83
  type: ['VerifiableCredential', 'StatusList2021Credential'],
85
84
  credentialSubject: {
86
85
  id: `${BASE_URL}/status/748a7d8e-9111-11ec-a934-10bf48838a41#list`,
87
- type: 'RevocationList2021',
86
+ type: 'StatusList2021',
88
87
  encodedList: encodedList100k
89
88
  }
90
89
  };
@@ -104,7 +103,8 @@ function _startServer({app}) {
104
103
  },
105
104
  credentialStatus: {
106
105
  id: `${BASE_URL}/status/748a7d8e-9111-11ec-a934-10bf48838a41#67342`,
107
- type: 'RevocationList2021Status',
106
+ type: 'StatusList2021Entry',
107
+ statusPurpose: 'revocation',
108
108
  statusListIndex: '67342',
109
109
  statusListCredential: slCredential.id
110
110
  },
@@ -112,7 +112,7 @@ function _startServer({app}) {
112
112
  };
113
113
 
114
114
  // Revoked Status List 2021 Credential
115
- revokedSlCredential = clone(slCredential);
115
+ revokedSlCredential = klona(slCredential);
116
116
 
117
117
  revokedSlCredential.id =
118
118
  `${BASE_URL}/status/8ec30054-9111-11ec-9ab5-10bf48838a41`,
@@ -122,7 +122,7 @@ function _startServer({app}) {
122
122
  `${BASE_URL}/status/8ec30054-9111-11ec-9ab5-10bf48838a41#list`;
123
123
 
124
124
  // Revoked Unsigned 2021 Credential
125
- revokedUnsignedCredential = clone(unsignedCredentialSl2021Type);
125
+ revokedUnsignedCredential = klona(unsignedCredentialSl2021Type);
126
126
  revokedUnsignedCredential.credentialStatus.id =
127
127
  `${revokedSlCredential.id}#50000`;
128
128
  revokedUnsignedCredential.credentialStatus.statusListIndex = 50000;
@@ -171,7 +171,7 @@ function _startServer({app}) {
171
171
  };
172
172
 
173
173
  // Revoked Revocation List 2020 Credential
174
- revokedRlCredential = clone(rlCredential);
174
+ revokedRlCredential = klona(rlCredential);
175
175
 
176
176
  revokedRlCredential.id =
177
177
  `${BASE_URL}/status/a63896b8-9111-11ec-9fd2-10bf48838a41`,
@@ -181,7 +181,7 @@ function _startServer({app}) {
181
181
  `${BASE_URL}/status/a63896b8-9111-11ec-9fd2-10bf48838a41#list`;
182
182
 
183
183
  // Revoked Unsigned 2020 Credential
184
- revokedUnsignedCredential2 = clone(unsignedCredentialRL2020Type);
184
+ revokedUnsignedCredential2 = klona(unsignedCredentialRL2020Type);
185
185
  revokedUnsignedCredential2.credentialStatus.id =
186
186
  `${revokedRlCredential.id}#50000`;
187
187
  revokedUnsignedCredential2.credentialStatus.revocationListIndex = 50000;
package/test/package.json CHANGED
@@ -16,44 +16,44 @@
16
16
  "url": "http://digitalbazaar.com"
17
17
  },
18
18
  "dependencies": {
19
- "@bedrock/app-identity": "^2.0.0",
20
- "@bedrock/core": "^5.0.0",
21
- "@bedrock/credentials-context": "^2.0.0",
22
- "@bedrock/did-context": "^3.0.0",
23
- "@bedrock/did-io": "^7.0.0",
24
- "@bedrock/edv-storage": "^14.0.0",
25
- "@bedrock/express": "^7.0.0",
26
- "@bedrock/https-agent": "^3.0.0",
27
- "@bedrock/jsonld-document-loader": "^2.0.0",
28
- "@bedrock/kms": "^9.0.0",
29
- "@bedrock/kms-http": "^13.0.0",
30
- "@bedrock/ledger-context": "^22.0.0",
31
- "@bedrock/meter": "^2.0.0",
32
- "@bedrock/meter-http": "^7.0.0",
33
- "@bedrock/meter-usage-reporter": "^6.0.0",
34
- "@bedrock/mongodb": "^9.0.0",
35
- "@bedrock/package-manager": "^2.0.0",
36
- "@bedrock/security-context": "^6.0.0",
37
- "@bedrock/server": "^4.0.0",
38
- "@bedrock/service-agent": "^3.0.0",
39
- "@bedrock/service-context-store": "^4.0.0",
40
- "@bedrock/service-core": "^4.0.0",
41
- "@bedrock/ssm-mongodb": "^8.0.0",
42
- "@bedrock/test": "^7.0.0",
43
- "@bedrock/validation": "^6.0.0",
44
- "@bedrock/vc-revocation-list-context": "^2.0.0",
45
- "@bedrock/vc-status-list-context": "^2.0.0",
19
+ "@bedrock/app-identity": "^3.0.0",
20
+ "@bedrock/core": "^6.0.0",
21
+ "@bedrock/credentials-context": "^3.0.0",
22
+ "@bedrock/did-context": "^4.0.0",
23
+ "@bedrock/did-io": "^8.0.0",
24
+ "@bedrock/edv-storage": "^15.0.0",
25
+ "@bedrock/express": "^8.0.0",
26
+ "@bedrock/https-agent": "^4.0.0",
27
+ "@bedrock/jsonld-document-loader": "^3.0.0",
28
+ "@bedrock/kms": "^10.0.0",
29
+ "@bedrock/kms-http": "^14.0.0",
30
+ "@bedrock/ledger-context": "^23.0.0",
31
+ "@bedrock/meter": "^3.0.0",
32
+ "@bedrock/meter-http": "^8.0.0",
33
+ "@bedrock/meter-usage-reporter": "^7.0.0",
34
+ "@bedrock/mongodb": "^10.0.0",
35
+ "@bedrock/package-manager": "^3.0.0",
36
+ "@bedrock/security-context": "^7.0.0",
37
+ "@bedrock/server": "^5.0.0",
38
+ "@bedrock/service-agent": "^5.0.0",
39
+ "@bedrock/service-context-store": "^6.0.0",
40
+ "@bedrock/service-core": "5.0.0",
41
+ "@bedrock/ssm-mongodb": "^9.0.0",
42
+ "@bedrock/test": "^8.0.0",
43
+ "@bedrock/validation": "^7.0.0",
44
+ "@bedrock/vc-revocation-list-context": "^3.0.0",
45
+ "@bedrock/vc-status-list-context": "^4.0.0",
46
46
  "@bedrock/vc-verifier": "file:..",
47
- "@bedrock/veres-one-context": "^13.0.0",
48
- "@bedrock/zcap-storage": "^6.0.0",
47
+ "@bedrock/veres-one-context": "^14.0.0",
48
+ "@bedrock/zcap-storage": "^7.0.0",
49
49
  "@digitalbazaar/did-method-key": "^2.0.0",
50
50
  "@digitalbazaar/ed25519-signature-2020": "^3.0.0",
51
51
  "@digitalbazaar/ed25519-verification-key-2020": "^3.2.0",
52
- "@digitalbazaar/edv-client": "^13.0.0",
52
+ "@digitalbazaar/edv-client": "^14.0.0",
53
53
  "@digitalbazaar/ezcap": "^2.0.2",
54
- "@digitalbazaar/http-client": "^2.0.1",
54
+ "@digitalbazaar/http-client": "^3.0.1",
55
55
  "@digitalbazaar/vc": "^2.1.0",
56
- "@digitalbazaar/vc-status-list-context": "^2.0.0",
56
+ "@digitalbazaar/vc-status-list-context": "^3.0.0",
57
57
  "@digitalbazaar/webkms-client": "^10.0.0",
58
58
  "c8": "^7.11.0",
59
59
  "cross-env": "^7.0.3",