@bedrock/kms-http 20.0.0 → 20.1.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/lib/middleware.js CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as bedrock from '@bedrock/core';
5
5
  import * as brZCapStorage from '@bedrock/zcap-storage';
6
+ import * as Ed25519Multikey from '@digitalbazaar/ed25519-multikey';
6
7
  import * as helpers from './helpers.js';
7
8
  import {
8
9
  authorizeZcapInvocation as _authorizeZcapInvocation,
@@ -12,12 +13,8 @@ import {default as _cors} from 'cors';
12
13
  import {asyncHandler} from '@bedrock/express';
13
14
  import {BedrockKeystoreConfigStorage} from './BedrockKeystoreConfigStorage.js';
14
15
  import {createOperationMiddleware} from '@digitalbazaar/webkms-switch';
15
- import {CryptoLD} from 'crypto-ld';
16
16
  import {documentLoader} from './documentLoader.js';
17
17
  import {Ed25519Signature2020} from '@digitalbazaar/ed25519-signature-2020';
18
- import {
19
- Ed25519VerificationKey2020
20
- } from '@digitalbazaar/ed25519-verification-key-2020';
21
18
  import {logger} from './logger.js';
22
19
  import {defaultModuleManager as moduleManager} from '@bedrock/kms';
23
20
  import {reportOperationUsage} from './metering.js';
@@ -28,10 +25,6 @@ const FIVE_MINUTES = 1000 * 60 * 5;
28
25
 
29
26
  const storage = new BedrockKeystoreConfigStorage();
30
27
 
31
- // create `getVerifier` hook for verifying zcap invocation HTTP signatures
32
- const cryptoLd = new CryptoLD();
33
- cryptoLd.use(Ed25519VerificationKey2020);
34
-
35
28
  // creates middleware to get the keystore config for the current request and
36
29
  // caches it in `req.webkms.keystore`
37
30
  export function createGetKeystoreConfig({routes}) {
@@ -199,7 +192,8 @@ async function getKeystoreController({req}) {
199
192
 
200
193
  // hook used to verify zcap invocation HTTP signatures
201
194
  async function getVerifier({keyId, documentLoader}) {
202
- const key = await cryptoLd.fromKeyId({id: keyId, documentLoader});
195
+ const {document} = await documentLoader(keyId);
196
+ const key = await Ed25519Multikey.from(document);
203
197
  const verificationMethod = await key.export(
204
198
  {publicKey: true, includeContext: true});
205
199
  const verifier = key.verifier();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bedrock/kms-http",
3
- "version": "20.0.0",
3
+ "version": "20.1.0",
4
4
  "type": "module",
5
5
  "description": "Bedrock KMS HTTP API",
6
6
  "main": "./lib/index.js",
@@ -28,13 +28,12 @@
28
28
  },
29
29
  "homepage": "https://github.com/digitalbazaar/bedrock-kms-http",
30
30
  "dependencies": {
31
+ "@digitalbazaar/ed25519-multikey": "^1.1.0",
31
32
  "@digitalbazaar/ed25519-signature-2020": "^5.0.0",
32
- "@digitalbazaar/ed25519-verification-key-2020": "^4.0.0",
33
33
  "@digitalbazaar/ezcap-express": "^7.0.0",
34
34
  "@digitalbazaar/webkms-switch": "^12.0.0",
35
35
  "cidr-regex": "^4.0.0",
36
36
  "cors": "^2.8.5",
37
- "crypto-ld": "^7.0.0",
38
37
  "forwarded": "^0.2.0",
39
38
  "ipaddr.js": "^2.0.1"
40
39
  },