@bedrock/kms 10.3.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.
@@ -1,240 +0,0 @@
1
- /*!
2
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import * as helpers from './helpers.js';
5
- import {createRequire} from 'node:module';
6
- import {defaultModuleManager as moduleManager} from '@bedrock/kms';
7
- import {klona} from 'klona';
8
- import {mockData} from './mock.data.js';
9
- import {v4 as uuid} from 'uuid';
10
- const require = createRequire(import.meta.url);
11
- const {runOperation} = require('@digitalbazaar/webkms-switch');
12
-
13
- describe('bedrock-kms', () => {
14
- describe('integration with runOperation API', () => {
15
- describe('GenerateKeyOperation', () => {
16
- it('successfully generates a Ed25519VerificationKey2018', async () => {
17
- const keystore = {
18
- id: 'https://example.com/keystores/x',
19
- controller: 'urn:uuid:baa943d2-7338-11ec-b1c4-10bf48838a41',
20
- kmsModule: 'ssm-v1'
21
- };
22
- const operation = klona(
23
- mockData.operations.generate({type: 'Ed25519VerificationKey2018'}));
24
- operation.invocationTarget.type = 'Ed25519VerificationKey2018';
25
- let error;
26
- let result;
27
- try {
28
- result = await runOperation({operation, keystore, moduleManager});
29
- } catch(e) {
30
- error = e;
31
- }
32
- assertNoError(error);
33
- should.exist(result);
34
- result.should.have.keys(['keyId', 'result']);
35
- result.result.should.have.keys(['keyId', 'keyDescription']);
36
- const {keyDescription} = result.result;
37
- keyDescription.should.have.keys(
38
- ['@context', 'id', 'publicKeyBase58', 'type', 'controller']);
39
- keyDescription.type.should.equal(operation.invocationTarget.type);
40
- keyDescription.publicKeyBase58.should.be.a('string');
41
- });
42
- it('successfully generates a Ed25519VerificationKey2020', async () => {
43
- const keystore = {
44
- id: 'https://example.com/keystores/x',
45
- controller: 'urn:uuid:baa943d2-7338-11ec-b1c4-10bf48838a41',
46
- kmsModule: 'ssm-v1'
47
- };
48
- const operation = klona(
49
- mockData.operations.generate({type: 'Ed25519VerificationKey2020'}));
50
- operation.invocationTarget.type = 'Ed25519VerificationKey2020';
51
- let error;
52
- let result;
53
- try {
54
- result = await runOperation({operation, keystore, moduleManager});
55
- } catch(e) {
56
- error = e;
57
- }
58
- assertNoError(error);
59
- should.exist(result);
60
- result.should.have.keys(['keyId', 'result']);
61
- result.result.should.have.keys(['keyId', 'keyDescription']);
62
- const {keyDescription} = result.result;
63
- keyDescription.should.have.keys(
64
- ['@context', 'id', 'publicKeyMultibase', 'type', 'controller']);
65
- keyDescription.type.should.equal(operation.invocationTarget.type);
66
- keyDescription.publicKeyMultibase.should.be.a('string');
67
- });
68
- it('successfully generates a Sha256HmacKey2019', async () => {
69
- const keystore = {
70
- id: 'https://example.com/keystores/x',
71
- controller: 'urn:uuid:baa943d2-7338-11ec-b1c4-10bf48838a41',
72
- kmsModule: 'ssm-v1'
73
- };
74
- const operation = klona(
75
- mockData.operations.generate({type: 'Sha256HmacKey2019'}));
76
- operation.invocationTarget.type = 'Sha256HmacKey2019';
77
- let error;
78
- let result;
79
- try {
80
- result = await runOperation({operation, keystore, moduleManager});
81
- } catch(e) {
82
- error = e;
83
- }
84
- assertNoError(error);
85
- should.exist(result);
86
- result.should.be.an('object');
87
- result.should.have.keys(['keyId', 'result']);
88
- result.result.should.have.keys(['keyId', 'keyDescription']);
89
- const {keyDescription} = result.result;
90
- keyDescription.should.have.keys(
91
- ['@context', 'id', 'type', 'controller']);
92
- });
93
- it('successfully generates a AesKeyWrappingKey2019', async () => {
94
- const keystore = {
95
- id: 'https://example.com/keystores/x',
96
- controller: 'urn:uuid:baa943d2-7338-11ec-b1c4-10bf48838a41',
97
- kmsModule: 'ssm-v1'
98
- };
99
- const operation = klona(
100
- mockData.operations.generate({type: 'AesKeyWrappingKey2019'}));
101
- operation.invocationTarget.type = 'AesKeyWrappingKey2019';
102
- let error;
103
- let result;
104
- try {
105
- result = await runOperation({operation, keystore, moduleManager});
106
- } catch(e) {
107
- error = e;
108
- }
109
- assertNoError(error);
110
- should.exist(result);
111
- result.should.be.an('object');
112
- result.should.have.keys(['keyId', 'result']);
113
- result.result.should.have.keys(['keyId', 'keyDescription']);
114
- const {keyDescription} = result.result;
115
- keyDescription.should.have.keys(
116
- ['@context', 'id', 'type', 'controller']);
117
- });
118
- it('throws on UnknownKeyType', async () => {
119
- const keystore = {
120
- id: 'https://example.com/keystores/x',
121
- controller: 'urn:uuid:baa943d2-7338-11ec-b1c4-10bf48838a41',
122
- kmsModule: 'ssm-v1'
123
- };
124
- const operation = klona(
125
- mockData.operations.generate({type: 'AesKeyWrappingKey2019'}));
126
- operation.invocationTarget.type = 'UnknownKeyType';
127
- let error;
128
- let result;
129
- try {
130
- result = await runOperation({operation, keystore, moduleManager});
131
- } catch(e) {
132
- error = e;
133
- }
134
- should.exist(error);
135
- should.not.exist(result);
136
- error.message.should.include('UnknownKeyType');
137
- });
138
- }); // end GenerateKeyOperation
139
-
140
- describe('SignOperation', () => {
141
- it('signs a string using Ed25519VerificationKey2018', async () => {
142
- const {keystore, key: {id: keyId}} = await helpers.generateKey(
143
- {mockData, type: 'Ed25519VerificationKey2018'});
144
- const operation = klona(mockData.operations.sign);
145
- operation.invocationTarget = keyId;
146
- operation.verifyData = uuid();
147
- let result;
148
- let error;
149
- try {
150
- result = await runOperation({operation, keystore, moduleManager});
151
- } catch(e) {
152
- error = e;
153
- }
154
- assertNoError(error);
155
- should.exist(result);
156
- result.should.be.an('object');
157
- result.should.have.keys(['keyId', 'result']);
158
- result.result.should.have.keys(['signatureValue']);
159
- should.exist(result.result.signatureValue);
160
- const {signatureValue} = result.result;
161
- signatureValue.should.be.a('string');
162
- });
163
- it('signs a string using Ed25519VerificationKey2020', async () => {
164
- const {keystore, key: {id: keyId}} = await helpers.generateKey(
165
- {mockData, type: 'Ed25519VerificationKey2020'});
166
- const operation = klona(mockData.operations.sign);
167
- operation.invocationTarget = keyId;
168
- operation.verifyData = uuid();
169
- let result;
170
- let error;
171
- try {
172
- result = await runOperation({operation, keystore, moduleManager});
173
- } catch(e) {
174
- error = e;
175
- }
176
- assertNoError(error);
177
- should.exist(result);
178
- result.should.be.an('object');
179
- result.should.have.keys(['keyId', 'result']);
180
- result.result.should.have.keys(['signatureValue']);
181
- should.exist(result.result.signatureValue);
182
- const {signatureValue} = result.result;
183
- signatureValue.should.be.a('string');
184
- });
185
- it('signs a string using Sha256HmacKey2019', async () => {
186
- const {keystore, key: {id: keyId}} = await helpers.generateKey(
187
- {mockData, type: 'Sha256HmacKey2019'});
188
- const operation = klona(mockData.operations.sign);
189
- operation.invocationTarget = keyId;
190
- operation.verifyData = uuid();
191
- let result;
192
- let error;
193
- try {
194
- result = await runOperation({operation, keystore, moduleManager});
195
- } catch(e) {
196
- error = e;
197
- }
198
- assertNoError(error);
199
- should.exist(result);
200
- result.should.be.an('object');
201
- result.should.have.keys(['keyId', 'result']);
202
- result.result.should.have.keys(['signatureValue']);
203
- const {signatureValue} = result.result;
204
- signatureValue.should.be.a('string');
205
- signatureValue.should.have.length(43);
206
- });
207
- }); // end SignOperation
208
-
209
- describe('VerifyOperation', () => {
210
- it('verifies a string using Sha256HmacKey2019', async () => {
211
- const verifyData = uuid();
212
- const {keystore, key: {id: keyId}} = await helpers.generateKey(
213
- {mockData, type: 'Sha256HmacKey2019'});
214
- const signOperation = klona(mockData.operations.sign);
215
- signOperation.invocationTarget = keyId;
216
- signOperation.verifyData = verifyData;
217
- const {result: {signatureValue}} = await runOperation(
218
- {operation: signOperation, keystore, moduleManager});
219
- const verifyOperation = klona(mockData.operations.verify);
220
- verifyOperation.invocationTarget = keyId;
221
- verifyOperation.verifyData = verifyData;
222
- verifyOperation.signatureValue = signatureValue;
223
- let result;
224
- let error;
225
- try {
226
- result = await runOperation(
227
- {operation: verifyOperation, keystore, moduleManager});
228
- } catch(e) {
229
- error = e;
230
- }
231
- assertNoError(error);
232
- should.exist(result);
233
- result.should.be.an('object');
234
- result.should.have.keys(['keyId', 'result']);
235
- result.result.should.have.keys(['verified']);
236
- result.result.verified.should.be.true;
237
- });
238
- }); // end VerifyOperation
239
- }); // end runOperation API
240
- }); // end bedrock-kms
@@ -1,110 +0,0 @@
1
- /*!
2
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import * as helpers from './helpers.js';
5
- import {createRequire} from 'module';
6
- import {defaultModuleManager as moduleManager} from '@bedrock/kms';
7
- import {klona} from 'klona';
8
- import {mockData} from './mock.data.js';
9
- import {v4 as uuid} from 'uuid';
10
- const require = createRequire(import.meta.url);
11
- const {runOperation} = require('@digitalbazaar/webkms-switch');
12
-
13
- describe('bulk operations', () => {
14
- describe('Ed25519VerificationKey2020', () => {
15
- let mockKeyId;
16
- let keystore;
17
- const operationCount = 10000;
18
- const vData = [];
19
- before(async () => {
20
- for(let i = 0; i < operationCount; ++i) {
21
- let v = '';
22
- for(let n = 0; n < 100; ++n) {
23
- v += uuid();
24
- }
25
- vData.push(v);
26
- }
27
- });
28
- before(async () => {
29
- let err;
30
- try {
31
- ({keystore, key: {id: mockKeyId}} = await helpers.generateKey(
32
- {mockData, type: 'Ed25519VerificationKey2020'}));
33
- } catch(e) {
34
- err = e;
35
- }
36
- assertNoError(err);
37
- });
38
- it(`performs ${operationCount} signatures`, async function() {
39
- this.timeout(0);
40
- const promises = [];
41
- for(let i = 0; i < operationCount; ++i) {
42
- const operation = klona(mockData.operations.sign);
43
- operation.invocationTarget = mockKeyId;
44
- operation.verifyData = vData[i];
45
- promises.push(runOperation({
46
- operation, keystore, moduleManager
47
- }));
48
- }
49
- let result;
50
- let err;
51
- try {
52
- result = await Promise.all(promises);
53
- } catch(e) {
54
- err = e;
55
- }
56
- assertNoError(err);
57
- should.exist(result);
58
- result.should.be.an('array');
59
- result.should.have.length(operationCount);
60
- });
61
- });
62
- describe('Sha256HmacKey2019', () => {
63
- let mockKeyId;
64
- let keystore;
65
- const operationCount = 10000;
66
- const vData = [];
67
- before(async () => {
68
- for(let i = 0; i < operationCount; ++i) {
69
- let v = '';
70
- for(let n = 0; n < 100; ++n) {
71
- v += uuid();
72
- }
73
- vData.push(v);
74
- }
75
- });
76
- before(async () => {
77
- let err;
78
- try {
79
- ({keystore, key: {id: mockKeyId}} = await helpers.generateKey(
80
- {mockData, type: 'Sha256HmacKey2019'}));
81
- } catch(e) {
82
- err = e;
83
- }
84
- assertNoError(err);
85
- });
86
- it(`performs ${operationCount} signatures`, async function() {
87
- this.timeout(0);
88
- const promises = [];
89
- for(let i = 0; i < operationCount; ++i) {
90
- const operation = klona(mockData.operations.sign);
91
- operation.invocationTarget = mockKeyId;
92
- operation.verifyData = vData[i];
93
- promises.push(runOperation({
94
- operation, keystore, moduleManager
95
- }));
96
- }
97
- let result;
98
- let err;
99
- try {
100
- result = await Promise.all(promises);
101
- } catch(e) {
102
- err = e;
103
- }
104
- assertNoError(err);
105
- should.exist(result);
106
- result.should.be.an('array');
107
- result.should.have.length(operationCount);
108
- });
109
- });
110
- });
@@ -1,95 +0,0 @@
1
- /*!
2
- * Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import * as helpers from './helpers.js';
5
- import {keystores} from '@bedrock/kms';
6
-
7
- describe('Keystores Database Tests', () => {
8
- describe('Indexes', async () => {
9
- let mockConfigAlpha;
10
- beforeEach(async () => {
11
- await helpers.prepareDatabase();
12
- mockConfigAlpha = {
13
- id: 'https://example.com/keystores/' +
14
- '8b688649-d546-4e88-9027-da434bac495a',
15
- kmsModule: 'ssm-v1',
16
- controller: 'caf40b44-0e66-44ef-b331-23f6ca0bb837',
17
- sequence: 0,
18
- meterId: '6fb34a1a-e26d-49bc-bd00-66873ab0d147'
19
- };
20
-
21
- const mockConfigBeta = {
22
- id: 'https://example.com/keystores/' +
23
- '6821b4ec-2630-4bf3-9464-39581d2c4499',
24
- kmsModule: 'ssm-v1',
25
- controller: 'caf40b44-0e66-44ef-b331-23f6ca0bb837',
26
- sequence: 0,
27
- meterId: '6fb34a1a-e26d-49bc-bd00-66873ab0d147'
28
- };
29
-
30
- await keystores.insert({config: mockConfigAlpha});
31
- // second record is inserted here in order to do proper assertions for
32
- // 'nReturned', 'totalKeysExamined' and 'totalDocsExamined'.
33
- await keystores.insert({config: mockConfigBeta});
34
- });
35
- it(`is properly indexed for 'config.controller' in find()`, async () => {
36
- // finds all records that match the 'config.controller' query since it is
37
- // a non unique index.
38
- const {executionStats} = await keystores.find({
39
- controller: mockConfigAlpha.controller,
40
- query: {},
41
- explain: true
42
- });
43
- executionStats.nReturned.should.equal(2);
44
- executionStats.totalKeysExamined.should.equal(2);
45
- executionStats.totalDocsExamined.should.equal(2);
46
- executionStats.executionStages.inputStage.stage.should.equal('IXSCAN');
47
- executionStats.executionStages.inputStage.keyPattern
48
- .should.eql({'config.controller': 1});
49
- });
50
- it(`is properly indexed for 'config.id' in update()`, async () => {
51
- mockConfigAlpha.sequence += 1;
52
- const {executionStats} = await keystores.update({
53
- config: mockConfigAlpha,
54
- explain: true
55
- });
56
- executionStats.nReturned.should.equal(1);
57
- executionStats.totalKeysExamined.should.equal(1);
58
- executionStats.totalDocsExamined.should.equal(1);
59
- executionStats.executionStages.inputStage.inputStage.stage
60
- .should.equal('IXSCAN');
61
- executionStats.executionStages.inputStage.inputStage.keyPattern
62
- .should.eql({'config.id': 1});
63
- });
64
- it(`is properly indexed for 'config.meterId' in getStorageUsage()`,
65
- async () => {
66
- // finds all records that match the 'config.meter' query since it is
67
- // a non unique index.
68
- const {executionStats} = await keystores.getStorageUsage({
69
- meterId: mockConfigAlpha.meterId,
70
- explain: true
71
- });
72
- executionStats.nReturned.should.equal(2);
73
- executionStats.totalKeysExamined.should.equal(2);
74
- executionStats.totalDocsExamined.should.equal(2);
75
- executionStats.executionStages.inputStage.inputStage.stage
76
- .should.equal('IXSCAN');
77
- executionStats.executionStages.inputStage.inputStage.keyPattern
78
- .should.eql({'config.meterId': 1});
79
- });
80
- it(`is properly indexed for 'config.id' in _getUncachedRecord()`,
81
- async () => {
82
- const {executionStats} = await keystores._getUncachedRecord({
83
- id: mockConfigAlpha.id,
84
- explain: true
85
- });
86
- executionStats.nReturned.should.equal(1);
87
- executionStats.totalKeysExamined.should.equal(1);
88
- executionStats.totalDocsExamined.should.equal(1);
89
- executionStats.executionStages.inputStage.inputStage.inputStage.stage
90
- .should.equal('IXSCAN');
91
- executionStats.executionStages.inputStage.inputStage.inputStage
92
- .keyPattern.should.eql({'config.id': 1});
93
- });
94
- });
95
- });
@@ -1,40 +0,0 @@
1
- /*!
2
- * Copyright (c) 2021-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import {defaultDocumentLoader as documentLoader} from '@bedrock/kms';
5
-
6
- describe('defaultDocumentLoader', () => {
7
- it('returns a did document from the document loader', async () => {
8
- const url = 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH';
9
-
10
- let err;
11
- let result;
12
- try {
13
- result = await documentLoader(url);
14
- } catch(e) {
15
- err = e;
16
- }
17
-
18
- should.exist(result);
19
- should.not.exist(err);
20
- result.should.have.keys(['contextUrl', 'documentUrl', 'document']);
21
- result.documentUrl.should.equal(url);
22
- });
23
-
24
- it('throws NotFoundError on document not found', async () => {
25
- const url = 'https://example.com/foo.jsonld';
26
-
27
- let err;
28
- let result;
29
- try {
30
- result = await documentLoader(url);
31
- } catch(e) {
32
- err = e;
33
- }
34
-
35
- should.not.exist(result);
36
- should.exist(err);
37
- err.should.be.instanceOf(Error);
38
- err.message.should.contain(url);
39
- });
40
- });
@@ -1,22 +0,0 @@
1
- /*!
2
- * Copyright (c) 2021-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import {createRequire} from 'node:module';
5
- const require = createRequire(import.meta.url);
6
- const {CryptoLD} = require('crypto-ld');
7
- const {Ed25519VerificationKey2018} =
8
- require('@digitalbazaar/ed25519-verification-key-2018');
9
- const {Ed25519VerificationKey2020} =
10
- require('@digitalbazaar/ed25519-verification-key-2020');
11
- const {X25519KeyAgreementKey2019} =
12
- require('@digitalbazaar/x25519-key-agreement-key-2019');
13
- const {X25519KeyAgreementKey2020} =
14
- require('@digitalbazaar/x25519-key-agreement-key-2020');
15
-
16
- const cryptoLd = new CryptoLD();
17
- cryptoLd.use(Ed25519VerificationKey2018);
18
- cryptoLd.use(Ed25519VerificationKey2020);
19
- cryptoLd.use(X25519KeyAgreementKey2019);
20
- cryptoLd.use(X25519KeyAgreementKey2020);
21
-
22
- export {cryptoLd};
@@ -1,44 +0,0 @@
1
- /*!
2
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import * as brKms from '@bedrock/kms';
5
- import * as database from '@bedrock/mongodb';
6
- import {createRequire} from 'node:module';
7
- import {klona} from 'klona';
8
- const require = createRequire(import.meta.url);
9
- const {runOperation} = require('@digitalbazaar/webkms-switch');
10
- const {generateId} = require('bnid');
11
-
12
- export async function generateKey({mockData, type}) {
13
- // create a keystore
14
- const mockKeystoreId = `https://example.com/keystore/${await generateId()}`;
15
- const keystore = {
16
- id: mockKeystoreId,
17
- controller: 'urn:foo',
18
- kmsModule: 'ssm-v1',
19
- sequence: 0,
20
- };
21
- await brKms.keystores.insert({config: keystore});
22
-
23
- const keyId = `${mockKeystoreId}/keys/${await generateId()}`;
24
- const operation = klona(mockData.operations.generate({type}));
25
- operation.invocationTarget.id = keyId;
26
- operation.invocationTarget.type = type;
27
- const moduleManager = brKms.defaultModuleManager;
28
- const {result} = await runOperation({operation, keystore, moduleManager});
29
- return {
30
- keystore,
31
- key: result.keyDescription
32
- };
33
- }
34
-
35
- export async function prepareDatabase() {
36
- await removeCollections();
37
- }
38
-
39
- export async function removeCollections(collectionNames = ['kms-keystore']) {
40
- await database.openCollections(collectionNames);
41
- for(const collectionName of collectionNames) {
42
- await database.collections[collectionName].deleteMany({});
43
- }
44
- }
@@ -1,62 +0,0 @@
1
- /*!
2
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import * as webkmsContext from '@digitalbazaar/webkms-context';
5
- import * as aesContext from 'aes-key-wrapping-2019-context';
6
- import * as hmacContext from 'sha256-hmac-key-2019-context';
7
- import {cryptoLd} from './cryptoLd.js';
8
-
9
- const {CONTEXT_URL: WEBKMS_CONTEXT_URL} = webkmsContext;
10
- const {CONTEXT_URL: AES_2019_CONTEXT_URL} = aesContext;
11
- const {CONTEXT_URL: HMAC_2019_CONTEXT_URL} = hmacContext;
12
-
13
- export const mockData = {};
14
- const operations = mockData.operations = {};
15
-
16
- const symmetric = new Map([
17
- ['AesKeyWrappingKey2019', AES_2019_CONTEXT_URL],
18
- ['Sha256HmacKey2019', HMAC_2019_CONTEXT_URL]
19
- ]);
20
-
21
- operations.generate = ({type}) => {
22
- let suiteContextUrl = symmetric.get(type);
23
- if(!suiteContextUrl) {
24
- ({SUITE_CONTEXT: suiteContextUrl} = cryptoLd.suites.get(type) || {});
25
- if(!suiteContextUrl) {
26
- throw new Error(`Unknown key type: "${type}".`);
27
- }
28
- }
29
-
30
- return {
31
- '@context': [WEBKMS_CONTEXT_URL, suiteContextUrl],
32
- type: 'GenerateKeyOperation',
33
- invocationTarget: {
34
- id: '',
35
- type: '',
36
- controller: 'https://example.com/bar'
37
- },
38
- proof: {
39
- verificationMethod: 'https://example.com/bar'
40
- }
41
- };
42
- };
43
-
44
- operations.sign = {
45
- '@context': WEBKMS_CONTEXT_URL,
46
- type: 'SignOperation',
47
- invocationTarget: '',
48
- verifyData: '',
49
- proof: {
50
- verificationMethod: 'https://example.com/bar'
51
- }
52
- };
53
-
54
- operations.verify = {
55
- '@context': WEBKMS_CONTEXT_URL,
56
- type: 'VerifyOperation',
57
- invocationTarget: '',
58
- verifyData: '',
59
- proof: {
60
- verificationMethod: 'https://example.com/bar'
61
- }
62
- };
package/test/package.json DELETED
@@ -1,51 +0,0 @@
1
- {
2
- "name": "bedrock-kms-test",
3
- "version": "0.0.1-0",
4
- "type": "module",
5
- "description": "Bedrock KMS test",
6
- "private": true,
7
- "scripts": {
8
- "test": "node --preserve-symlinks test.js test",
9
- "coverage": "cross-env NODE_ENV=test c8 --reporter=lcov --reporter=text-summary npm test",
10
- "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly npm test",
11
- "coverage-report": "c8 report"
12
- },
13
- "dependencies": {
14
- "@bedrock/core": "^6.0.0",
15
- "@bedrock/did-context": "^4.0.0",
16
- "@bedrock/did-io": "^8.0.0",
17
- "@bedrock/https-agent": "^4.0.0",
18
- "@bedrock/jsonld-document-loader": "^3.0.0",
19
- "@bedrock/kms": "file:..",
20
- "@bedrock/ledger-context": "^23.0.0",
21
- "@bedrock/mongodb": "^10.0.0",
22
- "@bedrock/package-manager": "^3.0.0",
23
- "@bedrock/security-context": "^7.0.0",
24
- "@bedrock/ssm-mongodb": "^9.0.0",
25
- "@bedrock/test": "^8.0.0",
26
- "@bedrock/veres-one-context": "^14.0.0",
27
- "@digitalbazaar/ed25519-verification-key-2018": "^3.1.1",
28
- "@digitalbazaar/ed25519-verification-key-2020": "^3.1.0",
29
- "@digitalbazaar/webkms-context": "^2.0.0",
30
- "@digitalbazaar/webkms-switch": "^9.0.3",
31
- "@digitalbazaar/x25519-key-agreement-key-2019": "^5.1.1",
32
- "@digitalbazaar/x25519-key-agreement-key-2020": "^2.0.0",
33
- "aes-key-wrapping-2019-context": "^1.0.3",
34
- "bnid": "^2.0.0",
35
- "c8": "^7.11.0",
36
- "cross-env": "^7.0.3",
37
- "crypto-ld": "^6.0.0",
38
- "klona": "^2.0.5",
39
- "sha256-hmac-key-2019-context": "^1.0.3",
40
- "uuid": "^8.3.2"
41
- },
42
- "c8": {
43
- "excludeNodeModules": false,
44
- "include": [
45
- "node_modules/@bedrock/kms/**"
46
- ],
47
- "exclude": [
48
- "node_modules/@bedrock/kms/node_modules/**"
49
- ]
50
- }
51
- }
@@ -1,17 +0,0 @@
1
- /*!
2
- * Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
3
- */
4
- import {config} from '@bedrock/core';
5
- import {fileURLToPath} from 'node:url';
6
- import path from 'node:path';
7
- import '@bedrock/mongodb';
8
-
9
- const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
-
11
- config.mocha.tests.push(path.join(__dirname, 'mocha'));
12
-
13
- // MongoDB
14
- config.mongodb.name = 'bedrock_kms_test';
15
- config.mongodb.dropCollections = {};
16
- config.mongodb.dropCollections.onInit = true;
17
- config.mongodb.dropCollections.collections = [];