@bedrock/vc-verifier 11.0.0 → 12.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Bedrock VC Verifier API module _(bedrock-vc-verifier)_
1
+ # Bedrock VC Verifier API module _(@bedrock/vc-verifier)_
2
2
 
3
3
  [![Build Status](https://img.shields.io/github/workflow/status/digitalbazaar/bedrock-vc-verifier/Bedrock%20Node.js%20CI)](https://github.com/digitalbazaar/bedrock-vc-verifier/actions?query=workflow%3A%22Bedrock+Node.js+CI%22)
4
4
  [![NPM Version](https://img.shields.io/npm/v/bedrock-vc-verifier.svg)](https://npm.im/bedrock-vc-verifier)
@@ -25,7 +25,7 @@ TBD
25
25
 
26
26
  ## Install
27
27
 
28
- - Node.js 14+ is required.
28
+ - Node.js 16+ is required.
29
29
 
30
30
  ### NPM
31
31
 
@@ -73,8 +73,8 @@ Example request:
73
73
 
74
74
  Alias: `/instances/:instanceId/credentials/verify`
75
75
 
76
- Optionally performs status checks using the `vc-revocation-list` or
77
- `vc-status-list` library.
76
+ Optionally performs status checks using the `@digitalbazaar/vc-revocation-list`
77
+ or `@digitalbazaar/vc-status-list` library.
78
78
 
79
79
  Example request:
80
80
 
package/lib/challenges.js CHANGED
@@ -3,10 +3,8 @@
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as database from '@bedrock/mongodb';
6
+ import {decodeId, generateId} from 'bnid';
6
7
  import assert from 'assert-plus';
7
- import {createRequire} from 'node:module';
8
- const require = createRequire(import.meta.url);
9
- const {generateId, decodeId} = require('bnid');
10
8
 
11
9
  const {util: {BedrockError}} = bedrock;
12
10
 
@@ -2,20 +2,20 @@
2
2
  * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
+ import {
6
+ documentLoader as brDocLoader,
7
+ httpClientHandler,
8
+ JsonLdDocumentLoader
9
+ } from '@bedrock/jsonld-document-loader';
10
+ import {createContextDocumentLoader} from '@bedrock/service-context-store';
11
+ import {didIo} from '@bedrock/did-io';
5
12
  import '@bedrock/credentials-context';
6
13
  import '@bedrock/did-context';
7
14
  import '@bedrock/did-io';
8
15
  import '@bedrock/security-context';
9
- import '@bedrock/vc-status-list-context';
10
16
  import '@bedrock/vc-revocation-list-context';
17
+ import '@bedrock/vc-status-list-context';
11
18
  import '@bedrock/veres-one-context';
12
- import {createContextDocumentLoader} from '@bedrock/service-context-store';
13
- import {didIo} from '@bedrock/did-io';
14
- import {
15
- documentLoader as brDocLoader,
16
- httpClientHandler,
17
- JsonLdDocumentLoader
18
- } from '@bedrock/jsonld-document-loader';
19
19
 
20
20
  const serviceType = 'vc-verifier';
21
21
  let webLoader;
package/lib/http.js CHANGED
@@ -2,26 +2,22 @@
2
2
  * Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
+ import * as vc from '@digitalbazaar/vc';
5
6
  import {createChallenge, verifyChallenge} from './challenges.js';
6
- import {asyncHandler} from '@bedrock/express';
7
- import bodyParser from 'body-parser';
8
- import {checkStatus} from './status.js';
9
- import cors from 'cors';
10
7
  import {
11
8
  createChallengeBody,
12
9
  verifyCredentialBody,
13
10
  verifyPresentationBody
14
11
  } from '../schemas/bedrock-vc-verifier.js';
12
+ import {metering, middleware} from '@bedrock/service-core';
13
+ import {asyncHandler} from '@bedrock/express';
14
+ import bodyParser from 'body-parser';
15
+ import {checkStatus} from './status.js';
16
+ import cors from 'cors';
15
17
  import {createDocumentLoader} from './documentLoader.js';
16
- import {createRequire} from 'node:module';
18
+ import {Ed25519Signature2018} from '@digitalbazaar/ed25519-signature-2018';
19
+ import {Ed25519Signature2020} from '@digitalbazaar/ed25519-signature-2020';
17
20
  import {createValidateMiddleware as validate} from '@bedrock/validation';
18
- import {metering, middleware} from '@bedrock/service-core';
19
- const require = createRequire(import.meta.url);
20
- const {Ed25519Signature2020} =
21
- require('@digitalbazaar/ed25519-signature-2020');
22
- const {Ed25519Signature2018} =
23
- require('@digitalbazaar/ed25519-signature-2018');
24
- const vc = require('@digitalbazaar/vc');
25
21
 
26
22
  const {util: {BedrockError}} = bedrock;
27
23
 
package/lib/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) 2021-2022 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
- import {addRoutes} from './http.js';
6
5
  import {
7
6
  addRoutes as addContextStoreRoutes
8
7
  } from '@bedrock/service-context-store';
8
+ import {addRoutes} from './http.js';
9
9
  import {createService} from '@bedrock/service-core';
10
10
  import {initializeServiceAgent} from '@bedrock/service-agent';
11
11
 
package/lib/status.js CHANGED
@@ -1,17 +1,15 @@
1
1
  /*!
2
2
  * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
3
  */
4
+ import {
5
+ checkStatus as revocationListCheckStatus,
6
+ statusTypeMatches as revocationListStatusTypeMatches
7
+ } from '@digitalbazaar/vc-revocation-list';
8
+ import {
9
+ checkStatus as statusListCheckStatus,
10
+ statusTypeMatches as statusListStatusTypeMatches
11
+ } from '@digitalbazaar/vc-status-list';
4
12
  import assert from 'assert-plus';
5
- import {createRequire} from 'node:module';
6
- const require = createRequire(import.meta.url);
7
- const {
8
- checkStatus: statusListCheckStatus,
9
- statusTypeMatches: statusListStatusTypeMatches
10
- } = require('@digitalbazaar/vc-status-list');
11
- const {
12
- checkStatus: revocationListCheckStatus,
13
- statusTypeMatches: revocationListStatusTypeMatches
14
- } = require('vc-revocation-list');
15
13
 
16
14
  const handlerMap = new Map();
17
15
  handlerMap.set('RevocationList2020Status', {
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@bedrock/vc-verifier",
3
- "version": "11.0.0",
3
+ "version": "12.0.0",
4
4
  "type": "module",
5
5
  "description": "Bedrock VC Verifier",
6
6
  "main": "./lib/index.js",
7
+ "files": [
8
+ "lib/**/*.js",
9
+ "schemas/**/*.js"
10
+ ],
7
11
  "scripts": {
8
12
  "lint": "eslint ."
9
13
  },
@@ -21,42 +25,43 @@
21
25
  },
22
26
  "homepage": "https://github.com/digitalbazaar/bedrock-vc-verifier",
23
27
  "dependencies": {
24
- "@digitalbazaar/ed25519-signature-2018": "^2.1.0",
25
- "@digitalbazaar/ed25519-signature-2020": "^3.0.0",
26
- "@digitalbazaar/vc": "^2.1.0",
27
- "@digitalbazaar/vc-status-list": "^4.0.0",
28
+ "@digitalbazaar/ed25519-signature-2018": "^3.0.0",
29
+ "@digitalbazaar/ed25519-signature-2020": "^4.0.1",
30
+ "@digitalbazaar/vc": "^4.0.0",
31
+ "@digitalbazaar/vc-revocation-list": "^4.0.0",
32
+ "@digitalbazaar/vc-status-list": "^5.0.0",
28
33
  "assert-plus": "^1.0.0",
29
- "bnid": "^2.1.0",
30
- "body-parser": "^1.19.0",
31
- "cors": "^2.8.5",
32
- "vc-revocation-list": "^3.0.0"
34
+ "bnid": "^3.0.0",
35
+ "body-parser": "^1.20.0",
36
+ "cors": "^2.8.5"
33
37
  },
34
38
  "peerDependencies": {
35
- "@bedrock/core": "^6.0.0",
39
+ "@bedrock/core": "^6.0.1",
36
40
  "@bedrock/credentials-context": "^3.0.0",
37
41
  "@bedrock/did-context": "^4.0.0",
38
- "@bedrock/did-io": "^8.0.0",
42
+ "@bedrock/did-io": "^9.0.1",
39
43
  "@bedrock/express": "^8.0.0",
40
44
  "@bedrock/https-agent": "^4.0.0",
41
45
  "@bedrock/jsonld-document-loader": "^3.0.0",
42
46
  "@bedrock/mongodb": "^10.0.0",
43
47
  "@bedrock/security-context": "^7.0.0",
44
- "@bedrock/service-agent": "^5.0.0",
45
- "@bedrock/service-context-store": "^7.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"
48
+ "@bedrock/service-agent": "^6.0.0",
49
+ "@bedrock/service-context-store": "^8.0.0",
50
+ "@bedrock/service-core": "^6.0.0",
51
+ "@bedrock/validation": "^7.0.0",
52
+ "@bedrock/vc-revocation-list-context": "^3.1.0",
53
+ "@bedrock/vc-status-list-context": "^4.1.0",
54
+ "@bedrock/veres-one-context": "^14.0.1"
51
55
  },
52
56
  "devDependencies": {
53
- "eslint": "^7.32.0",
54
- "eslint-config-digitalbazaar": "^2.8.0",
55
- "eslint-plugin-jsdoc": "^28.6.1",
56
- "jsdoc": "^3.6.4",
57
+ "eslint": "^8.18.0",
58
+ "eslint-config-digitalbazaar": "^4.0.1",
59
+ "eslint-plugin-jsdoc": "^39.3.3",
60
+ "eslint-plugin-unicorn": "^43.0.0",
61
+ "jsdoc": "^3.6.10",
57
62
  "jsdoc-to-markdown": "^7.1.1"
58
63
  },
59
64
  "engines": {
60
- "node": ">=14"
65
+ "node": ">=16"
61
66
  }
62
67
  }
package/.eslintrc.cjs DELETED
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- parserOptions: {
4
- // this is required for dynamic import()
5
- ecmaVersion: 2020
6
- },
7
- env: {
8
- node: true
9
- },
10
- extends: ['digitalbazaar', 'digitalbazaar/jsdoc'],
11
- ignorePatterns: ['node_modules/']
12
- };
@@ -1,77 +0,0 @@
1
- name: Bedrock Node.js CI
2
-
3
- on: [push]
4
-
5
- jobs:
6
- lint:
7
- runs-on: ubuntu-latest
8
- timeout-minutes: 10
9
- strategy:
10
- matrix:
11
- node-version: [16.x]
12
- steps:
13
- - uses: actions/checkout@v2
14
- - name: Use Node.js ${{ matrix.node-version }}
15
- uses: actions/setup-node@v1
16
- with:
17
- node-version: ${{ matrix.node-version }}
18
- - run: npm install
19
- - name: Run eslint
20
- run: npm run lint
21
- test-node:
22
- needs: [lint]
23
- runs-on: ubuntu-latest
24
- timeout-minutes: 10
25
- services:
26
- mongodb:
27
- image: mongo:4.4
28
- ports:
29
- - 27017:27017
30
- strategy:
31
- matrix:
32
- node-version: [14.x, 16.x]
33
- steps:
34
- - uses: actions/checkout@v2
35
- - name: Use Node.js ${{ matrix.node-version }}
36
- uses: actions/setup-node@v1
37
- with:
38
- node-version: ${{ matrix.node-version }}
39
- - run: |
40
- npm install
41
- cd test
42
- npm install
43
- - name: Run test with Node.js ${{ matrix.node-version }}
44
- run: |
45
- cd test
46
- npm test
47
- coverage:
48
- needs: [test-node]
49
- runs-on: ubuntu-latest
50
- timeout-minutes: 10
51
- services:
52
- mongodb:
53
- image: mongo:4.4
54
- ports:
55
- - 27017:27017
56
- strategy:
57
- matrix:
58
- node-version: [16.x]
59
- steps:
60
- - uses: actions/checkout@v2
61
- - name: Use Node.js ${{ matrix.node-version }}
62
- uses: actions/setup-node@v1
63
- with:
64
- node-version: ${{ matrix.node-version }}
65
- - run: |
66
- npm install
67
- cd test
68
- npm install
69
- - name: Generate coverage report
70
- run: |
71
- cd test
72
- npm run coverage-ci
73
- - name: Upload coverage to Codecov
74
- uses: codecov/codecov-action@v2
75
- with:
76
- file: ./test/coverage/lcov.info
77
- fail_ci_if_error: true
package/CHANGELOG.md DELETED
@@ -1,175 +0,0 @@
1
- # bedrock-vc-verifier ChangeLog
2
-
3
- ## 11.0.0 - 2022-06-05
4
-
5
- ### Changed
6
- - **BREAKING** Use `@digitalbazaar/vc-status-list` v4.0. If `statusPurpose`
7
- in credential does not match the `statusPurpose` of status list credential,
8
- an error will be thrown.
9
-
10
- ## 10.0.0 - 2022-05-17
11
-
12
- ### Changed
13
- - **BREAKING**: Use `@bedrock-service-context-store@7` to cause migration of
14
- old EDV context documents to the new EDV attribute version.
15
-
16
- ## 9.0.0 - 2022-05-05
17
-
18
- ### Changed
19
- - **BREAKING**: Update peer deps:
20
- - `@bedrock/service-agent@5`
21
- - `@bedrock/service-context-store@6`.
22
- - **BREAKING**: The updated peer dependencies use a new EDV client with a
23
- new blind attribute version. This version is incompatible with previous
24
- versions and a manual migration must be performed to update all
25
- EDV documents to use the new blind attribute version -- or a new
26
- deployment is required.
27
-
28
- ## 8.0.0 - 2022-04-29
29
-
30
- ### Changed
31
- - **BREAKING**: Update peer deps:
32
- - `@bedrock/core@6`
33
- - `@bedrock/credentials-context@3`
34
- - `@bedrock/did-context@4`
35
- - `@bedrock/did-io@8`
36
- - `@bedrock/express@8`
37
- - `@bedrock/https-agent@4`
38
- - `@bedrock/jsonld-document-loader@3`
39
- - `@bedrock/mongodb@10`
40
- - `@bedrock/security-context@7`
41
- - `@bedrock/service-agent@4`
42
- - `@bedrock/service-context-store@5`
43
- - `@bedrock/service-core@5`
44
- - `@bedrock/validation@7`
45
- - `@bedrock/vc-status-list-context@3`
46
- - `@bedrock/vc-revocation-list-context@3`
47
- - `@bedrock/veres-one-context@14`.
48
-
49
- ## 7.0.0 - 2022-04-23
50
-
51
- ### Changed
52
- - **BREAKING**: Update `@digitalbazaar/vc-status-list` and
53
- `@bedrock/vc-status-list-context` to v3.0.
54
-
55
- ## 6.0.0 - 2022-04-06
56
-
57
- ### Changed
58
- - **BREAKING**: Rename package to `@bedrock/vc-verifier`.
59
- - **BREAKING**: Convert to module (ESM).
60
- - **BREAKING**: Remove default export.
61
- - **BREAKING**: Require node 14.x.
62
-
63
- ## 5.2.0 - 2022-03-14
64
-
65
- ### Added
66
- - Add missing dependencies `@digitalbazaar/webkms-client@10.0` and
67
- `@digitalbazaar/edv-client@13.0` in test.
68
- - Add coverage action in github workflows.
69
-
70
- ### Removed
71
- - Remove unused dependency `crypto-ld@6.0`.
72
- - Remove unused dependencies `veres-one-context`, `did-veres-one`, `crypto-ld`,
73
- `did-context` and `bedrock-views` from test.
74
-
75
- ## 5.1.0 - 2022-03-12
76
-
77
- ### Changed
78
- - Update dependencies:
79
- - `@digitalbazaar/vc-status-list@2.1`.
80
-
81
- ## 5.0.0 - 2022-03-11
82
-
83
- ### Changed
84
- - **BREAKING**: Update peer dependencies:
85
- - `bedrock-service-core@3`
86
- - `bedrock-service-context-store@3`
87
- - `bedrock-did-io@6.1`.
88
-
89
- ## 4.0.0 - 2022-03-01
90
-
91
- ### Changed
92
- - **BREAKING**: Move zcap revocations to `/zcaps/revocations` to better
93
- future proof.
94
- - **BREAKING**: Require `bedrock-service-core@2`, `bedrock-service-agent@2`,
95
- and `bedrock-service-context-store@2` peer dependencies.
96
-
97
- ## 3.1.0 - 2022-02-23
98
-
99
- ### Added
100
- - Add default (dev mode) `app-identity` entry for `vc-verifier` service.
101
-
102
- ## 3.0.1 - 2022-02-21
103
-
104
- ### Changed
105
- - Use `@digitalbazaar/vc-status-list-context` and updated bedrock-vc-status-list-context.
106
- These dependencies have no changes other than moved package locations.
107
-
108
- ## 3.0.0 - 2022-02-20
109
-
110
- ### Changed
111
- - **BREAKING**: Complete refactor to run on top of `bedrock-service*` modules. While
112
- this version has similar functionality, its APIs and implementation are a clean
113
- break from previous versions.
114
-
115
- ## 2.3.0 - 2022-02-15
116
-
117
- ### Changed
118
- - Refactor documentLoader.
119
-
120
- ## 2.2.0 - 2022-02-09
121
-
122
- ### Added
123
- - Add support for "StatusList2021Credential" status checks using
124
- `vc-status-list@1.0`
125
- - Add tests.
126
-
127
- ## 2.1.0 - 2021-09-14
128
-
129
- ### Added
130
- - Add support for unsigned VPs.
131
-
132
- ## 2.0.2 - 2021-08-23
133
-
134
- ### Changed
135
- - Update deps to fix multicodec bugs and set `verificationSuite` for `v1` to
136
- `Ed25519VerificationKey2020` in config.
137
-
138
- ## 2.0.1 - 2021-05-28
139
-
140
- ### Fixed
141
- - Fix bedrock peer dependencies.
142
-
143
- ## 2.0.0 - 2021-05-28
144
-
145
- ### Changed
146
- - **BREAKING**: Remove `axios` and use `@digitalbazaar/http-client@1.1.0`.
147
- Errors surfaced from `http-client` do not have the same signature as `axios`.
148
- - **BREAKING**: Remove `cfg.ledgerHostname` and `cfg.mode` from `config.js`.
149
- - **BREAKING**: Use [vc-revocation-list@3](https://github.com/digitalbazaar/vc-revocation-list/blob/main/CHANGELOG.md).
150
- Revocation list credentials must have the same issuer value as the credential
151
- to be revoked.
152
- - **BREAKING**: Use [bedrock-did-io@3.0](https://github.com/digitalbazaar/bedrock-did-io/blob/main/CHANGELOG.md).
153
- - Replace `vc-js` with `@digitalbazaar/vc`.
154
- - Update to support ed25519 2020 signature suite.
155
- - Update peerDeps and testDeps.
156
-
157
- ## 1.2.0 - 2021-03-03
158
-
159
- ### Fixed
160
-
161
- - Only verify based on `options.checks`.
162
-
163
- ## 1.1.0 - 2020-05-18
164
-
165
- ### Added
166
-
167
- - Implement W3C CCG VC Verification HTTP API.
168
-
169
- ## 1.0.0 - 2020-02-27
170
-
171
- ### Added
172
- - API endpoint /vc/verify which can verify a presentation.
173
- - Mock API endpoint /verifiers/:verifierId/verifications/:referenceId
174
- - Positive tests for both endpoints.
175
- - Utils to serialize errors in verification reports.
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- env: {
3
- mocha: true
4
- },
5
- globals: {
6
- assertNoError: true,
7
- should: true
8
- }
9
- };