@bedrock/vc-verifier 7.0.0 → 8.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/.github/workflows/main.yml +5 -5
- package/CHANGELOG.md +21 -0
- package/lib/challenges.js +1 -1
- package/lib/http.js +1 -1
- package/lib/status.js +1 -1
- package/package.json +17 -17
- package/test/mocha/10-provision.js +2 -2
- package/test/mocha/20-verify.js +9 -11
- package/test/mocha/30-credential-status.js +11 -12
- package/test/package.json +30 -30
|
@@ -8,7 +8,7 @@ jobs:
|
|
|
8
8
|
timeout-minutes: 10
|
|
9
9
|
strategy:
|
|
10
10
|
matrix:
|
|
11
|
-
node-version: [
|
|
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.
|
|
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.
|
|
53
|
+
image: mongo:4.4
|
|
54
54
|
ports:
|
|
55
55
|
- 27017:27017
|
|
56
56
|
strategy:
|
|
57
57
|
matrix:
|
|
58
|
-
node-version: [
|
|
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,26 @@
|
|
|
1
1
|
# bedrock-vc-verifier ChangeLog
|
|
2
2
|
|
|
3
|
+
## 8.0.0 - 2022-04-29
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- **BREAKING**: Update peer deps:
|
|
7
|
+
- `@bedrock/core@6`
|
|
8
|
+
- `@bedrock/credentials-context@3`
|
|
9
|
+
- `@bedrock/did-context@4`
|
|
10
|
+
- `@bedrock/did-io@8`
|
|
11
|
+
- `@bedrock/express@8`
|
|
12
|
+
- `@bedrock/https-agent@4`
|
|
13
|
+
- `@bedrock/jsonld-document-loader@3`
|
|
14
|
+
- `@bedrock/mongodb@10`
|
|
15
|
+
- `@bedrock/security-context@7`
|
|
16
|
+
- `@bedrock/service-agent@4`
|
|
17
|
+
- `@bedrock/service-context-store@5`
|
|
18
|
+
- `@bedrock/service-core@5`
|
|
19
|
+
- `@bedrock/validation@7`
|
|
20
|
+
- `@bedrock/vc-status-list-context@3`
|
|
21
|
+
- `@bedrock/vc-revocation-list-context@3`
|
|
22
|
+
- `@bedrock/veres-one-context@14`.
|
|
23
|
+
|
|
3
24
|
## 7.0.0 - 2022-04-23
|
|
4
25
|
|
|
5
26
|
### 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,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock/vc-verifier",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bedrock VC Verifier",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -32,22 +32,22 @@
|
|
|
32
32
|
"vc-revocation-list": "^3.0.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@bedrock/core": "^
|
|
36
|
-
"@bedrock/credentials-context": "^
|
|
37
|
-
"@bedrock/did-context": "^
|
|
38
|
-
"@bedrock/did-io": "^
|
|
39
|
-
"@bedrock/express": "^
|
|
40
|
-
"@bedrock/https-agent": "^
|
|
41
|
-
"@bedrock/jsonld-document-loader": "^
|
|
42
|
-
"@bedrock/mongodb": "^
|
|
43
|
-
"@bedrock/security-context": "^
|
|
44
|
-
"@bedrock/service-agent": "^
|
|
45
|
-
"@bedrock/service-context-store": "^
|
|
46
|
-
"@bedrock/service-core": "^
|
|
47
|
-
"@bedrock/vc-status-list-context": "^
|
|
48
|
-
"@bedrock/vc-revocation-list-context": "^
|
|
49
|
-
"@bedrock/veres-one-context": "^
|
|
50
|
-
"@bedrock/validation": "^
|
|
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": "^4.0.0",
|
|
45
|
+
"@bedrock/service-context-store": "^5.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';
|
package/test/mocha/20-verify.js
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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;
|
|
@@ -113,7 +112,7 @@ function _startServer({app}) {
|
|
|
113
112
|
};
|
|
114
113
|
|
|
115
114
|
// Revoked Status List 2021 Credential
|
|
116
|
-
revokedSlCredential =
|
|
115
|
+
revokedSlCredential = klona(slCredential);
|
|
117
116
|
|
|
118
117
|
revokedSlCredential.id =
|
|
119
118
|
`${BASE_URL}/status/8ec30054-9111-11ec-9ab5-10bf48838a41`,
|
|
@@ -123,7 +122,7 @@ function _startServer({app}) {
|
|
|
123
122
|
`${BASE_URL}/status/8ec30054-9111-11ec-9ab5-10bf48838a41#list`;
|
|
124
123
|
|
|
125
124
|
// Revoked Unsigned 2021 Credential
|
|
126
|
-
revokedUnsignedCredential =
|
|
125
|
+
revokedUnsignedCredential = klona(unsignedCredentialSl2021Type);
|
|
127
126
|
revokedUnsignedCredential.credentialStatus.id =
|
|
128
127
|
`${revokedSlCredential.id}#50000`;
|
|
129
128
|
revokedUnsignedCredential.credentialStatus.statusListIndex = 50000;
|
|
@@ -172,7 +171,7 @@ function _startServer({app}) {
|
|
|
172
171
|
};
|
|
173
172
|
|
|
174
173
|
// Revoked Revocation List 2020 Credential
|
|
175
|
-
revokedRlCredential =
|
|
174
|
+
revokedRlCredential = klona(rlCredential);
|
|
176
175
|
|
|
177
176
|
revokedRlCredential.id =
|
|
178
177
|
`${BASE_URL}/status/a63896b8-9111-11ec-9fd2-10bf48838a41`,
|
|
@@ -182,7 +181,7 @@ function _startServer({app}) {
|
|
|
182
181
|
`${BASE_URL}/status/a63896b8-9111-11ec-9fd2-10bf48838a41#list`;
|
|
183
182
|
|
|
184
183
|
// Revoked Unsigned 2020 Credential
|
|
185
|
-
revokedUnsignedCredential2 =
|
|
184
|
+
revokedUnsignedCredential2 = klona(unsignedCredentialRL2020Type);
|
|
186
185
|
revokedUnsignedCredential2.credentialStatus.id =
|
|
187
186
|
`${revokedRlCredential.id}#50000`;
|
|
188
187
|
revokedUnsignedCredential2.credentialStatus.revocationListIndex = 50000;
|
package/test/package.json
CHANGED
|
@@ -16,42 +16,42 @@
|
|
|
16
16
|
"url": "http://digitalbazaar.com"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@bedrock/app-identity": "^
|
|
20
|
-
"@bedrock/core": "^
|
|
21
|
-
"@bedrock/credentials-context": "^
|
|
22
|
-
"@bedrock/did-context": "^
|
|
23
|
-
"@bedrock/did-io": "^
|
|
24
|
-
"@bedrock/edv-storage": "^
|
|
25
|
-
"@bedrock/express": "^
|
|
26
|
-
"@bedrock/https-agent": "^
|
|
27
|
-
"@bedrock/jsonld-document-loader": "^
|
|
28
|
-
"@bedrock/kms": "^
|
|
29
|
-
"@bedrock/kms-http": "^
|
|
30
|
-
"@bedrock/ledger-context": "^
|
|
31
|
-
"@bedrock/meter": "^
|
|
32
|
-
"@bedrock/meter-http": "^
|
|
33
|
-
"@bedrock/meter-usage-reporter": "^
|
|
34
|
-
"@bedrock/mongodb": "^
|
|
35
|
-
"@bedrock/package-manager": "^
|
|
36
|
-
"@bedrock/security-context": "^
|
|
37
|
-
"@bedrock/server": "^
|
|
38
|
-
"@bedrock/service-agent": "^
|
|
39
|
-
"@bedrock/service-context-store": "^
|
|
40
|
-
"@bedrock/service-core": "
|
|
41
|
-
"@bedrock/ssm-mongodb": "^
|
|
42
|
-
"@bedrock/test": "^
|
|
43
|
-
"@bedrock/validation": "^
|
|
44
|
-
"@bedrock/vc-revocation-list-context": "^
|
|
45
|
-
"@bedrock/vc-status-list-context": "^
|
|
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": "^4.0.0",
|
|
39
|
+
"@bedrock/service-context-store": "^5.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": "^
|
|
48
|
-
"@bedrock/zcap-storage": "^
|
|
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
52
|
"@digitalbazaar/edv-client": "^13.0.0",
|
|
53
53
|
"@digitalbazaar/ezcap": "^2.0.2",
|
|
54
|
-
"@digitalbazaar/http-client": "^
|
|
54
|
+
"@digitalbazaar/http-client": "^3.0.1",
|
|
55
55
|
"@digitalbazaar/vc": "^2.1.0",
|
|
56
56
|
"@digitalbazaar/vc-status-list-context": "^3.0.0",
|
|
57
57
|
"@digitalbazaar/webkms-client": "^10.0.0",
|