@bedrock/kms-http 13.0.0 → 14.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 +7 -33
- package/CHANGELOG.md +12 -0
- package/lib/BedrockKeystoreConfigStorage.js +1 -1
- package/lib/http.js +1 -1
- package/lib/middleware.js +1 -1
- package/package.json +9 -9
- package/test/mocha/10-keystore.js +4 -4
- package/test/mocha/11-keystore-kms-client.js +2 -2
- package/test/mocha/20-revocation.js +1 -1
- package/test/mocha/21-revocation-ip-allow-list.js +1 -1
- package/test/mocha/30-operations-generate-key.js +2 -2
- package/test/mocha/31-operations-hmac.js +2 -4
- package/test/mocha/helpers.js +2 -2
- package/test/mocha/mock.data.js +1 -1
- package/test/package.json +23 -23
- package/test/test.config.js +2 -2
|
@@ -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 }}
|
|
@@ -43,45 +43,19 @@ jobs:
|
|
|
43
43
|
- name: Run test with Node.js ${{ matrix.node-version }}
|
|
44
44
|
run: |
|
|
45
45
|
cd test
|
|
46
|
-
npm
|
|
47
|
-
test-karma:
|
|
48
|
-
needs: [test-node]
|
|
49
|
-
runs-on: ubuntu-latest
|
|
50
|
-
timeout-minutes: 10
|
|
51
|
-
services:
|
|
52
|
-
mongodb:
|
|
53
|
-
image: mongo:4.2
|
|
54
|
-
ports:
|
|
55
|
-
- 27017:27017
|
|
56
|
-
strategy:
|
|
57
|
-
matrix:
|
|
58
|
-
node-version: [14.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: Run test with Node.js ${{ matrix.node-version }}
|
|
70
|
-
run: |
|
|
71
|
-
cd test
|
|
72
|
-
npm run test-karma
|
|
46
|
+
npm test
|
|
73
47
|
coverage:
|
|
74
|
-
needs: [test-
|
|
48
|
+
needs: [test-node]
|
|
75
49
|
runs-on: ubuntu-latest
|
|
76
50
|
timeout-minutes: 10
|
|
77
51
|
services:
|
|
78
52
|
mongodb:
|
|
79
|
-
image: mongo:4.
|
|
53
|
+
image: mongo:4.4
|
|
80
54
|
ports:
|
|
81
55
|
- 27017:27017
|
|
82
56
|
strategy:
|
|
83
57
|
matrix:
|
|
84
|
-
node-version: [
|
|
58
|
+
node-version: [16.x]
|
|
85
59
|
steps:
|
|
86
60
|
- uses: actions/checkout@v2
|
|
87
61
|
- name: Use Node.js ${{ matrix.node-version }}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# bedrock-kms-http ChangeLog
|
|
2
2
|
|
|
3
|
+
## 14.0.0 - 2022-04-29
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- **BREAKING**: Update peer deps:
|
|
7
|
+
- `@bedrock/core@6`
|
|
8
|
+
- `@bedrock/app-identity@3`
|
|
9
|
+
- `@bedrock/express@8`
|
|
10
|
+
- `@bedrock/kms@10`
|
|
11
|
+
- `@bedrock/meter-usage-reporter@7`
|
|
12
|
+
- `@bedrock/validation@7`
|
|
13
|
+
- `@bedrock/zcap-storage@7`.
|
|
14
|
+
|
|
3
15
|
## 13.0.0 - 2022-04-05
|
|
4
16
|
|
|
5
17
|
### Changed
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as bedrock from '@bedrock/core';
|
|
5
5
|
import * as helpers from './helpers.js';
|
|
6
|
-
import {createRequire} from 'module';
|
|
6
|
+
import {createRequire} from 'node:module';
|
|
7
7
|
import {keystores} from '@bedrock/kms';
|
|
8
8
|
const require = createRequire(import.meta.url);
|
|
9
9
|
const {KeystoreConfigStorage} = require('@digitalbazaar/webkms-switch');
|
package/lib/http.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as helpers from './helpers.js';
|
|
|
7
7
|
import * as middleware from './middleware.js';
|
|
8
8
|
import {asyncHandler} from '@bedrock/express';
|
|
9
9
|
import cors from 'cors';
|
|
10
|
-
import {createRequire} from 'module';
|
|
10
|
+
import {createRequire} from 'node:module';
|
|
11
11
|
import {createValidateMiddleware as validate} from '@bedrock/validation';
|
|
12
12
|
import {
|
|
13
13
|
defaultModuleManager as moduleManager,
|
package/lib/middleware.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as brZCapStorage from '@bedrock/zcap-storage';
|
|
|
6
6
|
import * as helpers from './helpers.js';
|
|
7
7
|
import {asyncHandler} from '@bedrock/express';
|
|
8
8
|
import {BedrockKeystoreConfigStorage} from './BedrockKeystoreConfigStorage.js';
|
|
9
|
-
import {createRequire} from 'module';
|
|
9
|
+
import {createRequire} from 'node:module';
|
|
10
10
|
import {
|
|
11
11
|
defaultDocumentLoader as documentLoader,
|
|
12
12
|
defaultModuleManager as moduleManager
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock/kms-http",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bedrock KMS HTTP API",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"netmask": "^2.0.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@bedrock/
|
|
39
|
-
"@bedrock/
|
|
40
|
-
"@bedrock/express": "^
|
|
41
|
-
"@bedrock/kms": "^
|
|
42
|
-
"@bedrock/meter-usage-reporter": "^
|
|
43
|
-
"@bedrock/validation": "^
|
|
44
|
-
"@bedrock/zcap-storage": "^
|
|
38
|
+
"@bedrock/app-identity": "^3.0.0",
|
|
39
|
+
"@bedrock/core": "^6.0.0",
|
|
40
|
+
"@bedrock/express": "^8.0.0",
|
|
41
|
+
"@bedrock/kms": "^10.0.0",
|
|
42
|
+
"@bedrock/meter-usage-reporter": "^7.0.0",
|
|
43
|
+
"@bedrock/validation": "^7.0.0",
|
|
44
|
+
"@bedrock/zcap-storage": "^7.0.0"
|
|
45
45
|
},
|
|
46
46
|
"directories": {
|
|
47
47
|
"lib": "./lib"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"eslint": "^7.32.0",
|
|
51
51
|
"eslint-config-digitalbazaar": "^2.8.0",
|
|
52
|
-
"eslint-plugin-jsdoc": "^
|
|
52
|
+
"eslint-plugin-jsdoc": "^39.2.9",
|
|
53
53
|
"jsdoc-to-markdown": "^7.1.1"
|
|
54
54
|
},
|
|
55
55
|
"engines": {
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
import * as bedrock from '@bedrock/core';
|
|
5
5
|
import * as helpers from './helpers.js';
|
|
6
6
|
import {agent} from '@bedrock/https-agent';
|
|
7
|
-
import {createRequire} from 'module';
|
|
7
|
+
import {createRequire} from 'node:module';
|
|
8
|
+
import {httpClient, DEFAULT_HEADERS} from '@digitalbazaar/http-client';
|
|
8
9
|
import {mockData} from './mock.data.js';
|
|
9
10
|
const require = createRequire(import.meta.url);
|
|
10
11
|
const {CapabilityAgent} = require('@digitalbazaar/webkms-client');
|
|
11
|
-
const {httpClient, DEFAULT_HEADERS} = require('@digitalbazaar/http-client');
|
|
12
12
|
const {signCapabilityInvocation} = require(
|
|
13
13
|
'@digitalbazaar/http-signature-zcap-invoke');
|
|
14
14
|
const {ZcapClient} = require('@digitalbazaar/ezcap');
|
|
@@ -334,7 +334,7 @@ describe('bedrock-kms-http API', () => {
|
|
|
334
334
|
should.exist(result);
|
|
335
335
|
result.should.eql(expectedConfig);
|
|
336
336
|
});
|
|
337
|
-
it('throw
|
|
337
|
+
it('throw operation error when attempting to update "meterId"',
|
|
338
338
|
async () => {
|
|
339
339
|
// TODO: Remove or update this test when the following is fixed
|
|
340
340
|
// eslint-disable-next-line max-len
|
|
@@ -385,7 +385,7 @@ describe('bedrock-kms-http API', () => {
|
|
|
385
385
|
should.not.exist(result);
|
|
386
386
|
should.exist(err);
|
|
387
387
|
err.status.should.equal(500);
|
|
388
|
-
err.data.type.should.equal('
|
|
388
|
+
err.data.type.should.equal('OperationError');
|
|
389
389
|
});
|
|
390
390
|
it('rejects config update for an invalid zcap', async () => {
|
|
391
391
|
const secret = 'd852a72d-013f-4dd6-8ba2-588aaf601b66';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as helpers from './helpers.js';
|
|
5
5
|
import {httpsAgent} from '@bedrock/https-agent';
|
|
6
|
-
import {createRequire} from 'module';
|
|
6
|
+
import {createRequire} from 'node:module';
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
const {CapabilityAgent, KmsClient, KeystoreAgent} =
|
|
9
9
|
require('@digitalbazaar/webkms-client');
|
|
@@ -55,7 +55,7 @@ describe('keystore API interactions using webkms-client', () => {
|
|
|
55
55
|
should.not.exist(result);
|
|
56
56
|
should.exist(err);
|
|
57
57
|
err.status.should.equal(400);
|
|
58
|
-
err.data.should.
|
|
58
|
+
err.data.should.include.keys('message', 'name', 'type', 'details', 'cause');
|
|
59
59
|
err.data.type.should.equal('URLMismatchError');
|
|
60
60
|
err.data.details.should.have.keys(
|
|
61
61
|
['expected', 'httpStatusCode', 'actual', 'configId', 'requestUrl']);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as helpers from './helpers.js';
|
|
5
5
|
import {httpsAgent} from '@bedrock/https-agent';
|
|
6
|
-
import {createRequire} from 'module';
|
|
6
|
+
import {createRequire} from 'node:module';
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
const {CapabilityAgent, KmsClient, KeystoreAgent} =
|
|
9
9
|
require('@digitalbazaar/webkms-client');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as helpers from './helpers.js';
|
|
5
5
|
import {httpsAgent} from '@bedrock/https-agent';
|
|
6
|
-
import {createRequire} from 'module';
|
|
6
|
+
import {createRequire} from 'node:module';
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
const {CapabilityAgent, KmsClient, KeystoreAgent} =
|
|
9
9
|
require('@digitalbazaar/webkms-client');
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import * as helpers from './helpers.js';
|
|
5
|
+
import {httpClient, DEFAULT_HEADERS} from '@digitalbazaar/http-client';
|
|
5
6
|
import {httpsAgent} from '@bedrock/https-agent';
|
|
6
|
-
import {createRequire} from 'module';
|
|
7
|
+
import {createRequire} from 'node:module';
|
|
7
8
|
const require = createRequire(import.meta.url);
|
|
8
9
|
const {CapabilityAgent, KmsClient, KeystoreAgent} =
|
|
9
10
|
require('@digitalbazaar/webkms-client');
|
|
10
|
-
const {httpClient, DEFAULT_HEADERS} = require('@digitalbazaar/http-client');
|
|
11
11
|
const {signCapabilityInvocation} = require(
|
|
12
12
|
'@digitalbazaar/http-signature-zcap-invoke');
|
|
13
13
|
|
|
@@ -1,17 +1,15 @@
|
|
|
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 {httpsAgent} from '@bedrock/https-agent';
|
|
7
|
-
import {createRequire} from 'module';
|
|
6
|
+
import {createRequire} from 'node:module';
|
|
8
7
|
import pMap from 'p-map';
|
|
8
|
+
import uuid from 'uuid-random';
|
|
9
9
|
const require = createRequire(import.meta.url);
|
|
10
10
|
const {CapabilityAgent, Hmac, KmsClient} = require(
|
|
11
11
|
'@digitalbazaar/webkms-client');
|
|
12
12
|
|
|
13
|
-
const {util: {uuid}} = bedrock;
|
|
14
|
-
|
|
15
13
|
const ZCAP_ROOT_PREFIX = 'urn:zcap:root:';
|
|
16
14
|
|
|
17
15
|
describe('bedrock-kms-http HMAC operations', () => {
|
package/test/mocha/helpers.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import * as bedrock from '@bedrock/core';
|
|
5
|
-
import {createRequire} from 'module';
|
|
5
|
+
import {createRequire} from 'node:module';
|
|
6
6
|
import {documentLoader} from '@bedrock/jsonld-document-loader';
|
|
7
7
|
import {getAppIdentity} from '@bedrock/app-identity';
|
|
8
8
|
import {httpsAgent} from '@bedrock/https-agent';
|
|
9
9
|
import jsigs from 'jsonld-signatures';
|
|
10
|
+
import uuid from 'uuid-random';
|
|
10
11
|
const require = createRequire(import.meta.url);
|
|
11
12
|
const {AsymmetricKey, CapabilityAgent, KeystoreAgent, KmsClient} =
|
|
12
13
|
require('@digitalbazaar/webkms-client');
|
|
@@ -18,7 +19,6 @@ const {Ed25519Signature2020} = require('@digitalbazaar/ed25519-signature-2020');
|
|
|
18
19
|
const {ZcapClient} = require('@digitalbazaar/ezcap');
|
|
19
20
|
|
|
20
21
|
const {purposes: {AssertionProofPurpose}} = jsigs;
|
|
21
|
-
const {util: {uuid}} = bedrock;
|
|
22
22
|
const {ZCAP_CONTEXT_URL} = zcapConstants;
|
|
23
23
|
|
|
24
24
|
export async function createMeter({capabilityAgent} = {}) {
|
package/test/mocha/mock.data.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
|
-
import {createRequire} from 'module';
|
|
4
|
+
import {createRequire} from 'node:module';
|
|
5
5
|
const require = createRequire(import.meta.url);
|
|
6
6
|
const {constants: zcapConstants} = require('@digitalbazaar/zcap');
|
|
7
7
|
|
package/test/package.json
CHANGED
|
@@ -14,33 +14,33 @@
|
|
|
14
14
|
"coverage-report": "c8 report"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@bedrock/app-identity": "^
|
|
18
|
-
"@bedrock/core": "^
|
|
19
|
-
"@bedrock/did-context": "^
|
|
20
|
-
"@bedrock/did-io": "^
|
|
21
|
-
"@bedrock/express": "^
|
|
22
|
-
"@bedrock/https-agent": "^
|
|
23
|
-
"@bedrock/jsonld-document-loader": "^
|
|
24
|
-
"@bedrock/karma": "^
|
|
25
|
-
"@bedrock/kms": "^
|
|
17
|
+
"@bedrock/app-identity": "^3.0.0",
|
|
18
|
+
"@bedrock/core": "^6.0.0",
|
|
19
|
+
"@bedrock/did-context": "^4.0.0",
|
|
20
|
+
"@bedrock/did-io": "^8.0.0",
|
|
21
|
+
"@bedrock/express": "^8.0.0",
|
|
22
|
+
"@bedrock/https-agent": "^4.0.0",
|
|
23
|
+
"@bedrock/jsonld-document-loader": "^3.0.0",
|
|
24
|
+
"@bedrock/karma": "^4.0.0",
|
|
25
|
+
"@bedrock/kms": "^10.0.0",
|
|
26
26
|
"@bedrock/kms-http": "file:..",
|
|
27
|
-
"@bedrock/ledger-context": "^
|
|
28
|
-
"@bedrock/meter": "^
|
|
29
|
-
"@bedrock/meter-http": "^
|
|
30
|
-
"@bedrock/meter-usage-reporter": "^
|
|
31
|
-
"@bedrock/mongodb": "^
|
|
32
|
-
"@bedrock/package-manager": "^
|
|
33
|
-
"@bedrock/security-context": "^
|
|
34
|
-
"@bedrock/server": "^
|
|
35
|
-
"@bedrock/ssm-mongodb": "^
|
|
36
|
-
"@bedrock/test": "^
|
|
37
|
-
"@bedrock/validation": "^
|
|
38
|
-
"@bedrock/veres-one-context": "^
|
|
39
|
-
"@bedrock/zcap-storage": "^
|
|
27
|
+
"@bedrock/ledger-context": "^23.0.0",
|
|
28
|
+
"@bedrock/meter": "^3.0.0",
|
|
29
|
+
"@bedrock/meter-http": "^8.0.0",
|
|
30
|
+
"@bedrock/meter-usage-reporter": "^7.0.0",
|
|
31
|
+
"@bedrock/mongodb": "^10.0.0",
|
|
32
|
+
"@bedrock/package-manager": "^3.0.0",
|
|
33
|
+
"@bedrock/security-context": "^7.0.0",
|
|
34
|
+
"@bedrock/server": "^5.0.0",
|
|
35
|
+
"@bedrock/ssm-mongodb": "^9.0.0",
|
|
36
|
+
"@bedrock/test": "^8.0.0",
|
|
37
|
+
"@bedrock/validation": "^7.0.0",
|
|
38
|
+
"@bedrock/veres-one-context": "^14.0.0",
|
|
39
|
+
"@bedrock/zcap-storage": "^7.0.0",
|
|
40
40
|
"@digitalbazaar/did-method-key": "^2.0.0",
|
|
41
41
|
"@digitalbazaar/ed25519-signature-2020": "^3.0.0",
|
|
42
42
|
"@digitalbazaar/ezcap": "^2.0.0",
|
|
43
|
-
"@digitalbazaar/http-client": "^
|
|
43
|
+
"@digitalbazaar/http-client": "^3.0.1",
|
|
44
44
|
"@digitalbazaar/http-signature-zcap-invoke": "^5.0.1",
|
|
45
45
|
"@digitalbazaar/webkms-client": "^10.0.0",
|
|
46
46
|
"@digitalbazaar/zcap": "^7.0.0",
|
package/test/test.config.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import {config} from '@bedrock/core';
|
|
5
|
-
import {fileURLToPath} from 'url';
|
|
6
|
-
import path from 'path';
|
|
5
|
+
import {fileURLToPath} from 'node:url';
|
|
6
|
+
import path from 'node:path';
|
|
7
7
|
import '@bedrock/https-agent';
|
|
8
8
|
import '@bedrock/kms-http';
|
|
9
9
|
import '@bedrock/mongodb';
|