From 19a82298c381ddf61c9517ee2f50e5bb5190a8d8 Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Wed, 19 Apr 2023 15:08:49 +0200 Subject: [PATCH 01/11] feat(did-comm): initial support for A256KW key wrapping for didcomm --- packages/credential-status/package.json | 2 +- packages/credential-w3c/package.json | 2 +- packages/did-comm/package.json | 2 +- .../src/__tests__/trust-ping-interop.test.ts | 396 +++++++++--------- packages/did-comm/src/didcomm.ts | 55 ++- packages/did-comm/src/types/message-types.ts | 13 +- packages/did-jwt/package.json | 2 +- packages/kms-local/package.json | 2 +- packages/selective-disclosure/package.json | 2 +- packages/utils/package.json | 2 +- setupJest.js | 1 - 11 files changed, 259 insertions(+), 220 deletions(-) delete mode 100644 setupJest.js diff --git a/packages/credential-status/package.json b/packages/credential-status/package.json index 0fda9ecab..1609a3406 100644 --- a/packages/credential-status/package.json +++ b/packages/credential-status/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", "credential-status": "^2.0.5", - "did-jwt": "^6.9.0", + "did-jwt": "^7.0.0-alpha.5", "did-resolver": "^4.0.1" }, "devDependencies": { diff --git a/packages/credential-w3c/package.json b/packages/credential-w3c/package.json index 3d64939df..3d4e734a8 100644 --- a/packages/credential-w3c/package.json +++ b/packages/credential-w3c/package.json @@ -18,7 +18,7 @@ "@veramo/utils": "workspace:^", "canonicalize": "^2.0.0", "debug": "^4.3.3", - "did-jwt": "^6.11.0", + "did-jwt": "^7.0.0-alpha.5", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", "uint8arrays": "^4.0.3", diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index b604cffd5..6143a2aa0 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -25,7 +25,7 @@ "@veramo/utils": "workspace:^", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-jwt": "^6.9.0", + "did-jwt": "^7.0.0-alpha.5", "did-resolver": "^4.0.1", "uint8arrays": "^4.0.3", "uuid": "^9.0.0" diff --git a/packages/did-comm/src/__tests__/trust-ping-interop.test.ts b/packages/did-comm/src/__tests__/trust-ping-interop.test.ts index f25d93ea6..0d15ac5dc 100644 --- a/packages/did-comm/src/__tests__/trust-ping-interop.test.ts +++ b/packages/did-comm/src/__tests__/trust-ping-interop.test.ts @@ -1,11 +1,5 @@ import { DIDComm } from '../didcomm.js' -import { - IDIDManager, - IIdentifier, - IKeyManager, - IResolver, - TAgent, -} from '../../../core-types/src' +import { IDIDManager, IIdentifier, IKeyManager, IResolver, TAgent } from '../../../core-types/src' import { createAgent } from '../../../core/src' import { DIDManager, MemoryDIDStore } from '../../../did-manager/src' import { KeyManager, MemoryKeyStore, MemoryPrivateKeyStore } from '../../../key-manager/src' @@ -20,184 +14,179 @@ import { base64ToBytes, bytesToHex } from '@veramo/utils' import * as u8a from 'uint8arrays' const aliceDoc = { - "@context":[ - "https://www.w3.org/ns/did/v1", - "https://w3id.org/security/suites/jws-2020/v1" + '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/jws-2020/v1'], + id: 'did:example:alice', + authentication: [ + { + id: 'did:example:alice#key-1', + type: 'JsonWebKey2020', + controller: 'did:example:alice', + publicKeyJwk: { + kty: 'OKP', + crv: 'Ed25519', + x: 'G-boxFB6vOZBu-wXkm-9Lh79I8nf9Z50cILaOgKKGww', + }, + }, + { + id: 'did:example:alice#key-2', + type: 'JsonWebKey2020', + controller: 'did:example:alice', + publicKeyJwk: { + kty: 'EC', + crv: 'P-256', + x: '2syLh57B-dGpa0F8p1JrO6JU7UUSF6j7qL-vfk1eOoY', + y: 'BgsGtI7UPsObMRjdElxLOrgAO9JggNMjOcfzEPox18w', + }, + }, + { + id: 'did:example:alice#key-3', + type: 'JsonWebKey2020', + controller: 'did:example:alice', + publicKeyJwk: { + kty: 'EC', + crv: 'secp256k1', + x: 'aToW5EaTq5mlAf8C5ECYDSkqsJycrW-e1SQ6_GJcAOk', + y: 'JAGX94caA21WKreXwYUaOCYTBMrqaX4KWIlsQZTHWCk', + }, + }, ], - "id":"did:example:alice", - "authentication":[ - { - "id":"did:example:alice#key-1", - "type":"JsonWebKey2020", - "controller":"did:example:alice", - "publicKeyJwk":{ - "kty":"OKP", - "crv":"Ed25519", - "x":"G-boxFB6vOZBu-wXkm-9Lh79I8nf9Z50cILaOgKKGww" - } - }, - { - "id":"did:example:alice#key-2", - "type":"JsonWebKey2020", - "controller":"did:example:alice", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-256", - "x":"2syLh57B-dGpa0F8p1JrO6JU7UUSF6j7qL-vfk1eOoY", - "y":"BgsGtI7UPsObMRjdElxLOrgAO9JggNMjOcfzEPox18w" - } - }, - { - "id":"did:example:alice#key-3", - "type":"JsonWebKey2020", - "controller":"did:example:alice", - "publicKeyJwk":{ - "kty":"EC", - "crv":"secp256k1", - "x":"aToW5EaTq5mlAf8C5ECYDSkqsJycrW-e1SQ6_GJcAOk", - "y":"JAGX94caA21WKreXwYUaOCYTBMrqaX4KWIlsQZTHWCk" - } - } + keyAgreement: [ + { + id: 'did:example:alice#key-x25519-1', + type: 'JsonWebKey2020', + controller: 'did:example:alice', + publicKeyJwk: { + kty: 'OKP', + crv: 'X25519', + x: 'avH0O2Y4tqLAq8y9zpianr8ajii5m4F_mICrzNlatXs', + }, + }, + { + id: 'did:example:alice#key-p256-1', + type: 'JsonWebKey2020', + controller: 'did:example:alice', + publicKeyJwk: { + kty: 'EC', + crv: 'P-256', + x: 'L0crjMN1g0Ih4sYAJ_nGoHUck2cloltUpUVQDhF2nHE', + y: 'SxYgE7CmEJYi7IDhgK5jI4ZiajO8jPRZDldVhqFpYoo', + }, + }, + { + id: 'did:example:alice#key-p521-1', + type: 'JsonWebKey2020', + controller: 'did:example:alice', + publicKeyJwk: { + kty: 'EC', + crv: 'P-521', + x: 'AHBEVPRhAv-WHDEvxVM9S0px9WxxwHL641Pemgk9sDdxvli9VpKCBdra5gg_4kupBDhz__AlaBgKOC_15J2Byptz', + y: 'AciGcHJCD_yMikQvlmqpkBbVqqbg93mMVcgvXBYAQPP-u9AF7adybwZrNfHWCKAQwGF9ugd0Zhg7mLMEszIONFRk', + }, + }, ], - "keyAgreement":[ - { - "id":"did:example:alice#key-x25519-1", - "type":"JsonWebKey2020", - "controller":"did:example:alice", - "publicKeyJwk":{ - "kty":"OKP", - "crv":"X25519", - "x":"avH0O2Y4tqLAq8y9zpianr8ajii5m4F_mICrzNlatXs" - } - }, - { - "id":"did:example:alice#key-p256-1", - "type":"JsonWebKey2020", - "controller":"did:example:alice", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-256", - "x":"L0crjMN1g0Ih4sYAJ_nGoHUck2cloltUpUVQDhF2nHE", - "y":"SxYgE7CmEJYi7IDhgK5jI4ZiajO8jPRZDldVhqFpYoo" - } - }, - { - "id":"did:example:alice#key-p521-1", - "type":"JsonWebKey2020", - "controller":"did:example:alice", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-521", - "x":"AHBEVPRhAv-WHDEvxVM9S0px9WxxwHL641Pemgk9sDdxvli9VpKCBdra5gg_4kupBDhz__AlaBgKOC_15J2Byptz", - "y":"AciGcHJCD_yMikQvlmqpkBbVqqbg93mMVcgvXBYAQPP-u9AF7adybwZrNfHWCKAQwGF9ugd0Zhg7mLMEszIONFRk" - } - } - ] } const bobDoc = { - "@context":[ - "https://www.w3.org/ns/did/v2" + '@context': ['https://www.w3.org/ns/did/v2'], + id: 'did:example:bob', + keyAgreement: [ + { + id: 'did:example:bob#key-x25519-1', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'OKP', + crv: 'X25519', + x: 'GDTrI66K0pFfO54tlCSvfjjNapIs44dzpneBgyx0S3E', + }, + }, + { + id: 'did:example:bob#key-x25519-2', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'OKP', + crv: 'X25519', + x: 'UT9S3F5ep16KSNBBShU2wh3qSfqYjlasZimn0mB8_VM', + }, + }, + { + id: 'did:example:bob#key-x25519-3', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'OKP', + crv: 'X25519', + x: '82k2BTUiywKv49fKLZa-WwDi8RBf0tB0M8bvSAUQ3yY', + }, + }, + { + id: 'did:example:bob#key-p256-1', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'EC', + crv: 'P-256', + x: 'FQVaTOksf-XsCUrt4J1L2UGvtWaDwpboVlqbKBY2AIo', + y: '6XFB9PYo7dyC5ViJSO9uXNYkxTJWn0d_mqJ__ZYhcNY', + }, + }, + { + id: 'did:example:bob#key-p256-2', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'EC', + crv: 'P-256', + x: 'n0yBsGrwGZup9ywKhzD4KoORGicilzIUyfcXb1CSwe0', + y: 'ov0buZJ8GHzV128jmCw1CaFbajZoFFmiJDbMrceCXIw', + }, + }, + { + id: 'did:example:bob#key-p384-1', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'EC', + crv: 'P-384', + x: 'MvnE_OwKoTcJVfHyTX-DLSRhhNwlu5LNoQ5UWD9Jmgtdxp_kpjsMuTTBnxg5RF_Y', + y: 'X_3HJBcKFQEG35PZbEOBn8u9_z8V1F9V1Kv-Vh0aSzmH-y9aOuDJUE3D4Hvmi5l7', + }, + }, + { + id: 'did:example:bob#key-p384-2', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'EC', + crv: 'P-384', + x: '2x3HOTvR8e-Tu6U4UqMd1wUWsNXMD0RgIunZTMcZsS-zWOwDgsrhYVHmv3k_DjV3', + y: 'W9LLaBjlWYcXUxOf6ECSfcXKaC3-K9z4hCoP0PS87Q_4ExMgIwxVCXUEB6nf0GDd', + }, + }, + { + id: 'did:example:bob#key-p521-1', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'EC', + crv: 'P-521', + x: 'Af9O5THFENlqQbh2Ehipt1Yf4gAd9RCa3QzPktfcgUIFADMc4kAaYVViTaDOuvVS2vMS1KZe0D5kXedSXPQ3QbHi', + y: 'ATZVigRQ7UdGsQ9j-omyff6JIeeUv3CBWYsZ0l6x3C_SYqhqVV7dEG-TafCCNiIxs8qeUiXQ8cHWVclqkH4Lo1qH', + }, + }, + { + id: 'did:example:bob#key-p521-2', + type: 'JsonWebKey2020', + controller: 'did:example:bob', + publicKeyJwk: { + kty: 'EC', + crv: 'P-521', + x: 'ATp_WxCfIK_SriBoStmA0QrJc2pUR1djpen0VdpmogtnKxJbitiPq-HJXYXDKriXfVnkrl2i952MsIOMfD2j0Ots', + y: 'AEJipR0Dc-aBZYDqN51SKHYSWs9hM58SmRY1MxgXANgZrPaq1EeGMGOjkbLMEJtBThdjXhkS5VlXMkF0cYhZELiH', + }, + }, ], - "id":"did:example:bob", - "keyAgreement":[ - { - "id":"did:example:bob#key-x25519-1", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"OKP", - "crv":"X25519", - "x":"GDTrI66K0pFfO54tlCSvfjjNapIs44dzpneBgyx0S3E" - } - }, - { - "id":"did:example:bob#key-x25519-2", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"OKP", - "crv":"X25519", - "x":"UT9S3F5ep16KSNBBShU2wh3qSfqYjlasZimn0mB8_VM" - } - }, - { - "id":"did:example:bob#key-x25519-3", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"OKP", - "crv":"X25519", - "x":"82k2BTUiywKv49fKLZa-WwDi8RBf0tB0M8bvSAUQ3yY" - } - }, - { - "id":"did:example:bob#key-p256-1", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-256", - "x":"FQVaTOksf-XsCUrt4J1L2UGvtWaDwpboVlqbKBY2AIo", - "y":"6XFB9PYo7dyC5ViJSO9uXNYkxTJWn0d_mqJ__ZYhcNY" - } - }, - { - "id":"did:example:bob#key-p256-2", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-256", - "x":"n0yBsGrwGZup9ywKhzD4KoORGicilzIUyfcXb1CSwe0", - "y":"ov0buZJ8GHzV128jmCw1CaFbajZoFFmiJDbMrceCXIw" - } - }, - { - "id":"did:example:bob#key-p384-1", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-384", - "x":"MvnE_OwKoTcJVfHyTX-DLSRhhNwlu5LNoQ5UWD9Jmgtdxp_kpjsMuTTBnxg5RF_Y", - "y":"X_3HJBcKFQEG35PZbEOBn8u9_z8V1F9V1Kv-Vh0aSzmH-y9aOuDJUE3D4Hvmi5l7" - } - }, - { - "id":"did:example:bob#key-p384-2", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-384", - "x":"2x3HOTvR8e-Tu6U4UqMd1wUWsNXMD0RgIunZTMcZsS-zWOwDgsrhYVHmv3k_DjV3", - "y":"W9LLaBjlWYcXUxOf6ECSfcXKaC3-K9z4hCoP0PS87Q_4ExMgIwxVCXUEB6nf0GDd" - } - }, - { - "id":"did:example:bob#key-p521-1", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-521", - "x":"Af9O5THFENlqQbh2Ehipt1Yf4gAd9RCa3QzPktfcgUIFADMc4kAaYVViTaDOuvVS2vMS1KZe0D5kXedSXPQ3QbHi", - "y":"ATZVigRQ7UdGsQ9j-omyff6JIeeUv3CBWYsZ0l6x3C_SYqhqVV7dEG-TafCCNiIxs8qeUiXQ8cHWVclqkH4Lo1qH" - } - }, - { - "id":"did:example:bob#key-p521-2", - "type":"JsonWebKey2020", - "controller":"did:example:bob", - "publicKeyJwk":{ - "kty":"EC", - "crv":"P-521", - "x":"ATp_WxCfIK_SriBoStmA0QrJc2pUR1djpen0VdpmogtnKxJbitiPq-HJXYXDKriXfVnkrl2i952MsIOMfD2j0Ots", - "y":"AEJipR0Dc-aBZYDqN51SKHYSWs9hM58SmRY1MxgXANgZrPaq1EeGMGOjkbLMEJtBThdjXhkS5VlXMkF0cYhZELiH" - } - } - ] } const trustPingMessage = { @@ -206,11 +195,10 @@ const trustPingMessage = { to: 'did:example:bob', id: 'trust-ping-test', body: { - responseRequested: true - } + responseRequested: true, + }, } - describe('trust-ping-interop', () => { let sender: IIdentifier let recipient: IIdentifier @@ -234,30 +222,29 @@ describe('trust-ping-interop', () => { }), new DIDResolverPlugin({ resolver: new Resolver({ - 'example': async (did: string) => { + example: async (did: string) => { let doc: DIDDocument - if (did === "did:example:alice") { + if (did === 'did:example:alice') { doc = aliceDoc - } else if (did === "did:example:bob") { + } else if (did === 'did:example:bob') { doc = bobDoc } else { - throw new Error("Bad didUrl for fake resolver: " + did) + throw new Error('Bad didUrl for fake resolver: ' + did) } // DIDResolutionResult return { didResolutionMetadata: {}, didDocument: doc, - didDocumentMetadata: {} + didDocumentMetadata: {}, } - } - }) + }, + }), }), - new DIDComm() + new DIDComm(), ], }) - // https://identity.foundation/didcomm-messaging/spec/#a1-sender-secrets const senderSecretEd25519X = 'G-boxFB6vOZBu-wXkm-9Lh79I8nf9Z50cILaOgKKGww' const senderSecretEd25519D = 'pFRUKkyzx4kHdJtFSnlPA9WzqkDT1HWV0xZ5OYZd2SY' @@ -279,16 +266,16 @@ describe('trust-ping-interop', () => { // https://github.com/StableLib/stablelib/blob/a89a438fcbf855de6b2e9faa2630f03c3f3b3a54/packages/ed25519/ed25519.ts#L669 // https://crypto.stackexchange.com/a/54367 // https://github.com/libp2p/specs/blob/master/peer-ids/peer-ids.md#ed25519 - privateKeyHex: - bytesToHex(u8a.concat([base64ToBytes(senderSecretEd25519D), base64ToBytes(senderSecretEd25519X)])), + privateKeyHex: bytesToHex( + u8a.concat([base64ToBytes(senderSecretEd25519D), base64ToBytes(senderSecretEd25519X)]), + ), kms: 'local', }, { type: 'X25519', kid: 'did:example:alice#key-x25519-1', publicKeyHex: bytesToHex(base64ToBytes(senderSecretX25519X)), - privateKeyHex: - bytesToHex(base64ToBytes(senderSecretX25519D)), + privateKeyHex: bytesToHex(base64ToBytes(senderSecretX25519D)), kms: 'local', }, ], @@ -303,24 +290,21 @@ describe('trust-ping-interop', () => { type: 'X25519', kid: 'did:example:bob#key-x25519-1', publicKeyHex: bytesToHex(base64ToBytes('GDTrI66K0pFfO54tlCSvfjjNapIs44dzpneBgyx0S3E')), - privateKeyHex: - bytesToHex(base64ToBytes('b9NnuOCB0hm7YGNvaE9DMhwH_wjZA1-gWD6dA0JWdL0')), + privateKeyHex: bytesToHex(base64ToBytes('b9NnuOCB0hm7YGNvaE9DMhwH_wjZA1-gWD6dA0JWdL0')), kms: 'local', }, { type: 'X25519', kid: 'did:example:bob#key-x25519-2', publicKeyHex: bytesToHex(base64ToBytes('UT9S3F5ep16KSNBBShU2wh3qSfqYjlasZimn0mB8_VM')), - privateKeyHex: - bytesToHex(base64ToBytes('p-vteoF1gopny1HXywt76xz_uC83UUmrgszsI-ThBKk')), + privateKeyHex: bytesToHex(base64ToBytes('p-vteoF1gopny1HXywt76xz_uC83UUmrgszsI-ThBKk')), kms: 'local', }, { type: 'X25519', kid: 'did:example:bob#key-x25519-3', publicKeyHex: bytesToHex(base64ToBytes('82k2BTUiywKv49fKLZa-WwDi8RBf0tB0M8bvSAUQ3yY')), - privateKeyHex: - bytesToHex(base64ToBytes('f9WJeuQXEItkGM8shN4dqFr5fLQLBasHnWZ-8dPaSo0')), + privateKeyHex: bytesToHex(base64ToBytes('f9WJeuQXEItkGM8shN4dqFr5fLQLBasHnWZ-8dPaSo0')), kms: 'local', }, ], @@ -337,20 +321,22 @@ describe('trust-ping-interop', () => { it('should unpack encrypted message from test vector', async () => { const unpackedMessage = await agent.unpackDIDCommMessage({ - message: '{"protected":"eyJ0eXAiOiJhcHBsaWNhdGlvbi9kaWRjb21tLWVuY3J5cHRlZCtqc29uIiwic2tpZCI6ImRpZDpleGFtcGxlOmFsaWNlI2tleS14MjU1MTktMSIsImVuYyI6IlhDMjBQIn0","iv":"VfXAqOwRdCqkCOXtCZmM7xRY6b2cTT5K","ciphertext":"_urtE_Pqw8rGEVkR4iKZiR9qs7U7CCiY5T5sujlSwJnI9V6l4MqXAkfQ_EmSS0bKqrpvB1kXT0vgQQUEfwUeqkXBGiNqd-lBopM1zbaUFIr8x7AobjiVlhDkoA0KVQqICuTUhmt3po5h3wTfNZtB1wiQPF3cYeXg9y6sUVAQ7DyAJdItFcYKiboB3b15nIIP1ld6Bb9r50KD3Gm_DQ","tag":"oq6URRWgtmXePhwQXLeZow","recipients":[{"encrypted_key":"iI92IB_c6z-z9OKbK6GMS54uPJrGefJ9BY5papAvc00","header":{"alg":"ECDH-1PU+XC20PKW","iv":"04K4bQO4q0-x3oiSwvx1vjfIo7DEggyl","tag":"q5DzsirJ4Qrnqr0zosx-sg","epk":{"kty":"OKP","crv":"X25519","x":"KqNpwX_5bvCFMpMwB-ww1z8mJB7jq8Sy1jSbQPHqHxA"},"kid":"did:example:bob#key-x25519-1"}},{"encrypted_key":"Z8mGUR1Q-UIOts1LxIhZNIzbcyp5vj_8ZTWuJ6CxWJE","header":{"alg":"ECDH-1PU+XC20PKW","iv":"g1LwvctMeKDtEcJKQGepuevJnho9WdnX","tag":"up_m3F6B-8RAWvlNEhD4Cg","epk":{"kty":"OKP","crv":"X25519","x":"11cPGXIykWfZBVyCIcn7CisnxXgIS988MtHYD9d3HlM"},"kid":"did:example:bob#key-x25519-2"}},{"encrypted_key":"CsnDZ8TEfeIa5Tu7XqYdxx3r5SnzQDssvhTcmkvzA8g","header":{"alg":"ECDH-1PU+XC20PKW","iv":"-2i2CV7T5ylzk7TLK81lKO1xlvRefIMW","tag":"RtaehpY4C6HxXSuy-PSd6w","epk":{"kty":"OKP","crv":"X25519","x":"nH9Pdu9RCm8znYmhCtGp9hPR_VuS6kcf5zJndTYBVzI"},"kid":"did:example:bob#key-x25519-3"}}]}' + message: + '{"protected":"eyJ0eXAiOiJhcHBsaWNhdGlvbi9kaWRjb21tLWVuY3J5cHRlZCtqc29uIiwic2tpZCI6ImRpZDpleGFtcGxlOmFsaWNlI2tleS14MjU1MTktMSIsImVuYyI6IlhDMjBQIn0","iv":"VfXAqOwRdCqkCOXtCZmM7xRY6b2cTT5K","ciphertext":"_urtE_Pqw8rGEVkR4iKZiR9qs7U7CCiY5T5sujlSwJnI9V6l4MqXAkfQ_EmSS0bKqrpvB1kXT0vgQQUEfwUeqkXBGiNqd-lBopM1zbaUFIr8x7AobjiVlhDkoA0KVQqICuTUhmt3po5h3wTfNZtB1wiQPF3cYeXg9y6sUVAQ7DyAJdItFcYKiboB3b15nIIP1ld6Bb9r50KD3Gm_DQ","tag":"oq6URRWgtmXePhwQXLeZow","recipients":[{"encrypted_key":"iI92IB_c6z-z9OKbK6GMS54uPJrGefJ9BY5papAvc00","header":{"alg":"ECDH-1PU+XC20PKW","iv":"04K4bQO4q0-x3oiSwvx1vjfIo7DEggyl","tag":"q5DzsirJ4Qrnqr0zosx-sg","epk":{"kty":"OKP","crv":"X25519","x":"KqNpwX_5bvCFMpMwB-ww1z8mJB7jq8Sy1jSbQPHqHxA"},"kid":"did:example:bob#key-x25519-1"}},{"encrypted_key":"Z8mGUR1Q-UIOts1LxIhZNIzbcyp5vj_8ZTWuJ6CxWJE","header":{"alg":"ECDH-1PU+XC20PKW","iv":"g1LwvctMeKDtEcJKQGepuevJnho9WdnX","tag":"up_m3F6B-8RAWvlNEhD4Cg","epk":{"kty":"OKP","crv":"X25519","x":"11cPGXIykWfZBVyCIcn7CisnxXgIS988MtHYD9d3HlM"},"kid":"did:example:bob#key-x25519-2"}},{"encrypted_key":"CsnDZ8TEfeIa5Tu7XqYdxx3r5SnzQDssvhTcmkvzA8g","header":{"alg":"ECDH-1PU+XC20PKW","iv":"-2i2CV7T5ylzk7TLK81lKO1xlvRefIMW","tag":"RtaehpY4C6HxXSuy-PSd6w","epk":{"kty":"OKP","crv":"X25519","x":"nH9Pdu9RCm8znYmhCtGp9hPR_VuS6kcf5zJndTYBVzI"},"kid":"did:example:bob#key-x25519-3"}}]}', }) expect(unpackedMessage.message.id).toEqual(trustPingMessage.id) }) it('should pack and unpack trust ping message with anoncrypt packing', async () => { - const packedMessage = await agent.packDIDCommMessage({ message: trustPingMessage, packing: 'authcrypt' }) + const packedMessage = await agent.packDIDCommMessage({ message: trustPingMessage, packing: 'anoncrypt' }) const unpackedMessage = await agent.unpackDIDCommMessage(packedMessage) expect(unpackedMessage.message.id).toEqual(trustPingMessage.id) }) - + it('should unpack encrypted message from test vector', async () => { const unpackedMessage = await agent.unpackDIDCommMessage({ - message: '{"protected":"eyJ0eXAiOiJhcHBsaWNhdGlvbi9kaWRjb21tLWVuY3J5cHRlZCtqc29uIiwic2tpZCI6ImRpZDpleGFtcGxlOmFsaWNlI2tleS14MjU1MTktMSIsImVuYyI6IlhDMjBQIn0","iv":"8e7Q16uLi4YL7VCEw2E2B9vlC9O7IVn4","ciphertext":"aE0DnTMiiPVxo0WaUNqma4qXnTzPojXnJOkv2vvJ36hoXc5gf5kyCXV8JGVmuR0ib62bZt8RhZCzt-2dmyJc9qot2oz7VesSfrxNOFb1-LB4Tfp2d1KVi96wCeQ_Ca5gr5RPRiQIBuoHHQsuZ2P1_9o49txTlt1AlCS4GwY4QCTnLVNyQTfDweQLwp-OJTMlDoKKgHzBljfovHv4yQ","tag":"ZeItOIGZS3-NvGMbDDKu3w","recipients":[{"encrypted_key":"wDMR_DerdPHrua7edijfseiVsTXKkHXou-U3y_XH2VE","header":{"alg":"ECDH-1PU+XC20PKW","iv":"K8twVbKqWnmISiiwnrCK8308vy0g0By9","tag":"fcgKH3VwAjpSnz-T0UP4bw","epk":{"kty":"OKP","crv":"X25519","x":"zN8qTfSPmxA_OwTnK-JOmVrpwvPTlhFuOXm9qlFsozc"},"kid":"did:example:bob#key-x25519-1"}},{"encrypted_key":"eEJ62Naux0w2xUz-5u2aA-Bt4mcxyeZDOUJS16PxUj8","header":{"alg":"ECDH-1PU+XC20PKW","iv":"uvkmZEbeJ-ThAYTcZHIdSW1O4diVWgTM","tag":"PKxx4DWaPAzWBW_pizYckw","epk":{"kty":"OKP","crv":"X25519","x":"90TtJUXASLgYRUctFByDBUNULqsB47W0-QisRdiDOhg"},"kid":"did:example:bob#key-x25519-2"}},{"encrypted_key":"GEYY8xb9e07x7mmJGrPAJssoZayTBUgDrF9RO2FWHEE","header":{"alg":"ECDH-1PU+XC20PKW","iv":"rp9Oi7vEkD0gJjPe3LMU_IR1Yq5_2umv","tag":"zvFBqklSbyRP4Lsp_eyQEg","epk":{"kty":"OKP","crv":"X25519","x":"R9AkOBdF4nN489pQgqI_NstsdrSpnNsGGEgjgNhdeE8"},"kid":"did:example:bob#key-x25519-3"}}]}' + message: + '{"protected":"eyJ0eXAiOiJhcHBsaWNhdGlvbi9kaWRjb21tLWVuY3J5cHRlZCtqc29uIiwic2tpZCI6ImRpZDpleGFtcGxlOmFsaWNlI2tleS14MjU1MTktMSIsImVuYyI6IlhDMjBQIn0","iv":"8e7Q16uLi4YL7VCEw2E2B9vlC9O7IVn4","ciphertext":"aE0DnTMiiPVxo0WaUNqma4qXnTzPojXnJOkv2vvJ36hoXc5gf5kyCXV8JGVmuR0ib62bZt8RhZCzt-2dmyJc9qot2oz7VesSfrxNOFb1-LB4Tfp2d1KVi96wCeQ_Ca5gr5RPRiQIBuoHHQsuZ2P1_9o49txTlt1AlCS4GwY4QCTnLVNyQTfDweQLwp-OJTMlDoKKgHzBljfovHv4yQ","tag":"ZeItOIGZS3-NvGMbDDKu3w","recipients":[{"encrypted_key":"wDMR_DerdPHrua7edijfseiVsTXKkHXou-U3y_XH2VE","header":{"alg":"ECDH-1PU+XC20PKW","iv":"K8twVbKqWnmISiiwnrCK8308vy0g0By9","tag":"fcgKH3VwAjpSnz-T0UP4bw","epk":{"kty":"OKP","crv":"X25519","x":"zN8qTfSPmxA_OwTnK-JOmVrpwvPTlhFuOXm9qlFsozc"},"kid":"did:example:bob#key-x25519-1"}},{"encrypted_key":"eEJ62Naux0w2xUz-5u2aA-Bt4mcxyeZDOUJS16PxUj8","header":{"alg":"ECDH-1PU+XC20PKW","iv":"uvkmZEbeJ-ThAYTcZHIdSW1O4diVWgTM","tag":"PKxx4DWaPAzWBW_pizYckw","epk":{"kty":"OKP","crv":"X25519","x":"90TtJUXASLgYRUctFByDBUNULqsB47W0-QisRdiDOhg"},"kid":"did:example:bob#key-x25519-2"}},{"encrypted_key":"GEYY8xb9e07x7mmJGrPAJssoZayTBUgDrF9RO2FWHEE","header":{"alg":"ECDH-1PU+XC20PKW","iv":"rp9Oi7vEkD0gJjPe3LMU_IR1Yq5_2umv","tag":"zvFBqklSbyRP4Lsp_eyQEg","epk":{"kty":"OKP","crv":"X25519","x":"R9AkOBdF4nN489pQgqI_NstsdrSpnNsGGEgjgNhdeE8"},"kid":"did:example:bob#key-x25519-3"}}]}', }) expect(unpackedMessage.message.id).toEqual(trustPingMessage.id) }) diff --git a/packages/did-comm/src/didcomm.ts b/packages/did-comm/src/didcomm.ts index 9c4b7edb7..7530c65a4 100644 --- a/packages/did-comm/src/didcomm.ts +++ b/packages/did-comm/src/didcomm.ts @@ -20,6 +20,10 @@ import { createAuthEncrypter, Encrypter, verifyJWS, + xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, + xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, + xc20pAnonDecrypterX25519WithA256KW, + xc20pAnonEncrypterX25519WithA256KW, } from 'did-jwt' import { DIDDocument, parse as parseDidUrl, ServiceEndpoint, VerificationMethod, Service } from 'did-resolver' @@ -280,6 +284,13 @@ export class DIDComm implements IAgentPlugin { } } + const defaults = { + alg: args.packing === 'authcrypt' ? 'ECDH-1PU+A256KW' : 'ECDH-ES+A256KW', + enc: 'XC20P', // FIXME: 'A256CBC-HS512' would be required and 'A256GCM' recommended. 'XC20P' is only optional + } + + const options = {...defaults, ...args.options} + // 2: compute recipients interface IRecipient { kid: string @@ -325,10 +336,27 @@ export class DIDComm implements IAgentPlugin { // 3. create Encrypter for each recipient const encrypters: Encrypter[] = recipients .map((recipient) => { - if (args.packing === 'authcrypt') { - return createAuthEncrypter(recipient.publicKeyBytes, senderECDH, { kid: recipient.kid }) + if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { + if (options.alg?.endsWith('+XC20PKW')) { + return createAuthEncrypter(recipient.publicKeyBytes, senderECDH, { kid: recipient.kid }) + } else if (options?.alg?.endsWith('+A256KW')) { + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { + kid: recipient.kid, + }) + } else { + debug(`not_supported: could not create suitable authcrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`) + return null + } } else { - return createAnonEncrypter(recipient.publicKeyBytes, { kid: recipient.kid }) + if (options.alg?.endsWith('+XC20PKW')) { + return createAnonEncrypter(recipient.publicKeyBytes, { kid: recipient.kid }) + } else if (options?.alg?.endsWith('+A256KW')) { + return xc20pAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid ) + } else { + debug(`not_supported: could not create suitable anoncrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`) + return null + } } }) .filter(isDefined) @@ -341,7 +369,7 @@ export class DIDComm implements IAgentPlugin { // 4. createJWE const messageBytes = u8a.fromString(JSON.stringify(args.message), 'utf-8') - const jwe = await createJWE(messageBytes, encrypters, protectedHeader) + const jwe = await createJWE(messageBytes, encrypters, protectedHeader, undefined, true) const message = JSON.stringify(jwe) return { message } } @@ -422,6 +450,13 @@ export class DIDComm implements IAgentPlugin { // - match DIDs against locally managed DIDs let managedRecipients = await extractManagedRecipients(jwe, context) + // 1.5 distribute protected header to each recipient + const protectedHeader = decodeJoseBlob(jwe.protected) + managedRecipients = managedRecipients.map((mr) => { + mr.recipient.header = { ...protectedHeader, ...mr.recipient.header } + return mr + }) + // 2. get internal IKey instance for each recipient.kid // - resolve locally managed DIDs that match recipients // - filter to the keyAgreementKeys that match the recipient.kid @@ -440,11 +475,19 @@ export class DIDComm implements IAgentPlugin { const recipientECDH: ECDH = createEcdhWrapper(localKey.localKeyRef, context) // TODO: here's where more algorithms should be supported if (senderKeyBytes && localKey.recipient?.header?.alg?.includes('ECDH-1PU')) { - decrypter = createAuthDecrypter(recipientECDH, senderKeyBytes) packing = 'authcrypt' + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) + } else { + decrypter = createAuthDecrypter(recipientECDH, senderKeyBytes) + } } else { - decrypter = createAnonDecrypter(recipientECDH) packing = 'anoncrypt' + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = xc20pAnonDecrypterX25519WithA256KW(recipientECDH) + } else { + decrypter = createAnonDecrypter(recipientECDH) + } } // 4. decryptJWE(jwe, decrypter) try { diff --git a/packages/did-comm/src/types/message-types.ts b/packages/did-comm/src/types/message-types.ts index 7af35cdff..67ca7990c 100644 --- a/packages/did-comm/src/types/message-types.ts +++ b/packages/did-comm/src/types/message-types.ts @@ -35,6 +35,16 @@ export interface IDIDCommOptions { * Restrict to a set of kids for recipient */ recipientKids?: string[] + + /** + * Optional content encryption algorithm to use + */ + enc?: string + + /** + * Optional key wrapping algorithm to use + */ + alg?: string } /** @@ -62,7 +72,8 @@ export enum DIDCommMessageMediaType { /** * The possible types of message packing. * - * `authcrypt`, `anoncrypt`, `anoncrypt+authcrypt`, and `anoncrypt+jws` will produce `DIDCommMessageMediaType.ENCRYPTED` messages. + * `authcrypt`, `anoncrypt`, `anoncrypt+authcrypt`, and `anoncrypt+jws` will produce + * `DIDCommMessageMediaType.ENCRYPTED` messages. * * `jws` will produce `DIDCommMessageMediaType.SIGNED` messages. * diff --git a/packages/did-jwt/package.json b/packages/did-jwt/package.json index 200c25863..d5e498209 100644 --- a/packages/did-jwt/package.json +++ b/packages/did-jwt/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^6.9.0", + "did-jwt": "^7.0.0-alpha.5", "did-resolver": "^4.0.1" }, "devDependencies": { diff --git a/packages/kms-local/package.json b/packages/kms-local/package.json index f067425c7..e31833939 100644 --- a/packages/kms-local/package.json +++ b/packages/kms-local/package.json @@ -26,7 +26,7 @@ "@veramo/utils": "workspace:^", "base-58": "^0.0.1", "debug": "^4.3.3", - "did-jwt": "^6.9.0", + "did-jwt": "^7.0.0-alpha.5", "elliptic": "^6.5.4", "uint8arrays": "^4.0.3" }, diff --git a/packages/selective-disclosure/package.json b/packages/selective-disclosure/package.json index 4fa30c832..6cf108340 100644 --- a/packages/selective-disclosure/package.json +++ b/packages/selective-disclosure/package.json @@ -22,7 +22,7 @@ "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^6.9.0", + "did-jwt": "^7.0.0-alpha.5", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index 9307a4a2b..c8abae039 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -18,7 +18,7 @@ "credential-status": "^2.0.5", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-jwt": "^6.9.0", + "did-jwt": "^7.0.0-alpha.5", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", "elliptic": "^6.5.4", diff --git a/setupJest.js b/setupJest.js deleted file mode 100644 index 80f3c9c1d..000000000 --- a/setupJest.js +++ /dev/null @@ -1 +0,0 @@ -// require('jest-fetch-mock').enableMocks() From dcc120aa7016b160180e5ec59b8e364c8e9038eb Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Wed, 19 Apr 2023 16:20:32 +0200 Subject: [PATCH 02/11] chore(deps): bump dependencies and adapt --- __tests__/initial.migration.test.ts | 4 +- package.json | 2 + packages/did-comm/src/didcomm.ts | 47 +++++++++++++------ packages/did-comm/src/plugin.schema.json | 18 +++++++ packages/did-resolver/package.json | 4 +- .../jest-integration.config.cjs | 1 + packages/test-react-app/jest.config.ts | 31 ------------ packages/test-react-app/package.json | 4 +- packages/tsconfig.settings.json | 1 + 9 files changed, 61 insertions(+), 51 deletions(-) delete mode 100644 packages/test-react-app/jest.config.ts diff --git a/__tests__/initial.migration.test.ts b/__tests__/initial.migration.test.ts index bf3242ba3..38624b5a7 100644 --- a/__tests__/initial.migration.test.ts +++ b/__tests__/initial.migration.test.ts @@ -167,7 +167,7 @@ describe('database initial migration tests', () => { encoding: 'utf-8', }) expect(signedMessage).toEqual( - 'vzDocUViJh7ooOCZ-jBHKZddEsTa4yClHwhIL9SHJwjAv3bC6TZIcUnX36ZqNBWvLbnNAQvdtzqrVf3l0pv3QQ', + 'vzDocUViJh7ooOCZ-jBHKZddEsTa4yClHwhIL9SHJwg_QIk9Fsm3jrYoIFmVy-pPjPUP5aNq6QEUfGCm_ZpKAA', ) }) @@ -203,7 +203,7 @@ describe('database initial migration tests', () => { encoding: 'utf-8', }) expect(signedMessage).toEqual( - 'JDaZFSC4eWQdau4G9a8l8ml0rhwmzCY4oEDIr-cjWK2nVCOGZP94HV3EfbpO_X3bZKPITLg8FJgVVSyRRPcObQ', + 'JDaZFSC4eWQdau4G9a8l8ml0rhwmzCY4oEDIr-cjWK1Yq9x5mwCH4qI7gkWxAoIjVgsUmfcMi6OqfTH7iz8y1A', ) }) diff --git a/package.json b/package.json index 390797b9c..a1a1e5cff 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,8 @@ "@microsoft/api-extractor": "7.35.2", "@microsoft/api-extractor-model": "7.27.2", "@microsoft/tsdoc": "0.14.2", + "@noble/hashes": "1.3.0", + "@stablelib/ed25519": "1.0.3", "@transmute/credentials-context": "0.7.0-unstable.81", "@types/express": "4.17.17", "@types/fs-extra": "11.0.1", diff --git a/packages/did-comm/src/didcomm.ts b/packages/did-comm/src/didcomm.ts index 7530c65a4..2b58cd7ee 100644 --- a/packages/did-comm/src/didcomm.ts +++ b/packages/did-comm/src/didcomm.ts @@ -336,26 +336,45 @@ export class DIDComm implements IAgentPlugin { // 3. create Encrypter for each recipient const encrypters: Encrypter[] = recipients .map((recipient) => { - if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { - if (options.alg?.endsWith('+XC20PKW')) { - return createAuthEncrypter(recipient.publicKeyBytes, senderECDH, { kid: recipient.kid }) - } else if (options?.alg?.endsWith('+A256KW')) { + if (options.enc === 'A256GCM') { + if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { // FIXME: the didcomm spec actually links to ECDH-1PU(v4) - return xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { + return a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { kid: recipient.kid, }) } else { - debug(`not_supported: could not create suitable authcrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`) - return null + return a256gcmAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) } - } else { - if (options.alg?.endsWith('+XC20PKW')) { - return createAnonEncrypter(recipient.publicKeyBytes, { kid: recipient.kid }) - } else if (options?.alg?.endsWith('+A256KW')) { - return xc20pAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid ) + } else if (options.enc === 'XC20P') { + if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { + if (options.alg?.endsWith('+XC20PKW')) { + return xc20pAuthEncrypterEcdh1PuV3x25519WithXc20PkwV2( + recipient.publicKeyBytes, + senderECDH, + { kid: recipient.kid }, + ) + } else if (options?.alg?.endsWith('+A256KW')) { + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { + kid: recipient.kid, + }) + } else { + debug( + `not_supported: could not create suitable authcrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`, + ) + return null + } } else { - debug(`not_supported: could not create suitable anoncrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`) - return null + if (options.alg?.endsWith('+XC20PKW')) { + return x25519Encrypter(recipient.publicKeyBytes, recipient.kid) + } else if (options?.alg?.endsWith('+A256KW')) { + return xc20pAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) + } else { + debug( + `not_supported: could not create suitable anoncrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`, + ) + return null + } } } }) diff --git a/packages/did-comm/src/plugin.schema.json b/packages/did-comm/src/plugin.schema.json index 6cee64c18..bb5ca6d37 100644 --- a/packages/did-comm/src/plugin.schema.json +++ b/packages/did-comm/src/plugin.schema.json @@ -178,6 +178,24 @@ "type": "string" }, "description": "Restrict to a set of kids for recipient" + }, + "enc": { + "type": "string", + "enum": [ + "XC20P", + "A256GCM" + ], + "description": "Optional content encryption algorithm to use. Defaults to 'A256GCM'" + }, + "alg": { + "type": "string", + "enum": [ + "ECDH-ES+A256KW", + "ECDH-1PU+A256KW", + "ECDH-ES+XC20PKW", + "ECDH-1PU+XC20PKW" + ], + "description": "Optional key wrapping algorithm to use. Defaults to 'ECDH-ES+A256KW'" } }, "description": "Extra options when packing a DIDComm message." diff --git a/packages/did-resolver/package.json b/packages/did-resolver/package.json index 1ff7ebae3..6bbb3d847 100644 --- a/packages/did-resolver/package.json +++ b/packages/did-resolver/package.json @@ -18,9 +18,9 @@ }, "devDependencies": { "@types/debug": "4.1.8", - "ethr-did-resolver": "^8.0.0", + "ethr-did-resolver": "8.0.0", "typescript": "5.1.3", - "web-did-resolver": "^2.0.24" + "web-did-resolver": "2.0.24" }, "files": [ "build/**/*", diff --git a/packages/test-react-app/jest-integration.config.cjs b/packages/test-react-app/jest-integration.config.cjs index a57ac83a8..5a3a84c5d 100644 --- a/packages/test-react-app/jest-integration.config.cjs +++ b/packages/test-react-app/jest-integration.config.cjs @@ -15,6 +15,7 @@ const config = { transformIgnorePatterns: [], testTimeout: 30000, collectCoverage: false, + coverageProvider: 'v8', moduleNameMapper: { '^(\\.{1,2}/.*)\\.js$': '$1', }, diff --git a/packages/test-react-app/jest.config.ts b/packages/test-react-app/jest.config.ts deleted file mode 100644 index 6f8c43c14..000000000 --- a/packages/test-react-app/jest.config.ts +++ /dev/null @@ -1,31 +0,0 @@ -// module.exports = { -// preset: 'jest-puppeteer', -// rootDir: 'headless-tests', -// testRegex: './*\\.browser-test\\.(ts|tsx?)$', -// transform: {"\\.ts$": ['ts-jest']}, -// testTimeout: 3 * 60 * 1000, -// testRunner: 'jest-jasmine2', -// moduleNameMapper: { -// // jest 28 loads modules differently. See https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports -// '^uuid$': require.resolve('uuid'), -// } -// } - -import type { Config } from 'jest' -import { defaults } from 'jest-config' - -const config: Config = { - moduleFileExtensions: [...defaults.moduleFileExtensions, 'mts'], - preset: 'jest-puppeteer', - rootDir: 'headless-tests', - testRegex: './*\\.browser-test\\.(ts|tsx?)$', - transform: { '\\.ts$': 'ts-jest' }, - testTimeout: 3 * 60 * 1000, - // testRunner: 'jest-jasmine2', - moduleNameMapper: { - // jest 28 loads modules differently. See https://jestjs.io/docs/upgrading-to-jest28#packagejson-exports - '^uuid$': require.resolve('uuid'), - }, -} - -export default config diff --git a/packages/test-react-app/package.json b/packages/test-react-app/package.json index 08816cb03..03bcb3e3c 100644 --- a/packages/test-react-app/package.json +++ b/packages/test-react-app/package.json @@ -77,8 +77,8 @@ "@types/node": "20.3.0", "@types/react": "18.2.8", "@types/react-dom": "18.2.4", - "babel-jest": "^29.5.0", - "babel-preset-react-app": "^10.0.1", + "babel-jest": "29.5.0", + "babel-preset-react-app": "10.0.1", "cross-env": "7.0.3", "jest": "29.5.0", "jest-config": "29.5.0", diff --git a/packages/tsconfig.settings.json b/packages/tsconfig.settings.json index 01889fa52..003b5d245 100644 --- a/packages/tsconfig.settings.json +++ b/packages/tsconfig.settings.json @@ -16,6 +16,7 @@ "experimentalDecorators": true, "resolveJsonModule": true, "allowSyntheticDefaultImports": true, + "skipLibCheck": true, "types": [ "jest" ] From 336968f62adb8f47980f3aa63f76f2f206bbfc6d Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Wed, 19 Apr 2023 21:17:14 +0200 Subject: [PATCH 03/11] feat(did-comm): support A256GCM content encryption --- packages/credential-status/package.json | 2 +- packages/credential-w3c/package.json | 2 +- packages/did-comm/package.json | 2 +- packages/did-comm/src/didcomm.ts | 67 +++++++++++++------- packages/did-comm/src/types/message-types.ts | 8 +-- packages/did-jwt/package.json | 2 +- packages/kms-local/package.json | 2 +- packages/selective-disclosure/package.json | 2 +- packages/utils/package.json | 2 +- 9 files changed, 54 insertions(+), 35 deletions(-) diff --git a/packages/credential-status/package.json b/packages/credential-status/package.json index 1609a3406..7d6b0e819 100644 --- a/packages/credential-status/package.json +++ b/packages/credential-status/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", "credential-status": "^2.0.5", - "did-jwt": "^7.0.0-alpha.5", + "did-jwt": "^7.1.0-alpha.1", "did-resolver": "^4.0.1" }, "devDependencies": { diff --git a/packages/credential-w3c/package.json b/packages/credential-w3c/package.json index 3d4e734a8..84f449995 100644 --- a/packages/credential-w3c/package.json +++ b/packages/credential-w3c/package.json @@ -18,7 +18,7 @@ "@veramo/utils": "workspace:^", "canonicalize": "^2.0.0", "debug": "^4.3.3", - "did-jwt": "^7.0.0-alpha.5", + "did-jwt": "^7.1.0-alpha.1", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", "uint8arrays": "^4.0.3", diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index 6143a2aa0..69f9fe41d 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -25,7 +25,7 @@ "@veramo/utils": "workspace:^", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-jwt": "^7.0.0-alpha.5", + "did-jwt": "^7.1.0-alpha.1", "did-resolver": "^4.0.1", "uint8arrays": "^4.0.3", "uuid": "^9.0.0" diff --git a/packages/did-comm/src/didcomm.ts b/packages/did-comm/src/didcomm.ts index 2b58cd7ee..ce0acd4ab 100644 --- a/packages/did-comm/src/didcomm.ts +++ b/packages/did-comm/src/didcomm.ts @@ -21,9 +21,13 @@ import { Encrypter, verifyJWS, xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, + a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW, xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, + a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW, xc20pAnonDecrypterX25519WithA256KW, + a256gcmAnonDecrypterX25519WithA256KW, xc20pAnonEncrypterX25519WithA256KW, + a256gcmAnonEncrypterX25519WithA256KW, } from 'did-jwt' import { DIDDocument, parse as parseDidUrl, ServiceEndpoint, VerificationMethod, Service } from 'did-resolver' @@ -286,10 +290,10 @@ export class DIDComm implements IAgentPlugin { const defaults = { alg: args.packing === 'authcrypt' ? 'ECDH-1PU+A256KW' : 'ECDH-ES+A256KW', - enc: 'XC20P', // FIXME: 'A256CBC-HS512' would be required and 'A256GCM' recommended. 'XC20P' is only optional + enc: 'A256GCM', // 'XC20P' can also be specified; FIXME: 'A256CBC-HS512' is not yet supported } - const options = {...defaults, ...args.options} + const options = { ...defaults, ...args.options } // 2: compute recipients interface IRecipient { @@ -338,12 +342,12 @@ export class DIDComm implements IAgentPlugin { .map((recipient) => { if (options.enc === 'A256GCM') { if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { - // FIXME: the didcomm spec actually links to ECDH-1PU(v4) - return a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { - kid: recipient.kid, - }) + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { + kid: recipient.kid, + }) } else { - return a256gcmAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) + return a256gcmAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) } } else if (options.enc === 'XC20P') { if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { @@ -352,8 +356,7 @@ export class DIDComm implements IAgentPlugin { recipient.publicKeyBytes, senderECDH, { kid: recipient.kid }, - ) - } else if (options?.alg?.endsWith('+A256KW')) { + )} else if (options?.alg?.endsWith('+A256KW')) { // FIXME: the didcomm spec actually links to ECDH-1PU(v4) return xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { kid: recipient.kid, @@ -489,25 +492,41 @@ export class DIDComm implements IAgentPlugin { // else // - construct anon decrypter for (const localKey of localKeys) { - let packing: string - let decrypter: Decrypter + let packing: string = 'anoncrypt' + let decrypter: Decrypter | null = null const recipientECDH: ECDH = createEcdhWrapper(localKey.localKeyRef, context) // TODO: here's where more algorithms should be supported - if (senderKeyBytes && localKey.recipient?.header?.alg?.includes('ECDH-1PU')) { - packing = 'authcrypt' - if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { - decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) - } else { - decrypter = createAuthDecrypter(recipientECDH, senderKeyBytes) - } - } else { - packing = 'anoncrypt' - if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { - decrypter = xc20pAnonDecrypterX25519WithA256KW(recipientECDH) - } else { - decrypter = createAnonDecrypter(recipientECDH) + if (localKey.recipient?.header?.epk?.crv === 'X25519') { + if (localKey.recipient?.header?.enc === 'A256GCM') { + if (senderKeyBytes && localKey.recipient?.header?.alg === 'ECDH-1PU+A256KW') { + packing = 'authcrypt' + decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) + } else { + packing = 'anoncrypt' + decrypter = a256gcmAnonDecrypterX25519WithA256KW(recipientECDH) + } + } else if (localKey.recipient?.header?.enc === 'XC20P') { + if (senderKeyBytes && localKey.recipient?.header?.alg?.includes('ECDH-1PU')) { + packing = 'authcrypt' + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) + } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { + decrypter = createAuthDecrypter(recipientECDH, senderKeyBytes) + } + } else { + packing = 'anoncrypt' + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = xc20pAnonDecrypterX25519WithA256KW(recipientECDH) + } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { + decrypter = createAnonDecrypter(recipientECDH) + } + } } } + + if (!decrypter) { + throw new Error('unable to decrypt DIDComm message with any of the locally managed keys') + } // 4. decryptJWE(jwe, decrypter) try { const decryptedBytes = await decryptJWE(jwe, decrypter) diff --git a/packages/did-comm/src/types/message-types.ts b/packages/did-comm/src/types/message-types.ts index 67ca7990c..10c8d2f9d 100644 --- a/packages/did-comm/src/types/message-types.ts +++ b/packages/did-comm/src/types/message-types.ts @@ -37,14 +37,14 @@ export interface IDIDCommOptions { recipientKids?: string[] /** - * Optional content encryption algorithm to use + * Optional content encryption algorithm to use. Defaults to 'A256GCM' */ - enc?: string + enc?: 'XC20P' | 'A256GCM' /** - * Optional key wrapping algorithm to use + * Optional key wrapping algorithm to use. Defaults to 'ECDH-ES+A256KW' */ - alg?: string + alg?: 'ECDH-ES+A256KW' | 'ECDH-1PU+A256KW' | 'ECDH-ES+XC20PKW' | 'ECDH-1PU+XC20PKW' } /** diff --git a/packages/did-jwt/package.json b/packages/did-jwt/package.json index d5e498209..a7b71faef 100644 --- a/packages/did-jwt/package.json +++ b/packages/did-jwt/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.0.0-alpha.5", + "did-jwt": "^7.1.0-alpha.1", "did-resolver": "^4.0.1" }, "devDependencies": { diff --git a/packages/kms-local/package.json b/packages/kms-local/package.json index e31833939..51acf0ffc 100644 --- a/packages/kms-local/package.json +++ b/packages/kms-local/package.json @@ -26,7 +26,7 @@ "@veramo/utils": "workspace:^", "base-58": "^0.0.1", "debug": "^4.3.3", - "did-jwt": "^7.0.0-alpha.5", + "did-jwt": "^7.1.0-alpha.1", "elliptic": "^6.5.4", "uint8arrays": "^4.0.3" }, diff --git a/packages/selective-disclosure/package.json b/packages/selective-disclosure/package.json index 6cf108340..c63291210 100644 --- a/packages/selective-disclosure/package.json +++ b/packages/selective-disclosure/package.json @@ -22,7 +22,7 @@ "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.0.0-alpha.5", + "did-jwt": "^7.1.0-alpha.1", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/utils/package.json b/packages/utils/package.json index c8abae039..8f8d9e7cd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -18,7 +18,7 @@ "credential-status": "^2.0.5", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-jwt": "^7.0.0-alpha.5", + "did-jwt": "^7.1.0-alpha.1", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", "elliptic": "^6.5.4", From 03ebc9deee5d2d4582de0a83f9fb07b8b82d559d Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Thu, 20 Apr 2023 14:12:23 +0200 Subject: [PATCH 04/11] chore(deps): use @noble/* libraries instead of elliptic, @stablelib/, js-sha3, blakejs --- package.json | 1 - packages/credential-ld/package.json | 3 +- .../EcdsaSecp256k1RecoverySignature2020.ts | 21 +-- .../src/suites/Ed25519Signature2018.ts | 9 +- .../src/suites/Ed25519Signature2020.ts | 12 +- .../src/suites/JsonWebSignature2020.ts | 144 +++++++++-------- packages/credential-w3c/package.json | 1 - .../src/__tests__/message-handler.test.ts | 19 ++- .../data-store/src/__tests__/entities.test.ts | 8 +- .../data-store/src/types/import.types.d.ts | 1 - packages/did-comm/package.json | 2 - packages/did-comm/src/didcomm.ts | 21 +-- packages/did-comm/src/utils.ts | 19 ++- packages/did-provider-ion/package.json | 8 +- packages/did-provider-ion/src/functions.ts | 151 ++++++++++++------ packages/did-provider-ion/src/ion-signer.ts | 19 +-- packages/did-provider-jwk/package.json | 5 +- packages/did-provider-jwk/src/jwkDidUtils.ts | 22 ++- .../src/types/jwk-provider-types.ts | 52 +++--- packages/key-manager/package.json | 3 +- packages/key-manager/src/key-manager.ts | 26 +-- packages/key-manager/tsconfig.json | 9 +- packages/kms-local/package.json | 9 +- .../kms-local/src/__tests__/kms-local.test.ts | 55 +++++-- .../src/__tests__/secret-box.test.ts | 2 - .../kms-local/src/key-management-system.ts | 69 ++++---- packages/kms-local/tsconfig.json | 12 +- packages/utils/package.json | 6 +- packages/utils/src/credential-utils.ts | 6 +- packages/utils/src/did-utils.ts | 60 ++++--- packages/utils/types/import.types.d.ts | 1 - 31 files changed, 445 insertions(+), 331 deletions(-) delete mode 100644 packages/data-store/src/types/import.types.d.ts delete mode 100644 packages/utils/types/import.types.d.ts diff --git a/package.json b/package.json index a1a1e5cff..4eab44a02 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "@types/jest": "29.5.2", "@types/node": "20.3.0", "@types/uuid": "9.0.1", - "blakejs": "1.2.1", "caip": "1.1.0", "credential-status": "2.0.5", "cross-env": "7.0.3", diff --git a/packages/credential-ld/package.json b/packages/credential-ld/package.json index aa27354f5..18ae90b16 100644 --- a/packages/credential-ld/package.json +++ b/packages/credential-ld/package.json @@ -31,8 +31,7 @@ "@veramo/utils": "workspace:^", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-resolver": "^4.0.1", - "uint8arrays": "^4.0.3" + "did-resolver": "^4.0.1" }, "resolutions": { "@types/react": "18.0.26", diff --git a/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts b/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts index e95291fdd..7d9679df0 100644 --- a/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts +++ b/packages/credential-ld/src/suites/EcdsaSecp256k1RecoverySignature2020.ts @@ -1,8 +1,7 @@ import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites.js' import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core-types' import ldsEcdsa from '@veramo-community/lds-ecdsa-secp256k1-recovery2020' -import * as u8a from 'uint8arrays' -import { asArray, encodeJoseBlob } from '@veramo/utils' +import { asArray, bytesToBase64, concat, encodeJoseBlob, stringToUtf8Bytes } from '@veramo/utils' const { EcdsaSecp256k1RecoveryMethod2020, EcdsaSecp256k1RecoverySignature2020 } = ldsEcdsa @@ -36,8 +35,8 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature crit: ['b64'], } const headerString = encodeJoseBlob(header) - const messageBuffer = u8a.concat([u8a.fromString(`${headerString}.`, 'utf-8'), args.data]) - const messageString = u8a.toString(messageBuffer, 'base64') + const messageBuffer = concat([stringToUtf8Bytes(`${headerString}.`), args.data]) + const messageString = bytesToBase64(messageBuffer) const signature = await context.agent.keyManagerSign({ keyRef: key.kid, algorithm: 'ES256K-R', @@ -59,7 +58,7 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature }), }) - suite.ensureSuiteContext = ({ document }: { document: any, addSuiteContext: boolean }) => { + suite.ensureSuiteContext = ({ document }: { document: any; addSuiteContext: boolean }) => { document['@context'] = [...asArray(document['@context'] || []), this.getContext()] } @@ -70,12 +69,14 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature return new EcdsaSecp256k1RecoverySignature2020() } - preSigningCredModification(credential: CredentialPayload): void { - } + preSigningCredModification(credential: CredentialPayload): void {} async preDidResolutionModification(didUrl: string, didDoc: DIDDocument): Promise { -// did:ethr - const idx = didDoc['@context']?.indexOf('https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld') || -1 + // did:ethr + const idx = + didDoc['@context']?.indexOf( + 'https://identity.foundation/EcdsaSecp256k1RecoverySignature2020/lds-ecdsa-secp256k1-recovery2020-0.0.jsonld', + ) || -1 if (Array.isArray(didDoc['@context']) && idx !== -1) { didDoc['@context'][idx] = this.getContext() } @@ -85,7 +86,7 @@ export class VeramoEcdsaSecp256k1RecoverySignature2020 extends VeramoLdSignature didDoc.verificationMethod?.forEach((x) => { if (x.blockchainAccountId) { if (x.blockchainAccountId.lastIndexOf('@eip155:') !== -1) { - const [ address, chain ] = x.blockchainAccountId.split("@eip155:") + const [address, chain] = x.blockchainAccountId.split('@eip155:') x.blockchainAccountId = `eip155:${chain}:${address}` } } diff --git a/packages/credential-ld/src/suites/Ed25519Signature2018.ts b/packages/credential-ld/src/suites/Ed25519Signature2018.ts index d4d5705c0..236e4d049 100644 --- a/packages/credential-ld/src/suites/Ed25519Signature2018.ts +++ b/packages/credential-ld/src/suites/Ed25519Signature2018.ts @@ -1,7 +1,6 @@ -import { encodeJoseBlob } from '@veramo/utils' +import { bytesToBase64, concat, encodeJoseBlob, hexToBytes, stringToUtf8Bytes } from '@veramo/utils' import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites.js' import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core-types' -import * as u8a from 'uint8arrays' import { Ed25519Signature2018, Ed25519VerificationKey2018 } from '@transmute/ed25519-signature-2018' /** @@ -38,8 +37,8 @@ export class VeramoEd25519Signature2018 extends VeramoLdSignature { crit: ['b64'], } const headerString = encodeJoseBlob(header) - const messageBuffer = u8a.concat([u8a.fromString(`${headerString}.`, 'utf-8'), args.data]) - const messageString = u8a.toString(messageBuffer, 'base64') + const messageBuffer = concat([stringToUtf8Bytes(`${headerString}.`), args.data]) + const messageString = bytesToBase64(messageBuffer) const signature = await context.agent.keyManagerSign({ keyRef: key.kid, algorithm: 'EdDSA', @@ -53,7 +52,7 @@ export class VeramoEd25519Signature2018 extends VeramoLdSignature { const verificationKey = new Ed25519VerificationKey2018({ id, controller, - publicKey: u8a.fromString(key.publicKeyHex, 'base16'), + publicKey: hexToBytes(key.publicKeyHex), signer: () => signer, type: this.getSupportedVerificationType(), }) diff --git a/packages/credential-ld/src/suites/Ed25519Signature2020.ts b/packages/credential-ld/src/suites/Ed25519Signature2020.ts index 9939fe265..191687b72 100644 --- a/packages/credential-ld/src/suites/Ed25519Signature2020.ts +++ b/packages/credential-ld/src/suites/Ed25519Signature2020.ts @@ -8,10 +8,16 @@ import { IResolver, TKeyType, } from '@veramo/core-types' -import * as u8a from 'uint8arrays' import { Ed25519Signature2020 } from '@digitalcredentials/ed25519-signature-2020' import { Ed25519VerificationKey2020 } from '@digitalcredentials/ed25519-verification-key-2020' -import { asArray, base64ToBytes, bytesToMultibase, extractPublicKeyHex, hexToBytes } from '@veramo/utils' +import { + asArray, + base64ToBytes, + bytesToBase64, + bytesToMultibase, + extractPublicKeyHex, + hexToBytes, +} from '@veramo/utils' import { VerificationMethod } from 'did-resolver' import Debug from 'debug' @@ -46,7 +52,7 @@ export class VeramoEd25519Signature2020 extends VeramoLdSignature { const signer = { // returns signatureBytes sign: async (args: { data: Uint8Array }): Promise => { - const messageString = u8a.toString(args.data, 'base64') + const messageString = bytesToBase64(args.data) const signature = await context.agent.keyManagerSign({ keyRef: key.kid, data: messageString, diff --git a/packages/credential-ld/src/suites/JsonWebSignature2020.ts b/packages/credential-ld/src/suites/JsonWebSignature2020.ts index c5f592603..9a1319a4a 100644 --- a/packages/credential-ld/src/suites/JsonWebSignature2020.ts +++ b/packages/credential-ld/src/suites/JsonWebSignature2020.ts @@ -1,9 +1,15 @@ -import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from "@veramo/core-types"; -import { RequiredAgentMethods, VeramoLdSignature } from "../ld-suites.js"; -import * as u8a from "uint8arrays"; -import { JsonWebKey, JsonWebSignature } from "@transmute/json-web-signature"; -import { asArray, encodeJoseBlob } from "@veramo/utils"; - +import { CredentialPayload, DIDDocument, IAgentContext, IKey, TKeyType } from '@veramo/core-types' +import { RequiredAgentMethods, VeramoLdSignature } from '../ld-suites.js' +import { JsonWebKey, JsonWebSignature } from '@transmute/json-web-signature' +import { + asArray, + bytesToBase64, + bytesToBase64url, + concat, + encodeJoseBlob, + hexToBytes, + stringToUtf8Bytes, +} from '@veramo/utils' /** * Veramo wrapper for the JsonWebSignature2020 suite by Transmute Industries @@ -11,81 +17,83 @@ import { asArray, encodeJoseBlob } from "@veramo/utils"; * @alpha This API is experimental and is very likely to change or disappear in future releases without notice. */ export class VeramoJsonWebSignature2020 extends VeramoLdSignature { - getSupportedVerificationType(): 'JsonWebKey2020' { - return 'JsonWebKey2020' - } + getSupportedVerificationType(): 'JsonWebKey2020' { + return 'JsonWebKey2020' + } - getSupportedVeramoKeyType(): TKeyType { - return 'Ed25519' - } + getSupportedVeramoKeyType(): TKeyType { + return 'Ed25519' + } - async getSuiteForSigning( - key: IKey, - issuerDid: string, - verificationMethodId: string, - context: IAgentContext, - ): Promise { - const controller = issuerDid + async getSuiteForSigning( + key: IKey, + issuerDid: string, + verificationMethodId: string, + context: IAgentContext, + ): Promise { + const controller = issuerDid - // DID Key ID - let id = verificationMethodId + // DID Key ID + let id = verificationMethodId - const signer = { - // returns a JWS detached - sign: async (args: { data: Uint8Array }): Promise => { - const header = { - alg: 'EdDSA', - b64: false, - crit: ['b64'], - } - const headerString = encodeJoseBlob(header) - const messageBuffer = u8a.concat([u8a.fromString(`${headerString}.`, 'utf-8'), args.data]) - const messageString = u8a.toString(messageBuffer, 'base64') - const signature = await context.agent.keyManagerSign({ - keyRef: key.kid, - algorithm: 'EdDSA', - data: messageString, - encoding: 'base64', - }) - return `${headerString}..${signature}` - }, + const signer = { + // returns a JWS detached + sign: async (args: { data: Uint8Array }): Promise => { + const header = { + alg: 'EdDSA', + b64: false, + crit: ['b64'], } - - const verificationKey = await JsonWebKey.from({ - id: id, - type: this.getSupportedVerificationType(), - controller: controller, - publicKeyJwk: { - kty: 'OKP', - crv: 'Ed25519', - x: u8a.toString(u8a.fromString(key.publicKeyHex, 'hex'), 'base64url'), - }, + const headerString = encodeJoseBlob(header) + const messageBuffer = concat([stringToUtf8Bytes(`${headerString}.`), args.data]) + const messageString = bytesToBase64(messageBuffer) + const signature = await context.agent.keyManagerSign({ + keyRef: key.kid, + algorithm: 'EdDSA', + data: messageString, + encoding: 'base64', }) + return `${headerString}..${signature}` + }, + } - verificationKey.signer = () => signer + const verificationKey = await JsonWebKey.from({ + id: id, + type: this.getSupportedVerificationType(), + controller: controller, + publicKeyJwk: { + kty: 'OKP', + crv: 'Ed25519', + x: bytesToBase64url(hexToBytes(key.publicKeyHex)), + }, + }) - const suite = new JsonWebSignature({ - key: verificationKey, - }) + verificationKey.signer = () => signer - suite.ensureSuiteContext = ({ document }: { document: any, addSuiteContext: boolean }) => { - document['@context'] = [...asArray(document['@context'] || []), 'https://w3id.org/security/suites/jws-2020/v1'] - } + const suite = new JsonWebSignature({ + key: verificationKey, + }) - return suite + suite.ensureSuiteContext = ({ document }: { document: any; addSuiteContext: boolean }) => { + document['@context'] = [ + ...asArray(document['@context'] || []), + 'https://w3id.org/security/suites/jws-2020/v1', + ] } - getSuiteForVerification(): any { - return new JsonWebSignature() - } + return suite + } - preSigningCredModification(credential: CredentialPayload): void { - // nop - } + getSuiteForVerification(): any { + return new JsonWebSignature() + } - async preDidResolutionModification(didUrl: string, didDoc: DIDDocument): Promise { - // do nothing - return didDoc - } + preSigningCredModification(credential: CredentialPayload): void { + // nop + } + async preDidResolutionModification(didUrl: string, didDoc: DIDDocument): Promise { + // do nothing + return didDoc + } } diff --git a/packages/credential-w3c/package.json b/packages/credential-w3c/package.json index 84f449995..cc8c90c9a 100644 --- a/packages/credential-w3c/package.json +++ b/packages/credential-w3c/package.json @@ -21,7 +21,6 @@ "did-jwt": "^7.1.0-alpha.1", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", - "uint8arrays": "^4.0.3", "uuid": "^9.0.0" }, "optionalDependencies": { diff --git a/packages/credential-w3c/src/__tests__/message-handler.test.ts b/packages/credential-w3c/src/__tests__/message-handler.test.ts index 23e77e960..fa9c77ad2 100644 --- a/packages/credential-w3c/src/__tests__/message-handler.test.ts +++ b/packages/credential-w3c/src/__tests__/message-handler.test.ts @@ -1,10 +1,9 @@ import { DIDResolutionResult, IAgentContext, ICredentialPlugin, IResolver } from '../../../core-types/src' import { Message } from '../../../message-handler/src' import { IContext, MessageTypes, W3cMessageHandler } from '../message-handler.js' -// @ts-ignore -import pkg from 'blakejs' -const { blake2bHex } = pkg import { jest } from '@jest/globals' +import { blake2b } from '@noble/hashes/blake2b' +import { bytesToHex, hexToBytes } from '../../../utils/src' describe('@veramo/credential-w3c', () => { const handler = new W3cMessageHandler() @@ -71,7 +70,7 @@ describe('@veramo/credential-w3c', () => { verifyCredential: jest.fn(), verifyPresentation: jest.fn(), getDIDComponentById: jest.fn(), - } + }, } as IAgentContext it('should reject unknown message type', async () => { @@ -121,7 +120,7 @@ describe('@veramo/credential-w3c', () => { message.addMetaData({ type: 'JWT', value: 'ES256K-R' }) const handled = await handler.handle(message, context) expect(handled.isValid()).toEqual(true) - expect(handled.id).toEqual(blake2bHex(vcJwtSecp256k1)) + expect(handled.id).toEqual(bytesToHex(blake2b(vcJwtSecp256k1))) expect(handled.raw).toEqual(vcJwtSecp256k1) expect(handled.type).toEqual(MessageTypes.vc) expect(handled.from).toEqual(vcPayloadSecp256k1.iss) @@ -138,7 +137,7 @@ describe('@veramo/credential-w3c', () => { const handled = await handler.handle(message, context) expect(handled.isValid()).toEqual(true) - expect(handled.id).toEqual(blake2bHex(vpJwtSecp256k1)) + expect(handled.id).toEqual(bytesToHex(blake2b(vpJwtSecp256k1))) expect(handled.raw).toEqual(vpJwtSecp256k1) expect(handled.type).toEqual(MessageTypes.vp) expect(handled.from).toEqual(vpPayloadSecp256k1.iss) @@ -188,7 +187,7 @@ describe('@veramo/credential-w3c', () => { message.addMetaData({ type: 'JWT', value: 'Ed25519' }) const handled = await handler.handle(message, context) expect(handled.isValid()).toEqual(true) - expect(handled.id).toEqual(blake2bHex(vcJwtEd25519)) + expect(handled.id).toEqual(bytesToHex(blake2b(vcJwtEd25519))) expect(handled.raw).toEqual(vcJwtEd25519) expect(handled.type).toEqual(MessageTypes.vc) expect(handled.from).toEqual(vcPayloadEd25519.iss) @@ -204,7 +203,7 @@ describe('@veramo/credential-w3c', () => { const handled = await handler.handle(message, context) expect(handled.isValid()).toEqual(true) - expect(handled.id).toEqual(blake2bHex(vpJwtEd25519)) + expect(handled.id).toEqual(bytesToHex(blake2b(vpJwtEd25519))) expect(handled.raw).toEqual(vpJwtEd25519) expect(handled.type).toEqual(MessageTypes.vp) expect(handled.from).toEqual(vpPayloadEd25519.iss) @@ -236,7 +235,7 @@ describe('@veramo/credential-w3c', () => { const handled = await handler.handle(message, context) expect(handled.isValid()).toEqual(true) - expect(handled.id).toEqual(blake2bHex(vpMultiAudJwt)) + expect(handled.id).toEqual(bytesToHex(blake2b(vpMultiAudJwt))) expect(handled.raw).toEqual(vpMultiAudJwt) expect(handled.type).toEqual(MessageTypes.vp) expect(handled.from).toEqual(vpMultiAudPayload.iss) @@ -275,7 +274,7 @@ describe('@veramo/credential-w3c', () => { const handled = await handler.handle(message, context) expect(handled.isValid()).toEqual(true) - expect(handled.id).toEqual(blake2bHex(token)) + expect(handled.id).toEqual(bytesToHex(blake2b(token))) expect(handled.raw).toEqual(token) expect(handled.type).toEqual(MessageTypes.vc) expect(handled.from).toEqual('did:ethr:0x54d59e3ffd76917f62db702ac354b17f3842955e') diff --git a/packages/data-store/src/__tests__/entities.test.ts b/packages/data-store/src/__tests__/entities.test.ts index 26c9f5ad0..836bdd2b9 100644 --- a/packages/data-store/src/__tests__/entities.test.ts +++ b/packages/data-store/src/__tests__/entities.test.ts @@ -2,11 +2,9 @@ import { createCredentialEntity, Credential } from '../entities/credential.js' import { createPresentationEntity } from '../entities/presentation.js' import { Claim, Entities, Identifier, Message } from '../index.js' import { DataSource, In } from 'typeorm' -// @ts-ignore -import pkg from 'blakejs' import * as fs from 'fs' - -const { blake2bHex } = pkg +import { bytesToHex } from '../../../utils/src' +import { blake2b } from '@noble/hashes/blake2b' describe('DB entities test', () => { let connection: DataSource @@ -169,7 +167,7 @@ describe('DB entities test', () => { }) it('Message can have externally set id', async () => { - const customId = blake2bHex('hash123') + const customId = bytesToHex(blake2b('hash123')) const message = new Message() message.type = 'custom' diff --git a/packages/data-store/src/types/import.types.d.ts b/packages/data-store/src/types/import.types.d.ts deleted file mode 100644 index d3f1b7fe3..000000000 --- a/packages/data-store/src/types/import.types.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'blakejs' diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index 69f9fe41d..5b16edc56 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -19,7 +19,6 @@ }, "dependencies": { "@ethersproject/signing-key": "^5.7.0", - "@stablelib/ed25519": "^1.0.3", "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", @@ -27,7 +26,6 @@ "debug": "^4.3.3", "did-jwt": "^7.1.0-alpha.1", "did-resolver": "^4.0.1", - "uint8arrays": "^4.0.3", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/did-comm/src/didcomm.ts b/packages/did-comm/src/didcomm.ts index ce0acd4ab..97c71f936 100644 --- a/packages/did-comm/src/didcomm.ts +++ b/packages/did-comm/src/didcomm.ts @@ -34,7 +34,7 @@ import { DIDDocument, parse as parseDidUrl, ServiceEndpoint, VerificationMethod, import schema from './plugin.schema.json' assert { type: 'json' } import { v4 as uuidv4 } from 'uuid' -import * as u8a from 'uint8arrays' + import { createEcdhWrapper, extractSenderEncryptionKey, @@ -51,6 +51,9 @@ import { resolveDidOrThrow, _ExtendedIKey, _NormalizedVerificationMethod, + hexToBytes, + stringToUtf8Bytes, + bytesToUtf8String, } from '@veramo/utils' import Debug from 'debug' @@ -320,7 +323,7 @@ export class DIDComm implements IAgentPlugin { // 2.3 get public key bytes and key IDs for supported recipient keys const tempRecipients = keyAgreementKeys - .map((pk) => ({ kid: pk.id, publicKeyBytes: u8a.fromString(pk.publicKeyHex!, 'base16') })) + .map((pk) => ({ kid: pk.id, publicKeyBytes: hexToBytes(pk.publicKeyHex!) })) .filter(isDefined) if (tempRecipients.length === 0) { @@ -342,12 +345,12 @@ export class DIDComm implements IAgentPlugin { .map((recipient) => { if (options.enc === 'A256GCM') { if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { - // FIXME: the didcomm spec actually links to ECDH-1PU(v4) - return a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { - kid: recipient.kid, - }) + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { + kid: recipient.kid, + }) } else { - return a256gcmAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) + return a256gcmAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) } } else if (options.enc === 'XC20P') { if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { @@ -390,7 +393,7 @@ export class DIDComm implements IAgentPlugin { } // 4. createJWE - const messageBytes = u8a.fromString(JSON.stringify(args.message), 'utf-8') + const messageBytes = stringToUtf8Bytes(JSON.stringify(args.message)) const jwe = await createJWE(messageBytes, encrypters, protectedHeader, undefined, true) const message = JSON.stringify(jwe) return { message } @@ -530,7 +533,7 @@ export class DIDComm implements IAgentPlugin { // 4. decryptJWE(jwe, decrypter) try { const decryptedBytes = await decryptJWE(jwe, decrypter) - const decryptedMsg = u8a.toString(decryptedBytes, 'utf-8') + const decryptedMsg = bytesToUtf8String(decryptedBytes) const message = JSON.parse(decryptedMsg) return { message, metaData: { packing } } as IUnpackedDIDCommMessage } catch (e) { diff --git a/packages/did-comm/src/utils.ts b/packages/did-comm/src/utils.ts index f62aa6505..728702145 100644 --- a/packages/did-comm/src/utils.ts +++ b/packages/did-comm/src/utils.ts @@ -1,13 +1,14 @@ import { IAgentContext, IDIDManager, IIdentifier, IKeyManager, IResolver, TKeyType } from '@veramo/core-types' import { ECDH, JWE } from 'did-jwt' import { parse as parseDidUrl } from 'did-resolver' -import * as u8a from 'uint8arrays' import Debug from 'debug' import { _ExtendedVerificationMethod, + bytesToHex, decodeJoseBlob, extractPublicKeyHex, + hexToBytes, isDefined, mapIdentifierKeysToDoc, resolveDidOrThrow, @@ -20,9 +21,9 @@ export function createEcdhWrapper(secretKeyRef: string, context: IAgentContext'X25519', publicKeyHex: u8a.toString(theirPublicKey, 'base16') } + const publicKey = { type: 'X25519', publicKeyHex: bytesToHex(theirPublicKey) } const shared = await context.agent.keyManagerSharedSecret({ secretKeyRef, publicKey }) - return u8a.fromString(shared, 'base16') + return hexToBytes(shared) } } @@ -39,11 +40,19 @@ export async function extractSenderEncryptionKey( didUrl: protectedHeader.skid, section: 'keyAgreement', })) as _ExtendedVerificationMethod - if (!['Ed25519VerificationKey2018', 'X25519KeyAgreementKey2019', 'JsonWebKey2020', 'Ed25519VerificationKey2020', 'X25519KeyAgreementKey2020'].includes(sKey.type)) { + if ( + ![ + 'Ed25519VerificationKey2018', + 'X25519KeyAgreementKey2019', + 'JsonWebKey2020', + 'Ed25519VerificationKey2020', + 'X25519KeyAgreementKey2020', + ].includes(sKey.type) + ) { throw new Error(`not_supported: sender key of type ${sKey.type} is not supported`) } let publicKeyHex = extractPublicKeyHex(sKey, true) - senderKey = u8a.fromString(publicKeyHex, 'base16') + senderKey = hexToBytes(publicKeyHex) } return senderKey } diff --git a/packages/did-provider-ion/package.json b/packages/did-provider-ion/package.json index 0d47a4d93..1b2e14be4 100644 --- a/packages/did-provider-ion/package.json +++ b/packages/did-provider-ion/package.json @@ -13,22 +13,22 @@ "@decentralized-identity/ion-sdk": "^1.0.0", "@ethersproject/random": "^5.7.0", "@ethersproject/signing-key": "^5.7.0", + "@noble/curves": "^1.0.0", + "@noble/hashes": "^1.3.0", "@sphereon/ion-pow": "^0.2.0", "@sphereon/isomorphic-argon2": "^1.0.1", - "@stablelib/ed25519": "^1.0.3", - "@stablelib/sha256": "^1.0.1", "@trust/keyto": "^1.0.1", "@veramo/core-types": "workspace:^", "@veramo/did-manager": "workspace:^", "@veramo/key-manager": "workspace:^", "@veramo/kms-local": "workspace:^", "@veramo/utils": "workspace:^", + "@veramo/utils": "workspace:^", "canonicalize": "^2.0.0", "cross-fetch": "^3.1.6", "debug": "^4.3.3", "did-resolver": "^4.0.1", - "multihashes": "^4.0.3", - "uint8arrays": "^4.0.3" + "multihashes": "^4.0.3" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-provider-ion/src/functions.ts b/packages/did-provider-ion/src/functions.ts index f9de14895..f25f1aac6 100644 --- a/packages/did-provider-ion/src/functions.ts +++ b/packages/did-provider-ion/src/functions.ts @@ -5,19 +5,25 @@ import { KeyIdentifierRelation, KeyType, } from './types/ion-provider-types.js' -import { IonDid, IonDocumentModel, IonPublicKeyModel, IonPublicKeyPurpose, JwkEs256k } from '@decentralized-identity/ion-sdk' +import { + IonDid, + IonDocumentModel, + IonPublicKeyModel, + IonPublicKeyPurpose, + JwkEs256k, +} from '@decentralized-identity/ion-sdk' import { computePublicKey } from '@ethersproject/signing-key' import { IKey, ManagedKeyInfo } from '@veramo/core-types' -import keyto from '@trust/keyto'; +import keyto from '@trust/keyto' import { randomBytes } from '@ethersproject/random' -import * as u8a from 'uint8arrays' -import { generateKeyPair as generateSigningKeyPair } from '@stablelib/ed25519' +import { ed25519 } from '@noble/curves/ed25519' import Debug from 'debug' import { JsonCanonicalizer } from './json-canonicalizer.js' import { MemoryPrivateKeyStore } from '@veramo/key-manager' import { KeyManagementSystem } from '@veramo/kms-local' -import { hash } from '@stablelib/sha256' +import { sha256 } from '@noble/hashes/sha256' import multihashes from 'multihashes' +import { bytesToBase64url, bytesToHex, concat, hexToBytes, stringToUtf8Bytes } from '@veramo/utils' const debug = Debug('veramo:did-provider-ion') @@ -69,50 +75,47 @@ export const toIonPublicKeyJwk = (publicKeyHex: string): JwkEs256k => { * ``` * See [rfc7638](https://tools.ietf.org/html/rfc7638) for more details on Jwk. */ -export const getKid = ( - jwk: ISecp256k1PrivateKeyJwk | ISecp256k1PublicKeyJwk -) => { - const copy = { ...jwk } as any; - delete copy.d; - delete copy.kid; - delete copy.alg; - const digest = hash(u8a.fromString(JsonCanonicalizer.asString(copy), 'utf-8')); - return u8a.toString(digest, 'base64url') -}; +export const getKid = (jwk: ISecp256k1PrivateKeyJwk | ISecp256k1PublicKeyJwk) => { + const copy = { ...jwk } as any + delete copy.d + delete copy.kid + delete copy.alg + const digest = sha256(stringToUtf8Bytes(JsonCanonicalizer.asString(copy))) + return bytesToBase64url(digest) +} /** convert compressed hex encoded private key to jwk */ const privateKeyJwkFromPrivateKeyHex = (privateKeyHex: string) => { const jwk = { ...keyto.from(privateKeyHex, 'blk').toJwk('private'), crv: 'secp256k1', - }; - const kid = getKid(jwk); + } + const kid = getKid(jwk) return { ...jwk, kid, - }; -}; + } +} /** convert compressed hex encoded public key to jwk */ const publicKeyJwkFromPublicKeyHex = (publicKeyHex: string) => { - let key = publicKeyHex; - const compressedHexEncodedPublicKeyLength = 66; + let key = publicKeyHex + const compressedHexEncodedPublicKeyLength = 66 if (publicKeyHex.length === compressedHexEncodedPublicKeyLength) { - const publicBytes = u8a.fromString(publicKeyHex, 'base16') + const publicBytes = hexToBytes(publicKeyHex) key = computePublicKey(publicBytes, true).substring(2) } const jwk = { ...keyto.from(key, 'blk').toJwk('public'), crv: 'secp256k1', - }; - const kid = getKid(jwk); + } + const kid = getKid(jwk) return { ...jwk, kid, - }; -}; - + } +} /** * Computes the ION Commitment value from a ION public key @@ -132,11 +135,11 @@ export const computeCommitmentFromIonPublicKey = (ionKey: IonPublicKeyModel): st export const computeCommitmentFromJwk = (jwk: JwkEs256k): string => { const data = JsonCanonicalizer.asString(jwk) debug(`canonicalized JWK: ${data}`) - const singleHash = hash(u8a.fromString(data)) - const doubleHash = hash(singleHash) + const singleHash = sha256(stringToUtf8Bytes(data)) + const doubleHash = sha256(singleHash) const multiHash = multihashes.encode(doubleHash, MULTI_HASH_SHA256_LITERAL) - const commitment = u8a.toString(multiHash, 'base64url') + const commitment = bytesToBase64url(multiHash) debug(`commitment: ${commitment}`) return commitment } @@ -151,10 +154,12 @@ export const getActionTimestamp = (timestamp = Date.now()): number => { } /** - * Gets a specific recovery key matching the commitment value, typically coming from a DID document, or the latest recovery key in case it is not provided + * Gets a specific recovery key matching the commitment value, typically coming from a DID document, or the latest + * recovery key in case it is not provided * * @param keys The actual keys related to an identifier - * @param commitment An optional commitment value to match the recovery key against. Typically comes from a DID Document + * @param commitment An optional commitment value to match the recovery key against. Typically comes from a DID + * Document * @return The ION Recovery Public Key */ export const getVeramoRecoveryKey = (keys: IKey[], commitment?: string): IKey => { @@ -163,7 +168,8 @@ export const getVeramoRecoveryKey = (keys: IKey[], commitment?: string): IKey => } /** - * Gets a specific update key matching the commitment value, typically coming from a DID document, or the latest update key in case it is not provided + * Gets a specific update key matching the commitment value, typically coming from a DID document, or the latest update + * key in case it is not provided * * @param keys The actual keys related to an identifier * @param commitment An optional commitment value to match the update key against. Typically comes from a DID Document @@ -175,43 +181,63 @@ export const getVeramoUpdateKey = (keys: IKey[], commitment?: string): IKey => { } /** - * Get the Ion Public keys from Veramo which have a specific relation type. If the commitment value is set the Key belonging to that value will be returned, otherwise the latest key + * Get the Ion Public keys from Veramo which have a specific relation type. If the commitment value is set the Key + * belonging to that value will be returned, otherwise the latest key * @param keys The Veramo Keys to inspect * @param relation The Key relation ship type - * @param commitment An optional commitment value, typically coming from a DID Document. The value 'genisis' returns the first key found + * @param commitment An optional commitment value, typically coming from a DID Document. The value 'genisis' returns + * the first key found */ -export const ionKeysOfType = (keys: IKey[], relation: KeyIdentifierRelation, commitment?: string): IonPublicKeyModel[] => { +export const ionKeysOfType = ( + keys: IKey[], + relation: KeyIdentifierRelation, + commitment?: string, +): IonPublicKeyModel[] => { return veramoKeysOfType(keys, relation, commitment).flatMap((key) => { return toIonPublicKey(key) }) } /** - * Get the Veramo keys which have a specific relation type. If the commitment value is set the Key belonging to that value will be returned, otherwise the latest key + * Get the Veramo keys which have a specific relation type. If the commitment value is set the Key belonging to that + * value will be returned, otherwise the latest key * @param keys The Veramo Keys to inspect * @param relation The Key relation ship type - * @param commitment An optional commitment value, typically coming from a DID Document. The value 'genisis' returns the first key found + * @param commitment An optional commitment value, typically coming from a DID Document. The value 'genisis' returns + * the first key found */ -export const veramoKeysOfType = (keys: IKey[], relation: KeyIdentifierRelation, commitment?: string): IKey[] => { +export const veramoKeysOfType = ( + keys: IKey[], + relation: KeyIdentifierRelation, + commitment?: string, +): IKey[] => { return keys .sort((key1, key2) => { const opId1 = key1.meta?.ion?.operationId const opId2 = key2.meta?.ion?.operationId return !opId1 ? 1 : !opId2 ? -1 : opId1 - opId2 }) - .filter((key) => !commitment || commitment === 'genesis' || !key.meta?.ion.commitment || key.meta?.ion.commitment === commitment) + .filter( + (key) => + !commitment || + commitment === 'genesis' || + !key.meta?.ion.commitment || + key.meta?.ion.commitment === commitment, + ) .filter((key) => key.meta?.ion.relation === relation) .flatMap((keys) => keys) } /** - * Ion/Sidetree only supports kid with a maximum length of 50 characters. This method truncates longer keys when create ION requests + * Ion/Sidetree only supports kid with a maximum length of 50 characters. This method truncates longer keys when create + * ION requests * * @param kid The Veramo kid * @return A truncated kid if the input kid contained more than 50 characters */ export const truncateKidIfNeeded = (kid: string): string => { - const id = kid.substring(0, 50) // ION restricts the id to 50 chars. Ideally we can also provide kids for key creation in Veramo + const id = kid.substring(0, 50) // ION restricts the id to 50 chars. Ideally we can also provide kids for key + // creation in Veramo if (id.length != kid.length) { debug(`Key kid ${kid} has been truncated to 50 chars to support ION!`) } @@ -221,11 +247,19 @@ export const truncateKidIfNeeded = (kid: string): string => { /** * Creates an Ion Public Key (Verification Method), used in ION request from a Veramo Key * @param key The Veramo Key - * @param createKeyPurposes The verification relationships (Sidetree calls them purposes) to explicitly set. Used during key creation + * @param createKeyPurposes The verification relationships (Sidetree calls them purposes) to explicitly set. Used + * during key creation * @return An Ion Public Key which can be used in Ion request objects */ -export const toIonPublicKey = (key: ManagedKeyInfo, createKeyPurposes?: IonPublicKeyPurpose[]): IonPublicKeyModel => { - const purposes: IonPublicKeyPurpose[] = createKeyPurposes ? createKeyPurposes : key.meta?.ion?.purposes ? key.meta.ion.purposes : [] +export const toIonPublicKey = ( + key: ManagedKeyInfo, + createKeyPurposes?: IonPublicKeyPurpose[], +): IonPublicKeyModel => { + const purposes: IonPublicKeyPurpose[] = createKeyPurposes + ? createKeyPurposes + : key.meta?.ion?.purposes + ? key.meta.ion.purposes + : [] const publicKeyJwk = toIonPublicKeyJwk(key.publicKeyHex) const id = truncateKidIfNeeded(key.kid) @@ -247,13 +281,15 @@ export const generatePrivateKeyHex = (type: KeyType): string => { switch (type) { case KeyType.Ed25519: { - const keyPairEd25519 = generateSigningKeyPair() - privateKeyHex = u8a.toString(keyPairEd25519.secretKey, 'base16') + // @noble/curves doesn't precompute the public key + const secretKey = ed25519.utils.randomPrivateKey() + const publicKey = ed25519.utils.getExtendedPublicKey(secretKey.subarray(0, 32)).pointBytes + privateKeyHex = bytesToHex(concat([secretKey, publicKey])) break } case KeyType.Secp256k1: { const privateBytes = randomBytes(32) - privateKeyHex = u8a.toString(privateBytes, 'base16') + privateKeyHex = bytesToHex(privateBytes) break } default: @@ -279,7 +315,7 @@ export const tempMemoryKey = async ( privateKeyHex: string, kid: string, kms: string, - ionMeta: IonKeyMetadata + ionMeta: IonKeyMetadata, ): Promise => { const tmpKey = (await new KeyManagementSystem(new MemoryPrivateKeyStore()).importKey({ type, @@ -299,7 +335,11 @@ export const tempMemoryKey = async ( * @param input The creation keys * @return The Ion Long form DID */ -export const ionLongFormDidFromCreation = async (input: { recoveryKey: JwkEs256k; updateKey: JwkEs256k; document: IonDocumentModel }): Promise => { +export const ionLongFormDidFromCreation = async (input: { + recoveryKey: JwkEs256k + updateKey: JwkEs256k + document: IonDocumentModel +}): Promise => { return await IonDid.createLongFormDid(input) } @@ -309,8 +349,12 @@ export const ionLongFormDidFromCreation = async (input: { recoveryKey: JwkEs256k * @param input The creation keys * @return The Ion Short form DID */ -export const ionShortFormDidFromCreation = async (input: { recoveryKey: JwkEs256k; updateKey: JwkEs256k; document: IonDocumentModel }): Promise => { - return ionShortFormDidFromLong(await ionLongFormDidFromCreation(input)) +export const ionShortFormDidFromCreation = async (input: { + recoveryKey: JwkEs256k + updateKey: JwkEs256k + document: IonDocumentModel +}): Promise => { + return ionShortFormDidFromLong(await ionLongFormDidFromCreation(input)) } /** @@ -326,7 +370,8 @@ export const ionShortFormDidFromLong = (longFormDid: string): string => { } /** - * Gets the method specific Short form Id from the Long form DID. So the did: prefix and Ion Long Form suffix have been removed + * Gets the method specific Short form Id from the Long form DID. So the did: prefix and Ion Long Form suffix have been + * removed * @param longFormDid The Ion Long form DID * @return The Short form method specific Id */ diff --git a/packages/did-provider-ion/src/ion-signer.ts b/packages/did-provider-ion/src/ion-signer.ts index 44c3e79e1..919b2eab5 100644 --- a/packages/did-provider-ion/src/ion-signer.ts +++ b/packages/did-provider-ion/src/ion-signer.ts @@ -1,9 +1,10 @@ import { IContext } from './types/ion-provider-types.js' -import * as u8a from 'uint8arrays' -import { hash } from '@stablelib/sha256' +import { sha256 } from '@noble/hashes/sha256' +import { bytesToBase64url, bytesToHex, stringToUtf8Bytes } from '@veramo/utils' /** - * This class is responsible for signing the JWT when sending in Anchor requests to an ION node. It is using the update or recovery key denoted by 'kid' + * This class is responsible for signing the JWT when sending in Anchor requests to an ION node. It is using the update + * or recovery key denoted by 'kid' */ export class IonSigner { private readonly kid: string @@ -30,18 +31,18 @@ export class IonSigner { alg: 'ES256K', } } - const encodedHeader = u8a.toString(u8a.fromString(JSON.stringify(header)), 'base64url') - const encodedPayload = u8a.toString(u8a.fromString(JSON.stringify(payload)), 'base64url') + const encodedHeader = bytesToBase64url(stringToUtf8Bytes(JSON.stringify(header))) + const encodedPayload = bytesToBase64url(stringToUtf8Bytes(JSON.stringify(payload))) const toBeSigned = `${encodedHeader}.${encodedPayload}` - const message = u8a.fromString(toBeSigned) - const digest = u8a.toString(hash(message), 'base16') - const sigObj = await this.context.agent.keyManagerSign({ + const message = stringToUtf8Bytes(toBeSigned) + const digest = bytesToHex(sha256(message)) + // The keyManagerSign already performs base64url encoding + const encodedSignature = await this.context.agent.keyManagerSign({ keyRef: this.kid, algorithm: header.alg, data: digest, encoding: 'hex', }) - const encodedSignature = sigObj // The keyManagerSign already performs base64Url encoding return `${encodedHeader}.${encodedPayload}.${encodedSignature}` } } diff --git a/packages/did-provider-jwk/package.json b/packages/did-provider-jwk/package.json index afdcef046..c0a11831b 100644 --- a/packages/did-provider-jwk/package.json +++ b/packages/did-provider-jwk/package.json @@ -10,16 +10,15 @@ "extract-api": "node ../cli/bin/veramo.js dev extract-api" }, "dependencies": { + "@noble/curves": "^1.0.0", "@veramo/core-types": "workspace:^", "@veramo/did-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-resolver": "^4.0.1", - "elliptic": "^6.5.4" + "did-resolver": "^4.0.1" }, "devDependencies": { "@types/debug": "4.1.8", - "@types/elliptic": "6.4.14", "@veramo/core": "workspace:*", "@veramo/key-manager": "workspace:*", "@veramo/kms-local": "workspace:*", diff --git a/packages/did-provider-jwk/src/jwkDidUtils.ts b/packages/did-provider-jwk/src/jwkDidUtils.ts index 9ae6e4459..e53bf0afa 100644 --- a/packages/did-provider-jwk/src/jwkDidUtils.ts +++ b/packages/did-provider-jwk/src/jwkDidUtils.ts @@ -1,7 +1,8 @@ import { JwkDidSupportedKeyTypes, KeyUse, SupportedKeyTypes } from './types/jwk-provider-types.js' import type { VerificationMethod, JsonWebKey } from 'did-resolver' import { hexToBytes, bytesToBase64url, extractPublicKeyHex } from '@veramo/utils' -import elliptic from 'elliptic' +import { secp256k1 } from '@noble/curves/secp256k1' +import { p256 } from '@noble/curves/p256' export function getKeyUse(keyType: JwkDidSupportedKeyTypes, passedKeyUse?: KeyUse): KeyUse { if (passedKeyUse) { @@ -54,33 +55,28 @@ function createJWK( const keyUse = getKeyUse(keyType, passedKeyUse) switch (keyType) { case SupportedKeyTypes.Secp256k1: { - const EC = new elliptic.ec('secp256k1') - const pubPoint = EC.keyFromPublic(pubKey, 'hex').getPublic() - const x = pubPoint.getX() - const y = pubPoint.getY() + const point = secp256k1.ProjectivePoint.fromHex(pubKey).toAffine() return { alg: 'ES256K', crv: 'secp256k1', kty: 'EC', ...(keyUse && { use: keyUse }), - x: bytesToBase64url(hexToBytes(x.toString('hex'))), - y: bytesToBase64url(hexToBytes(y.toString('hex'))), + // FIXME: test endianness of the toString(16) output + x: bytesToBase64url(hexToBytes(point.x.toString(16))), + y: bytesToBase64url(hexToBytes(point.y.toString(16))), } as JsonWebKey } case SupportedKeyTypes.Secp256r1: { - const EC = new elliptic.ec('p256') - const pubPoint = EC.keyFromPublic(pubKey, 'hex').getPublic() - const x = pubPoint.getX() - const y = pubPoint.getY() + const point = p256.ProjectivePoint.fromHex(pubKey).toAffine() return { alg: 'ES256', crv: 'P-256', kty: 'EC', ...(keyUse && { use: keyUse }), - x: bytesToBase64url(hexToBytes(x.toString('hex'))), - y: bytesToBase64url(hexToBytes(y.toString('hex'))), + x: bytesToBase64url(hexToBytes(point.x.toString(16))), + y: bytesToBase64url(hexToBytes(point.y.toString(16))), } as JsonWebKey } case SupportedKeyTypes.Ed25519: diff --git a/packages/did-provider-jwk/src/types/jwk-provider-types.ts b/packages/did-provider-jwk/src/types/jwk-provider-types.ts index 514c71ead..be8899115 100644 --- a/packages/did-provider-jwk/src/types/jwk-provider-types.ts +++ b/packages/did-provider-jwk/src/types/jwk-provider-types.ts @@ -1,26 +1,26 @@ -export type JwkCreateIdentifierOptions = { - keyType?: JwkDidSupportedKeyTypes - privateKeyHex?: string - keyUse?: KeyUse -} - -export type JwkDidImportOrGenerateKeyArgs = { - kms: string - options: ImportOrGenerateKeyOpts -} - -type ImportOrGenerateKeyOpts = { - keyType: JwkDidSupportedKeyTypes - privateKeyHex?: string -} - -export type JwkDidSupportedKeyTypes = 'Secp256r1' | 'Secp256k1' | 'Ed25519' | 'X25519' - -export enum SupportedKeyTypes { - Secp256r1 = 'Secp256r1', - Secp256k1 = 'Secp256k1', - Ed25519 = 'Ed25519', - X25519 = 'X25519', -} - -export type KeyUse = 'sig' | 'enc' +export type JwkCreateIdentifierOptions = { + keyType?: JwkDidSupportedKeyTypes + privateKeyHex?: string + keyUse?: KeyUse +} + +export type JwkDidImportOrGenerateKeyArgs = { + kms: string + options: ImportOrGenerateKeyOpts +} + +type ImportOrGenerateKeyOpts = { + keyType: JwkDidSupportedKeyTypes + privateKeyHex?: string +} + +export enum SupportedKeyTypes { + Secp256r1 = 'Secp256r1', + Secp256k1 = 'Secp256k1', + Ed25519 = 'Ed25519', + X25519 = 'X25519', +} + +export type JwkDidSupportedKeyTypes = keyof typeof SupportedKeyTypes + +export type KeyUse = 'sig' | 'enc' diff --git a/packages/key-manager/package.json b/packages/key-manager/package.json index 6ca444e7e..647234ad3 100644 --- a/packages/key-manager/package.json +++ b/packages/key-manager/package.json @@ -13,9 +13,10 @@ "@ethersproject/bytes": "^5.7.0", "@ethersproject/strings": "^5.7.0", "@ethersproject/transactions": "^5.7.0", - "@stablelib/ed25519": "^1.0.3", + "@noble/curves": "^1.0.0", "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", + "@veramo/utils": "workspace:^", "debug": "^4.3.4", "did-jwt": "^7.2.1", "uint8arrays": "^4.0.3", diff --git a/packages/key-manager/src/key-manager.ts b/packages/key-manager/src/key-manager.ts index f5ecdb710..9056e9ead 100644 --- a/packages/key-manager/src/key-manager.ts +++ b/packages/key-manager/src/key-manager.ts @@ -1,29 +1,29 @@ import { AbstractKeyStore } from './abstract-key-store.js' import { AbstractKeyManagementSystem } from './abstract-key-management-system.js' import { + IAgentPlugin, IKey, IKeyManager, - IAgentPlugin, IKeyManagerCreateArgs, - IKeyManagerGetArgs, + IKeyManagerDecryptJWEArgs, IKeyManagerDeleteArgs, IKeyManagerEncryptJWEArgs, - IKeyManagerDecryptJWEArgs, - IKeyManagerSignJWTArgs, - IKeyManagerSignEthTXArgs, - IKeyManagerSignArgs, + IKeyManagerGetArgs, IKeyManagerSharedSecretArgs, - TKeyType, - MinimalImportableKey, + IKeyManagerSignArgs, + IKeyManagerSignEthTXArgs, + IKeyManagerSignJWTArgs, ManagedKeyInfo, + MinimalImportableKey, + TKeyType, } from '@veramo/core-types' import schema from '@veramo/core-types/build/plugin.schema.json' assert { type: 'json' } import * as u8a from 'uint8arrays' -import { JWE, createAnonDecrypter, createAnonEncrypter, createJWE, decryptJWE, ECDH } from 'did-jwt' +import { createAnonDecrypter, createAnonEncrypter, createJWE, decryptJWE, type ECDH, type JWE } from 'did-jwt' import { arrayify, hexlify } from '@ethersproject/bytes' -import { serialize, computeAddress } from '@ethersproject/transactions' -import { toUtf8String, toUtf8Bytes } from '@ethersproject/strings' -import { convertPublicKeyToX25519 } from '@stablelib/ed25519' +import { computeAddress, serialize } from '@ethersproject/transactions' +import { toUtf8Bytes, toUtf8String } from '@ethersproject/strings' +import { convertEd25519PublicKeyToX25519 } from '@veramo/utils' import Debug from 'debug' const debug = Debug('veramo:key-manager') @@ -131,7 +131,7 @@ export class KeyManager implements IAgentPlugin { let recipientPublicKey: Uint8Array if (to.type === 'Ed25519') { recipientPublicKey = arrayify('0x' + to.publicKeyHex) - recipientPublicKey = convertPublicKeyToX25519(recipientPublicKey) + recipientPublicKey = convertEd25519PublicKeyToX25519(recipientPublicKey) } else if (to.type === 'X25519') { recipientPublicKey = arrayify('0x' + to.publicKeyHex) } else { diff --git a/packages/key-manager/tsconfig.json b/packages/key-manager/tsconfig.json index 70dd58907..13d04d021 100644 --- a/packages/key-manager/tsconfig.json +++ b/packages/key-manager/tsconfig.json @@ -5,5 +5,12 @@ "outDir": "build", "declarationDir": "build" }, - "references": [{ "path": "../core-types" }] + "references": [ + { + "path": "../core-types" + }, + { + "path": "../utils" + } + ] } diff --git a/packages/kms-local/package.json b/packages/kms-local/package.json index 51acf0ffc..3763ac250 100644 --- a/packages/kms-local/package.json +++ b/packages/kms-local/package.json @@ -17,22 +17,17 @@ "@ethersproject/strings": "^5.7.0", "@ethersproject/transactions": "^5.7.0", "@ethersproject/wallet": "^5.7.0", - "@stablelib/ed25519": "^1.0.3", + "@noble/curves": "^1.0.0", "@stablelib/nacl": "^1.0.4", "@stablelib/random": "^1.0.2", - "@stablelib/x25519": "^1.0.3", "@veramo/core-types": "workspace:^", "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", - "base-58": "^0.0.1", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.1", - "elliptic": "^6.5.4", - "uint8arrays": "^4.0.3" + "did-jwt": "^7.1.0-alpha.1" }, "devDependencies": { "@types/debug": "4.1.8", - "@types/elliptic": "6.4.14", "typescript": "5.1.3" }, "files": [ diff --git a/packages/kms-local/src/__tests__/kms-local.test.ts b/packages/kms-local/src/__tests__/kms-local.test.ts index 2f4cd5c6e..aa0302b81 100644 --- a/packages/kms-local/src/__tests__/kms-local.test.ts +++ b/packages/kms-local/src/__tests__/kms-local.test.ts @@ -1,9 +1,40 @@ import { KeyManagementSystem } from '../key-management-system.js' import { TKeyType } from '../../../core-types/src' import { MemoryPrivateKeyStore } from '../../../key-manager/src' -import * as u8a from 'uint8arrays' +import { + bytesToHex, + convertEd25519PrivateKeyToX25519, + convertEd25519PublicKeyToX25519, + hexToBytes, + stringToUtf8Bytes, +} from '../../../utils/src' +import { randomBytes } from '@stablelib/random' +import { + convertPublicKeyToX25519, + convertSecretKeyToX25519, + generateKeyPairFromSeed, +} from '@stablelib/ed25519' describe('@veramo/kms-local', () => { + it('should import and convert ed25519 key', async () => { + const kms = new KeyManagementSystem(new MemoryPrivateKeyStore()) + const privateBytes = randomBytes(32) + const key = await kms.importKey({ + privateKeyHex: bytesToHex(privateBytes), + type: 'Ed25519', + }) + const pair = generateKeyPairFromSeed(privateBytes) + expect(key.publicKeyHex).toEqual(bytesToHex(pair.publicKey)) + + const xprivNoble = convertEd25519PrivateKeyToX25519(privateBytes) + const xprivStable = convertSecretKeyToX25519(privateBytes) + expect(bytesToHex(xprivNoble)).toEqual(bytesToHex(xprivStable)) + + const xpubNoble = convertEd25519PublicKeyToX25519(hexToBytes(key.publicKeyHex)) + const xpubStable = convertPublicKeyToX25519(hexToBytes(key.publicKeyHex)) + expect(bytesToHex(xpubNoble)).toEqual(bytesToHex(xpubStable)) + }) + it('should compute a shared secret Ed+Ed', async () => { const kms = new KeyManagementSystem(new MemoryPrivateKeyStore()) const myKey = { @@ -104,38 +135,36 @@ describe('@veramo/kms-local', () => { describe('@veramo/kms-local Secp256r1 support', () => { it('should generate a managed key', async () => { const kms = new KeyManagementSystem(new MemoryPrivateKeyStore()) - const key = await kms.createKey({type: 'Secp256r1'}) + const key = await kms.createKey({ type: 'Secp256r1' }) expect(key.type).toEqual('Secp256r1') expect(key.publicKeyHex).toHaveLength(66) expect(key.kid).toBeDefined() expect(key.meta).toEqual({ - "algorithms": [ - "ES256" - ] + algorithms: ['ES256'], }) }) it('should import a private key', async () => { const kms = new KeyManagementSystem(new MemoryPrivateKeyStore()) const privateKeyHex = '96fe4d2b4a5d3abc4679fe39aa5d4b76990ff416e6ff403a58bd722cf8352f94' - const key = await kms.importKey({kid: 'test', privateKeyHex, type: 'Secp256r1'}) + const key = await kms.importKey({ kid: 'test', privateKeyHex, type: 'Secp256r1' }) expect(key.type).toEqual('Secp256r1') expect(key.publicKeyHex).toEqual('03930fc234a12c939ccb1591a7c394088a30a32e81ac832ed8a0136e32bd73f792') expect(key.kid).toEqual('test') expect(key.meta).toEqual({ - "algorithms": [ - "ES256" - ] + algorithms: ['ES256'], }) }) it('should sign input data', async () => { const kms = new KeyManagementSystem(new MemoryPrivateKeyStore()) const privateKeyHex = '96fe4d2b4a5d3abc4679fe39aa5d4b76990ff416e6ff403a58bd722cf8352f94' - const data = u8a.fromString("test", 'utf-8'); + const data = stringToUtf8Bytes('test') - const key = await kms.importKey({kid: 'test', privateKeyHex, type: 'Secp256r1'}) - const signature = await kms.sign({keyRef: key, data, algorithm: 'ES256'}) - expect(signature).toEqual('tTHhkwVSNk-C84zHS_ObzpyMNVoFopwUkR_pKxSC4kPyEIZrB5L36AFWHQQhp827D9aUSMKi38yiCrSfI4h7VA') + const key = await kms.importKey({ kid: 'test', privateKeyHex, type: 'Secp256r1' }) + const signature = await kms.sign({ keyRef: key, data, algorithm: 'ES256' }) + expect(signature).toEqual( + 'tTHhkwVSNk-C84zHS_ObzpyMNVoFopwUkR_pKxSC4kPyEIZrB5L36AFWHQQhp827D9aUSMKi38yiCrSfI4h7VA', + ) }) }) diff --git a/packages/kms-local/src/__tests__/secret-box.test.ts b/packages/kms-local/src/__tests__/secret-box.test.ts index 66cc00cd2..e45a27810 100644 --- a/packages/kms-local/src/__tests__/secret-box.test.ts +++ b/packages/kms-local/src/__tests__/secret-box.test.ts @@ -1,6 +1,4 @@ import { SecretBox } from '../secret-box.js' -// import * as elliptic from 'elliptic' -// import * as hash from 'hash.js' describe('@veramo/kms-local', () => { it('should encrypt and decrypt', async () => { diff --git a/packages/kms-local/src/key-management-system.ts b/packages/kms-local/src/key-management-system.ts index 40a2dd2d5..5ac4143bb 100644 --- a/packages/kms-local/src/key-management-system.ts +++ b/packages/kms-local/src/key-management-system.ts @@ -1,19 +1,13 @@ -import { TKeyType, IKey, ManagedKeyInfo, MinimalImportableKey, RequireOnly } from '@veramo/core-types' -import { AbstractKeyManagementSystem, AbstractPrivateKeyStore, Eip712Payload } from '@veramo/key-manager' -import { ManagedPrivateKey } from '@veramo/key-manager' +import { IKey, ManagedKeyInfo, MinimalImportableKey, RequireOnly, TKeyType } from '@veramo/core-types' +import { + AbstractKeyManagementSystem, + AbstractPrivateKeyStore, + Eip712Payload, + ManagedPrivateKey, +} from '@veramo/key-manager' import { EdDSASigner, ES256KSigner, ES256Signer } from 'did-jwt' -import { - generateKeyPair as generateSigningKeyPair, - convertPublicKeyToX25519, - convertSecretKeyToX25519, - extractPublicKeyFromSecretKey, -} from '@stablelib/ed25519' -import { - generateKeyPair as generateEncryptionKeypair, - generateKeyPairFromSeed as generateEncryptionKeyPairFromSeed, - sharedKey, -} from '@stablelib/x25519' +import { ed25519, x25519 } from '@noble/curves/ed25519' import { TransactionRequest } from '@ethersproject/abstract-provider' import { toUtf8String } from '@ethersproject/strings' import { parse } from '@ethersproject/transactions' @@ -21,9 +15,15 @@ import { Wallet } from '@ethersproject/wallet' import { SigningKey } from '@ethersproject/signing-key' import { randomBytes } from '@ethersproject/random' import { arrayify, hexlify } from '@ethersproject/bytes' -import * as u8a from 'uint8arrays' import Debug from 'debug' -import elliptic from 'elliptic' +import { p256 } from '@noble/curves/p256' +import { + bytesToHex, + concat, + convertEd25519PrivateKeyToX25519, + convertEd25519PublicKeyToX25519, + hexToBytes, +} from '@veramo/utils' const debug = Debug('veramo:kms:local') @@ -65,10 +65,11 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem { switch (type) { case 'Ed25519': { - const keyPairEd25519 = generateSigningKeyPair() + const ed25519SecretKey = ed25519.utils.randomPrivateKey() + const publicKey = ed25519.utils.getExtendedPublicKey(ed25519SecretKey).pointBytes key = await this.importKey({ type, - privateKeyHex: u8a.toString(keyPairEd25519.secretKey, 'base16'), + privateKeyHex: bytesToHex(concat([ed25519SecretKey, publicKey])), }) break } @@ -77,15 +78,15 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem { const privateBytes = randomBytes(32) key = await this.importKey({ type, - privateKeyHex: u8a.toString(privateBytes, 'base16'), + privateKeyHex: bytesToHex(privateBytes), }) break } case 'X25519': { - const keyPairX25519 = generateEncryptionKeypair() + const secretX25519 = x25519.utils.randomPrivateKey() key = await this.importKey({ type, - privateKeyHex: u8a.toString(keyPairX25519.secretKey, 'base16'), + privateKeyHex: bytesToHex(secretX25519), }) break } @@ -169,17 +170,17 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem { } let myKeyBytes = arrayify('0x' + myKey.privateKeyHex) if (myKey.type === 'Ed25519') { - myKeyBytes = convertSecretKeyToX25519(myKeyBytes) + myKeyBytes = convertEd25519PrivateKeyToX25519(myKeyBytes) } else if (myKey.type !== 'X25519') { throw new Error(`not_supported: can't compute shared secret for type=${myKey.type}`) } let theirKeyBytes = arrayify('0x' + theirKey.publicKeyHex) if (theirKey.type === 'Ed25519') { - theirKeyBytes = convertPublicKeyToX25519(theirKeyBytes) + theirKeyBytes = convertEd25519PublicKeyToX25519(theirKeyBytes) } else if (theirKey.type !== 'X25519') { throw new Error(`not_supported: can't compute shared secret for type=${theirKey.type}`) } - const shared = sharedKey(myKeyBytes, theirKeyBytes) + const shared = x25519.getSharedSecret(myKeyBytes, theirKeyBytes) return hexlify(shared).substring(2) } @@ -287,14 +288,15 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem { } /** - * Converts a {@link @veramo/key-manager#ManagedPrivateKey | ManagedPrivateKey} to {@link @veramo/core-types#ManagedKeyInfo} + * Converts a {@link @veramo/key-manager#ManagedPrivateKey | ManagedPrivateKey} to + * {@link @veramo/core-types#ManagedKeyInfo} */ private asManagedKeyInfo(args: RequireOnly): ManagedKeyInfo { let key: Partial switch (args.type) { case 'Ed25519': { - const secretKey = u8a.fromString(args.privateKeyHex.toLowerCase(), 'base16') - const publicKeyHex = u8a.toString(extractPublicKeyFromSecretKey(secretKey), 'base16') + const secretKey = hexToBytes(args.privateKeyHex.toLowerCase()) + const publicKeyHex = bytesToHex(ed25519.getPublicKey(secretKey.subarray(0, 32))) key = { type: args.type, kid: args.alias || publicKeyHex, @@ -306,7 +308,7 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem { break } case 'Secp256k1': { - const privateBytes = u8a.fromString(args.privateKeyHex.toLowerCase(), 'base16') + const privateBytes = hexToBytes(args.privateKeyHex.toLowerCase()) const keyPair = new SigningKey(privateBytes) const publicKeyHex = keyPair.publicKey.substring(2) key = { @@ -327,10 +329,8 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem { break } case 'Secp256r1': { - const privateBytes = u8a.fromString(args.privateKeyHex.toLowerCase(), 'base16') - const secp256r1 = new elliptic.ec('p256') - const keyPair: elliptic.ec.KeyPair = secp256r1.keyFromPrivate(privateBytes) - const publicKeyHex = keyPair.getPublic(true, 'hex') + const privateBytes = hexToBytes(args.privateKeyHex.toLowerCase()) + const publicKeyHex = bytesToHex(p256.getPublicKey(privateBytes, true)) key = { type: args.type, kid: args.alias || publicKeyHex, @@ -342,9 +342,8 @@ export class KeyManagementSystem extends AbstractKeyManagementSystem { break } case 'X25519': { - const secretKeyBytes = u8a.fromString(args.privateKeyHex.toLowerCase(), 'base16') - const keyPairX25519 = generateEncryptionKeyPairFromSeed(secretKeyBytes) - const publicKeyHex = u8a.toString(keyPairX25519.publicKey, 'base16') + const secretKeyBytes = hexToBytes(args.privateKeyHex.toLowerCase()) + const publicKeyHex = bytesToHex(x25519.getPublicKey(secretKeyBytes)) key = { type: args.type, kid: args.alias || publicKeyHex, diff --git a/packages/kms-local/tsconfig.json b/packages/kms-local/tsconfig.json index 2979e7135..b53426eee 100644 --- a/packages/kms-local/tsconfig.json +++ b/packages/kms-local/tsconfig.json @@ -6,5 +6,15 @@ "declarationDir": "build", "skipLibCheck": true }, - "references": [{ "path": "../core-types" }, { "path": "../key-manager" }] + "references": [ + { + "path": "../core-types" + }, + { + "path": "../key-manager" + }, + { + "path": "../utils" + } + ] } diff --git a/packages/utils/package.json b/packages/utils/package.json index 8f8d9e7cd..87ec4e7c2 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -12,22 +12,20 @@ "dependencies": { "@ethersproject/signing-key": "^5.7.0", "@ethersproject/transactions": "^5.7.0", - "@stablelib/ed25519": "^1.0.3", + "@noble/curves": "^1.0.0", + "@noble/hashes": "^1.3.0", "@veramo/core-types": "workspace:^", - "blakejs": "^1.1.1", "credential-status": "^2.0.5", "cross-fetch": "^3.1.6", "debug": "^4.3.3", "did-jwt": "^7.1.0-alpha.1", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", - "elliptic": "^6.5.4", "multiformats": "^12.0.0", "uint8arrays": "^4.0.3" }, "devDependencies": { "@types/debug": "4.1.8", - "@types/elliptic": "6.4.14", "@types/uuid": "9.0.1" }, "files": [ diff --git a/packages/utils/src/credential-utils.ts b/packages/utils/src/credential-utils.ts index a14a0ba74..73f9fa1fb 100644 --- a/packages/utils/src/credential-utils.ts +++ b/packages/utils/src/credential-utils.ts @@ -9,10 +9,10 @@ import { W3CVerifiableCredential, W3CVerifiablePresentation, } from '@veramo/core-types' -import pkg from 'blakejs' -const { blake2bHex } = pkg import { decodeJWT } from 'did-jwt' import { normalizeCredential, normalizePresentation } from 'did-jwt-vc' +import { blake2b } from '@noble/hashes/blake2b' +import { bytesToHex } from './encodings.js' /** * Every Verifiable Credential `@context` property must contain this. @@ -96,7 +96,7 @@ export function computeEntryHash( } else { hashable = JSON.stringify(input) } - return blake2bHex(hashable) + return bytesToHex(blake2b(hashable)) } /** diff --git a/packages/utils/src/did-utils.ts b/packages/utils/src/did-utils.ts index 93651b01d..d4dfc4696 100644 --- a/packages/utils/src/did-utils.ts +++ b/packages/utils/src/did-utils.ts @@ -1,4 +1,3 @@ -import { convertPublicKeyToX25519, convertSecretKeyToX25519 } from '@stablelib/ed25519' import { computePublicKey } from '@ethersproject/signing-key' import { computeAddress } from '@ethersproject/transactions' import { DIDDocumentSection, IAgentContext, IIdentifier, IKey, IResolver } from '@veramo/core-types' @@ -9,13 +8,39 @@ import { _NormalizedVerificationMethod, } from './types/utility-types.js' import { isDefined } from './type-utils.js' -import * as u8a from 'uint8arrays' -import elliptic from 'elliptic' import Debug from 'debug' -import { hexToBytes, bytesToHex, base64ToBytes, base58ToBytes, multibaseKeyToBytes } from './encodings.js' +import { base58ToBytes, base64ToBytes, bytesToHex, hexToBytes, multibaseKeyToBytes } from './encodings.js' +import { ed25519 } from '@noble/curves/ed25519' +import { secp256k1 } from '@noble/curves/secp256k1' const debug = Debug('veramo:utils') +/** + * Converts Ed25519 public keys to X25519 + * @param publicKey - The bytes of an Ed25519P public key + * + * @beta This API may change without a BREAKING CHANGE notice. + */ +export function convertEd25519PublicKeyToX25519(publicKey: Uint8Array): Uint8Array { + // FIXME: Once https://github.com/paulmillr/noble-curves/issues/31 gets released, this code can be simplified + const Fp = ed25519.CURVE.Fp + const { y } = ed25519.ExtendedPoint.fromHex(publicKey) + const _1n = BigInt(1) + return Fp.toBytes(Fp.create((_1n + y) * Fp.inv(_1n - y))) +} + +/** + * Converts Ed25519 private keys to X25519 + * @param privateKey - The bytes of an Ed25519P private key + * + * @beta This API may change without a BREAKING CHANGE notice. + */ +export function convertEd25519PrivateKeyToX25519(privateKey: Uint8Array): Uint8Array { + // FIXME: Once https://github.com/paulmillr/noble-curves/issues/31 gets released, this code can be simplified + const hashed = ed25519.CURVE.hash(privateKey.subarray(0, 32)) + return ed25519?.CURVE?.adjustScalarBytes?.(hashed)?.subarray(0, 32) ?? new Uint8Array(0) +} + /** * Converts any Ed25519 keys of an {@link @veramo/core-types#IIdentifier | IIdentifier} to X25519 to be usable for * encryption. @@ -30,11 +55,11 @@ export function convertIdentifierEncryptionKeys(identifier: IIdentifier): IKey[] return identifier.keys .map((key) => { if (key.type === 'Ed25519') { - const publicBytes = u8a.fromString(key.publicKeyHex, 'base16') - key.publicKeyHex = u8a.toString(convertPublicKeyToX25519(publicBytes), 'base16') + const publicBytes = hexToBytes(key.publicKeyHex) + key.publicKeyHex = bytesToHex(convertEd25519PublicKeyToX25519(publicBytes)) if (key.privateKeyHex) { - const privateBytes = u8a.fromString(key.privateKeyHex) - key.privateKeyHex = u8a.toString(convertSecretKeyToX25519(privateBytes), 'base16') + const privateBytes = hexToBytes(key.privateKeyHex) + key.privateKeyHex = bytesToHex(convertEd25519PrivateKeyToX25519(privateBytes)) } key.type = 'X25519' } else if (key.type !== 'X25519') { @@ -61,7 +86,7 @@ export function compressIdentifierSecp256k1Keys(identifier: IIdentifier): IKey[] .map((key) => { if (key.type === 'Secp256k1') { if (key.publicKeyHex) { - const publicBytes = u8a.fromString(key.publicKeyHex, 'base16') + const publicBytes = hexToBytes(key.publicKeyHex) key.publicKeyHex = computePublicKey(publicBytes, true).substring(2) key.meta = { ...key.meta } key.meta.ethereumAddress = computeAddress('0x' + key.publicKeyHex) @@ -156,15 +181,10 @@ function extractPublicKeyBytes(pk: VerificationMethod): Uint8Array { pk.publicKeyJwk.x && pk.publicKeyJwk.y ) { - const secp256k1 = new elliptic.ec('secp256k1') - return hexToBytes( - secp256k1 - .keyFromPublic({ - x: bytesToHex(base64ToBytes(pk.publicKeyJwk.x)), - y: bytesToHex(base64ToBytes(pk.publicKeyJwk.y)), - }) - .getPublic('hex'), - ) + return secp256k1.ProjectivePoint.fromAffine({ + x: BigInt('0x' + bytesToHex(base64ToBytes(pk.publicKeyJwk.x))), + y: BigInt('0x' + bytesToHex(base64ToBytes(pk.publicKeyJwk.y))), + }).toRawBytes(false) } else if ( pk.publicKeyJwk && (pk.publicKeyJwk.crv === 'Ed25519' || pk.publicKeyJwk.crv === 'X25519') && @@ -355,7 +375,7 @@ export function extractPublicKeyHex(pk: _ExtendedVerificationMethod, convert: bo ['Ed25519', 'Ed25519VerificationKey2018', 'Ed25519VerificationKey2020'].includes(pk.type) || (pk.type === 'JsonWebKey2020' && pk.publicKeyJwk?.crv === 'Ed25519') ) { - keyBytes = convertPublicKeyToX25519(keyBytes) + keyBytes = convertEd25519PublicKeyToX25519(keyBytes) } else if ( !['X25519', 'X25519KeyAgreementKey2019', 'X25519KeyAgreementKey2020'].includes(pk.type) && !(pk.type === 'JsonWebKey2020' && pk.publicKeyJwk?.crv === 'X25519') @@ -363,5 +383,5 @@ export function extractPublicKeyHex(pk: _ExtendedVerificationMethod, convert: bo return '' } } - return u8a.toString(keyBytes, 'base16') + return bytesToHex(keyBytes) } diff --git a/packages/utils/types/import.types.d.ts b/packages/utils/types/import.types.d.ts deleted file mode 100644 index d3f1b7fe3..000000000 --- a/packages/utils/types/import.types.d.ts +++ /dev/null @@ -1 +0,0 @@ -declare module 'blakejs' From e63424038a9a5327e223496a4ded538422b4c5e3 Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Tue, 16 May 2023 19:05:52 +0200 Subject: [PATCH 05/11] feat(did-comm): add AES encryption and key wrapping --- packages/credential-status/package.json | 2 +- packages/credential-w3c/package.json | 2 +- .../src/__tests__/action-handler.test.ts | 2 +- .../src/__tests__/message-handler.test.ts | 2 +- packages/credential-w3c/src/index.ts | 2 +- .../data-store-json/src/data-store-json.ts | 9 +- packages/did-comm/package.json | 7 +- .../did-comm/src/__tests__/encryption.test.ts | 826 ++++++++++++++++++ .../src/__tests__/trust-ping-interop.test.ts | 2 +- packages/did-comm/src/didcomm.ts | 48 +- .../did-comm/src/encryption/aesEncryption.ts | 259 ++++++ .../did-comm/src/encryption/p256-ECDH-1PU.ts | 87 ++ .../did-comm/src/encryption/p256-ECDH-ES.ts | 53 ++ .../src/protocols/routing-message-handler.ts | 8 +- .../protocols/trust-ping-message-handler.ts | 23 +- packages/did-comm/src/utils.ts | 25 + packages/did-jwt/package.json | 2 +- .../did-provider-key/src/key-did-provider.ts | 2 +- packages/key-manager/package.json | 2 +- packages/kms-local/package.json | 2 +- packages/selective-disclosure/package.json | 2 +- .../src/action-handler.ts | 14 +- packages/utils/package.json | 2 +- packages/utils/src/did-utils.ts | 6 +- 24 files changed, 1327 insertions(+), 62 deletions(-) create mode 100644 packages/did-comm/src/__tests__/encryption.test.ts create mode 100644 packages/did-comm/src/encryption/aesEncryption.ts create mode 100644 packages/did-comm/src/encryption/p256-ECDH-1PU.ts create mode 100644 packages/did-comm/src/encryption/p256-ECDH-ES.ts diff --git a/packages/credential-status/package.json b/packages/credential-status/package.json index 7d6b0e819..aea16f6c3 100644 --- a/packages/credential-status/package.json +++ b/packages/credential-status/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", "credential-status": "^2.0.5", - "did-jwt": "^7.1.0-alpha.1", + "did-jwt": "^7.1.0-alpha.3", "did-resolver": "^4.0.1" }, "devDependencies": { diff --git a/packages/credential-w3c/package.json b/packages/credential-w3c/package.json index cc8c90c9a..dba0e1b9f 100644 --- a/packages/credential-w3c/package.json +++ b/packages/credential-w3c/package.json @@ -18,7 +18,7 @@ "@veramo/utils": "workspace:^", "canonicalize": "^2.0.0", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.1", + "did-jwt": "^7.1.0-alpha.3", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", "uuid": "^9.0.0" diff --git a/packages/credential-w3c/src/__tests__/action-handler.test.ts b/packages/credential-w3c/src/__tests__/action-handler.test.ts index 9a0f03fdf..c2b29dc56 100644 --- a/packages/credential-w3c/src/__tests__/action-handler.test.ts +++ b/packages/credential-w3c/src/__tests__/action-handler.test.ts @@ -22,7 +22,7 @@ import { TAgent, VerifiableCredential, } from '../../../core-types/src' -import { CredentialPlugin } from '../action-handler' +import { CredentialPlugin } from '../action-handler.js' const mockIdentifiers: IIdentifier[] = [ { diff --git a/packages/credential-w3c/src/__tests__/message-handler.test.ts b/packages/credential-w3c/src/__tests__/message-handler.test.ts index fa9c77ad2..218221b72 100644 --- a/packages/credential-w3c/src/__tests__/message-handler.test.ts +++ b/packages/credential-w3c/src/__tests__/message-handler.test.ts @@ -3,7 +3,7 @@ import { Message } from '../../../message-handler/src' import { IContext, MessageTypes, W3cMessageHandler } from '../message-handler.js' import { jest } from '@jest/globals' import { blake2b } from '@noble/hashes/blake2b' -import { bytesToHex, hexToBytes } from '../../../utils/src' +import { bytesToHex } from '../../../utils/src' describe('@veramo/credential-w3c', () => { const handler = new W3cMessageHandler() diff --git a/packages/credential-w3c/src/index.ts b/packages/credential-w3c/src/index.ts index 79e953057..ce71ea28e 100644 --- a/packages/credential-w3c/src/index.ts +++ b/packages/credential-w3c/src/index.ts @@ -19,4 +19,4 @@ const CredentialIssuer = CredentialPlugin export { CredentialIssuer, CredentialPlugin } // For backward compatibility, re-export the plugin types that were moved to core in v4 -export { ICredentialIssuer, ICredentialVerifier } from '@veramo/core-types' +export type { ICredentialIssuer, ICredentialVerifier } from '@veramo/core-types' diff --git a/packages/data-store-json/src/data-store-json.ts b/packages/data-store-json/src/data-store-json.ts index 2c20869d4..668b5b189 100644 --- a/packages/data-store-json/src/data-store-json.ts +++ b/packages/data-store-json/src/data-store-json.ts @@ -3,9 +3,9 @@ import { FindArgs, IAgentPlugin, IDataStore, + IDataStoreDeleteMessageArgs, IDataStoreDeleteVerifiableCredentialArgs, IDataStoreGetMessageArgs, - IDataStoreDeleteMessageArgs, IDataStoreGetVerifiableCredentialArgs, IDataStoreGetVerifiablePresentationArgs, IDataStoreORM, @@ -23,10 +23,11 @@ import { UniqueVerifiablePresentation, VerifiableCredential, VerifiablePresentation, + W3CVerifiableCredential, } from '@veramo/core-types' import schema from '@veramo/core-types/build/plugin.schema.json' assert { type: 'json' } import { asArray, computeEntryHash, extractIssuer } from '@veramo/utils' -import { serialize, deserialize } from '@ungap/structured-clone' +import { deserialize, serialize } from '@ungap/structured-clone' import { ClaimTableEntry, CredentialTableEntry, @@ -122,7 +123,7 @@ export class DataStoreJson implements IAgentPlugin { if (message?.from && !this.cacheTree.dids[message.from]) { this.cacheTree.dids[message.from] = { did: message.from, provider: '', keys: [], services: [] } } - asArray(message.to).forEach((did) => { + asArray(message.to).forEach((did: string) => { if (!this.cacheTree.dids[did]) { this.cacheTree.dids[did] = { did, provider: '', keys: [], services: [] } } @@ -294,7 +295,7 @@ export class DataStoreJson implements IAgentPlugin { expirationDate = new Date(vp.expirationDate) } - const credentials: VerifiableCredential[] = asArray(vp.verifiableCredential).map((cred) => { + const credentials: VerifiableCredential[] = asArray(vp.verifiableCredential).map((cred: W3CVerifiableCredential) => { if (typeof cred === 'string') { return normalizeCredential(cred) } else { diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index 5b16edc56..2099ede11 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -19,13 +19,18 @@ }, "dependencies": { "@ethersproject/signing-key": "^5.7.0", + "@noble/curves": "^1.0.0", + "@stablelib/aes": "^1.0.1", + "@stablelib/aes-kw": "^1.0.1", + "@stablelib/gcm": "^1.0.2", "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.1", + "did-jwt": "^7.2.2", "did-resolver": "^4.0.1", + "isomorphic-webcrypto": "^2.3.8", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/did-comm/src/__tests__/encryption.test.ts b/packages/did-comm/src/__tests__/encryption.test.ts new file mode 100644 index 000000000..9dce01a2f --- /dev/null +++ b/packages/did-comm/src/__tests__/encryption.test.ts @@ -0,0 +1,826 @@ +import { createJWE, createX25519ECDH, Decrypter, decryptJWE, ECDH, Encrypter, JWE } from 'did-jwt' +import { randomBytes } from "@noble/hashes/utils"; +import { generateX25519KeyPairFromSeed } from "../utils.js"; +import { + a256gcmAnonDecrypterX25519WithA256KW, + a256gcmAnonEncrypterX25519WithA256KW, + a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW, + a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW, + xc20pAnonDecrypterX25519WithA256KW, + xc20pAnonEncrypterX25519WithA256KW, + xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, + xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, +} from '../encryption/aesEncryption.js' +import { decodeBase64url, encodeBase64url } from "../../../utils/src"; + +import * as u8a from 'uint8arrays' + +const test_vectors = { + pass: [ + { + key: 'b9NnuOCB0hm7YGNvaE9DMhwH_wjZA1-gWD6dA0JWdL0', + cleartext: + '{"id":"1234567890","typ":"application/didcomm-plain+json","type":"http://example.com/protocols/lets_do_lunch/1.0/proposal","from":"did:example:alice","to":["did:example:bob"],"created_time":1516269022,"expires_time":1516385931,"body":{"messagespecificattribute":"and its value"}}', + jwe: { + ciphertext: + 'KWS7gJU7TbyJlcT9dPkCw-ohNigGaHSukR9MUqFM0THbCTCNkY-g5tahBFyszlKIKXs7qOtqzYyWbPou2q77XlAeYs93IhF6NvaIjyNqYklvj-OtJt9W2Pj5CLOMdsR0C30wchGoXd6wEQZY4ttbzpxYznqPmJ0b9KW6ZP-l4_DSRYe9B-1oSWMNmqMPwluKbtguC-riy356Xbu2C9ShfWmpmjz1HyJWQhZfczuwkWWlE63g26FMskIZZd_jGpEhPFHKUXCFwbuiw_Iy3R0BIzmXXdK_w7PZMMPbaxssl2UeJmLQgCAP8j8TukxV96EKa6rGgULvlo7qibjJqsS5j03bnbxkuxwbfyu3OxwgVzFWlyHbUH6p', + protected: + 'eyJlcGsiOnsia3R5IjoiT0tQIiwiY3J2IjoiWDI1NTE5IiwieCI6IkpIanNtSVJaQWFCMHpSR193TlhMVjJyUGdnRjAwaGRIYlc1cmo4ZzBJMjQifSwiYXB2IjoiTmNzdUFuclJmUEs2OUEtcmtaMEw5WFdVRzRqTXZOQzNaZzc0QlB6NTNQQSIsInR5cCI6ImFwcGxpY2F0aW9uL2RpZGNvbW0tZW5jcnlwdGVkK2pzb24iLCJlbmMiOiJYQzIwUCIsImFsZyI6IkVDREgtRVMrQTI1NktXIn0', + recipients: [ + { + encrypted_key: '3n1olyBR3nY7ZGAprOx-b7wYAKza6cvOYjNwVg3miTnbLwPP_FmE1A', + header: { + kid: 'did:example:bob#key-x25519-1', + }, + }, + ], + tag: '6ylC_iAs4JvDQzXeY6MuYQ', + iv: 'ESpmcyGiZpRjc5urDela21TOOTW8Wqd1', + }, + }, + + { + key: '+Egu1APNlDqx3YHm1LAsAHeEQi7kCUvhIXunTMpuplQ=', + cleartext: 'i1WprsPZJy9VP2xiqbyHIQ3q0hOdleHb+e7wlV0u9e/+lzO4IYue0NqBcsrPfnF9EVqQkEpi2maC5ym79H4k4w==', + jwe: { + protected: 'eyJlbmMiOiJYQzIwUCJ9', + recipients: [ + { + header: { + alg: 'ECDH-ES+A256KW', + epk: { kty: 'OKP', crv: 'X25519', x: '2s6Xfe4ignhNvVHVn3s25FO4xBNTk170ZqqllhHHBVQ' }, + }, + encrypted_key: 'OHFmMeOC068rgtG_H6NRBvXh-n__bynU_lkL7xMo6hIPGRTW4yNmVA', + }, + { + header: { + alg: 'ECDH-ES+XC20PKW', + tag: 'oLF5ceVwDl11UMiNYIbnJw', + iv: '0__i0CcUPS_R_FOQ33hZJqAtxfsfouHj', + epk: { kty: 'OKP', crv: 'X25519', x: 'fcVzcQ3-lO-hmpDtLX_1N7Z1UP31nNCqjEz3SU23zUU' }, + }, + encrypted_key: 'PBYJSfnq2gunqyc3goI-vSCwF5bMBHvenvxs8q8ntsA', + }, + ], + iv: 'vw-eDC1N1KQZrAyTXsCh8bI4Xul2Ap0g', + ciphertext: + 'X9Qp6fnJIpcxbsKQete7nioEFC4sC9d0gS7SH4TDeSlSlSqT9ln3UP6x2hmjz-gn5hg5PEUFaIUkETNuBSyMzHyUpE_Lx5iNAzuRnstfpQ_ZG6hka93Mbw', + tag: '9FQnp03c5Us_d1OdPYM7hA', + }, + }, + + { + key: 'MCFWVpCL17Y6+Ck8mVhlHv0ezly3SWDEya4DS/4zU14=', + cleartext: 'q3kCxeF6O/OSCD2R2UjkhS+DMjCN09QPchTK91LOEk5w2HQEJ+Ewo1BpkEYAuRE2CDfcMp4hIYIKc+n88BDALA==', + jwe: { + protected: 'eyJlbmMiOiJYQzIwUCJ9', + recipients: [ + { + header: { + alg: 'ECDH-ES+A256KW', + epk: { kty: 'OKP', crv: 'X25519', x: 'h6HwUrtHy0gc7KA5PSrRYtIIJxr4V3L2b0lxhWwLhUo' }, + }, + encrypted_key: '21iyqdWq11QvnngzFHj3wkkIRVOK6rjsdFvXJFH0kMKc8FMA4BXOOg', + }, + { + header: { + alg: 'ECDH-ES+XC20PKW', + tag: 'TGlpNP9uMvW-y6Uc1jXfZg', + iv: 'szLQC8qOTAcTVbE_QCljXMaC8CmJX3T7', + epk: { kty: 'OKP', crv: 'X25519', x: '2rxr9f5MTxxTkmyWVGNnSX4coM3MvJguCRsQCrxt9w4' }, + }, + encrypted_key: 'ndhYa5ZyPr-X9FAeXLQladjmlZirzkmmHCm5rGr98s8', + }, + ], + iv: 'Msj-fX46TRocNzhGkzL81wKhfDb9qHeg', + ciphertext: + 'tcFKEWxhz-Q-nsnJppYqmFC5R0VT8fdNR0vJzUynlx--_3KDFIuDUdf0lwuwycbYXrEw94EyxfVZb3tkOADHXNaIC0njlB07_D7__eyK0N5bD88TXSe4lA', + tag: 'GNnsfuK6-OYVwVc5N0jyHg', + }, + }, + + { + key: 'KHJWEr94Z1qgaCCbsKu/oCxb07LR/ufntkr1Lu0stWU=', + cleartext: '2+YQ5xghWN7RL1BUPHgv39BJRynuZ2+KaiMRsBlnvZzjJclMYSY67SneTmysv3X3yP/DEDkZH2TVPFcHrJRYGg==', + jwe: { + protected: 'eyJlbmMiOiJYQzIwUCJ9', + recipients: [ + { + header: { + alg: 'ECDH-ES+A256KW', + epk: { kty: 'OKP', crv: 'X25519', x: 'e7nXXNUZHQQd1lPTK0bzXWteGZGRg2cr73RsaKr2Lyo' }, + }, + encrypted_key: 'OASoE721beho7x6dGXKj6LL9NR9z7OI12ZaisNHV3b6EyJjxbWIGeg', + }, + { + header: { + alg: 'ECDH-ES+XC20PKW', + tag: 'bdMaXGwUwNX-obqn7eqO3g', + iv: 'RzCIyIO4JJbLo544aqpFbIeH7pq1BIR3', + epk: { kty: 'OKP', crv: 'X25519', x: 'lVudXos0kqGtiGpgYj7W_CoWnlKAR5WiNeB_yHZhSS8' }, + }, + encrypted_key: 'iTxnM7J8iJQHash-un_EMElCjPEpVcXu0BVeKFLjJRM', + }, + ], + iv: 'EeBBbmkL5OvvGbuqqiPVZWUhKKJ2L4Pc', + ciphertext: + '3ODDtCTQKlX6k0CKOBEE0LsbdUreF7ZeeIj27_pmyZ6uYTKikePR1N24ozdO2oGIGuvC-e9aNMLD8lJmfIbQrCzO6DD-c0AB3xULUF-z92EtI9XaGp08uA', + tag: 'g0IWefR0xt-ubzkUJ2Ufeg', + }, + }, + ], + fail: [], + invalid: [], +} +describe('One recipient A256KW', () => { + let pubkey, secretkey, cleartext: Uint8Array, encrypter: Encrypter, decrypter: Decrypter + + beforeEach(() => { + secretkey = randomBytes(32) + pubkey = generateX25519KeyPairFromSeed(secretkey).publicKey + cleartext = u8a.fromString('hello world') + encrypter = xc20pAnonEncrypterX25519WithA256KW(pubkey) + decrypter = xc20pAnonDecrypterX25519WithA256KW(secretkey) + }) + + it('Creates with only ciphertext', async () => { + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter], {}, undefined, true) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected)).enc).toEqual('XC20P') + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + expect.assertions(4) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, decrypter)).rejects.toThrowError('Failed to decrypt') + }) +}) + +describe('Multiple recipients A256KW', () => { + let pubkey1, secretkey1, pubkey2, secretkey2, cleartext: Uint8Array + let encrypter1: Encrypter, decrypter1: Decrypter, encrypter2: Encrypter, decrypter2: Decrypter + + beforeEach(() => { + secretkey1 = randomBytes(32) + pubkey1 = generateX25519KeyPairFromSeed(secretkey1).publicKey + secretkey2 = randomBytes(32) + pubkey2 = generateX25519KeyPairFromSeed(secretkey2).publicKey + cleartext = u8a.fromString('my secret message') + encrypter1 = xc20pAnonEncrypterX25519WithA256KW(pubkey1) + decrypter1 = xc20pAnonDecrypterX25519WithA256KW(secretkey1) + encrypter2 = xc20pAnonEncrypterX25519WithA256KW(pubkey2) + decrypter2 = xc20pAnonDecrypterX25519WithA256KW(secretkey2) + }) + + it('Creates with only ciphertext', async () => { + expect.assertions(4) + const jwe = await createJWE(cleartext, [encrypter1, encrypter2]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P' }) + expect(await decryptJWE(jwe, decrypter1)).toEqual(cleartext) + expect(await decryptJWE(jwe, decrypter2)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + expect.assertions(4) + const jwe = await createJWE(cleartext, [encrypter1, encrypter2], { more: 'protected' }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter2)).toEqual(cleartext) + expect(await decryptJWE(jwe, decrypter1)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + expect.assertions(6) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE(cleartext, [encrypter1, encrypter2], { more: 'protected' }, aad) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter1)).toEqual(cleartext) + expect(await decryptJWE(jwe, decrypter2)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, decrypter1)).rejects.toThrowError('Failed to decrypt') + await expect(decryptJWE(jwe, decrypter2)).rejects.toThrowError('Failed to decrypt') + }) + + it('Incompatible encrypters throw', async () => { + expect.assertions(1) + const enc1 = { enc: 'cool enc alg1' } as Encrypter + const enc2 = { enc: 'cool enc alg2' } as Encrypter + await expect(createJWE(cleartext, [enc1, enc2])).rejects.toThrowError('Incompatible encrypters passed') + }) +}) + + +describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encryption', () => { + describe('One recipient', () => { + let cleartext: Uint8Array, recipientKey: any, senderKey: any, decrypter: Decrypter + + beforeEach(() => { + recipientKey = generateX25519KeyPairFromSeed(randomBytes(32)) + senderKey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientKey.secretKey, senderKey.publicKey) + }) + + it('Creates with only ciphertext', async () => { + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid, no apu and no apv', async () => { + const kid = 'did:example:receiver#key-1' + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { + kid, + }) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toBeUndefined() + expect(jwe.recipients!![0].header.apv).toBeUndefined() + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with no kid, apu and apv', async () => { + const apu = encodeBase64url('Alice') + const apv = encodeBase64url('Bob') + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { + apu, + apv, + }) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P' }) + expect(jwe.recipients!![0].header.kid).toBeUndefined() + expect(jwe.recipients!![0].header.apu).toEqual(apu) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid, apu and apv', async () => { + const kid = 'did:example:receiver#key-1' + const apu = encodeBase64url('Alice') + const apv = encodeBase64url('Bob') + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { + kid, + apu, + apv, + }) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toEqual(apu) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const skid = 'did:example:sender#key-1' + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', skid, more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + expect.assertions(4) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + describe('using remote ECDH', () => { + const message = 'hello world' + const receiverPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const receiverRemoteECDH = createX25519ECDH(receiverPair.secretKey) + const senderPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const senderRemoteECDH: ECDH = createX25519ECDH(senderPair.secretKey) + + it('creates anon JWE with remote ECDH', async () => { + const encrypter = xc20pAnonEncrypterX25519WithA256KW(receiverPair.publicKey) + const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) + const decrypter = xc20pAnonDecrypterX25519WithA256KW(receiverRemoteECDH) + const decryptedBytes = await decryptJWE(jwe, decrypter) + const receivedMessage = u8a.toString(decryptedBytes) + expect(receivedMessage).toEqual(message) + }) + + it('creates and decrypts auth JWE', async () => { + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(receiverPair.publicKey, senderRemoteECDH) + const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) + const decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(receiverRemoteECDH, senderPair.publicKey) + const decryptedBytes = await decryptJWE(jwe, decrypter) + const receivedMessage = u8a.toString(decryptedBytes) + expect(receivedMessage).toEqual(message) + }) + + it(`throws error when using bad secret key size`, async () => { + expect.assertions(1) + const badSecretKey = randomBytes(64) + expect(() => { + createX25519ECDH(badSecretKey) + }).toThrow('invalid_argument') + }) + + it(`throws error when using bad public key size`, async () => { + expect.assertions(1) + const ecdh: ECDH = createX25519ECDH(randomBytes(32)) + const badPublicKey = randomBytes(64) + expect(ecdh(badPublicKey)).rejects.toThrow('invalid_argument') + }) + }) + }) + + describe('Multiple recipients', () => { + let cleartext: any, senderkey: any + const recipients: any[] = [] + + beforeEach(() => { + senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + + recipients[0] = { kid: 'did:example:receiver1#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[0] = { + ...recipients[0], + ...{ + encrypter: xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipients[0].recipientkey.publicKey, + senderkey.secretKey, + { kid: recipients[0].kid } + ), + decrypter: xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipients[0].recipientkey.secretKey, + senderkey.publicKey + ), + }, + } + + recipients[1] = { kid: 'did:example:receiver2#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[1] = { + ...recipients[1], + ...{ + encrypter: xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipients[1].recipientkey.publicKey, + senderkey.secretKey, + { kid: recipients[1].kid } + ), + decrypter: xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipients[1].recipientkey.secretKey, + senderkey.publicKey + ), + }, + } + }) + + it('Creates with only ciphertext', async () => { + expect.assertions(4) + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + expect.assertions(4) + const skid = 'did:example:sender#key-1' + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter], { + more: 'protected', + skid, + }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected', skid }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + expect.assertions(6) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE( + cleartext, + [recipients[0].encrypter, recipients[1].encrypter], + { more: 'protected' }, + aad + ) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + it('Incompatible encrypters throw', async () => { + expect.assertions(1) + const enc1 = { enc: 'cool enc alg1' } as Encrypter + const enc2 = { enc: 'cool enc alg2' } as Encrypter + await expect(createJWE(cleartext, [enc1, enc2])).rejects.toThrowError('Incompatible encrypters passed') + }) + }) +}) + +describe('ECDH-ES+A256KW (X25519), Key Wrapping Mode with A256GCM content encryption', () => { + describe('One recipient', () => { + let cleartext: Uint8Array, recipientKey: any, senderKey: any, decrypter: Decrypter + + beforeEach(() => { + recipientKey = generateX25519KeyPairFromSeed(randomBytes(32)) + senderKey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + decrypter = a256gcmAnonDecrypterX25519WithA256KW(recipientKey.secretKey) + }) + + it('Creates with only ciphertext', async () => { + const encrypter = a256gcmAnonEncrypterX25519WithA256KW(recipientKey.publicKey) + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid, no apu and no apv', async () => { + const kid = 'did:example:receiver#key-1' + const encrypter = a256gcmAnonEncrypterX25519WithA256KW(recipientKey.publicKey, kid) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toBeUndefined() + expect(jwe.recipients!![0].header.apv).toBeUndefined() + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with no kid, with apv', async () => { + const apv = encodeBase64url('Bob') + const encrypter = a256gcmAnonEncrypterX25519WithA256KW(recipientKey.publicKey, undefined, apv) + expect.assertions(5) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(jwe.recipients!![0].header.kid).toBeUndefined() + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid and apv', async () => { + const kid = 'did:example:receiver#key-1' + const apv = encodeBase64url('Bob') + const encrypter = a256gcmAnonEncrypterX25519WithA256KW(recipientKey.publicKey, kid, apv) + expect.assertions(5) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + const encrypter = a256gcmAnonEncrypterX25519WithA256KW(recipientKey.publicKey) + const skid = 'did:example:sender#key-1' + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', skid, more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + const encrypter = a256gcmAnonEncrypterX25519WithA256KW(recipientKey.publicKey) + expect.assertions(4) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + describe('using remote ECDH', () => { + const message = 'hello world' + const receiverPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const receiverRemoteECDH = createX25519ECDH(receiverPair.secretKey) + + it('creates JWE with remote ECDH', async () => { + const encrypter = a256gcmAnonEncrypterX25519WithA256KW(receiverPair.publicKey) + const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) + const decrypter = a256gcmAnonDecrypterX25519WithA256KW(receiverRemoteECDH) + const decryptedBytes = await decryptJWE(jwe, decrypter) + const receivedMessage = u8a.toString(decryptedBytes) + expect(receivedMessage).toEqual(message) + }) + }) + }) + + describe('Multiple recipients', () => { + let cleartext: any, senderkey: any + const recipients: any[] = [] + + beforeEach(() => { + senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + + recipients[0] = { kid: 'did:example:receiver1#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[0] = { + ...recipients[0], + ...{ + encrypter: a256gcmAnonEncrypterX25519WithA256KW(recipients[0].recipientkey.publicKey, recipients[0].kid), + decrypter: a256gcmAnonDecrypterX25519WithA256KW(recipients[0].recipientkey.secretKey), + }, + } + + recipients[1] = { kid: 'did:example:receiver2#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[1] = { + ...recipients[1], + ...{ + encrypter: a256gcmAnonEncrypterX25519WithA256KW(recipients[1].recipientkey.publicKey, recipients[1].kid), + decrypter: a256gcmAnonDecrypterX25519WithA256KW(recipients[1].recipientkey.secretKey), + }, + } + }) + + it('Creates with only ciphertext', async () => { + expect.assertions(4) + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + expect.assertions(4) + const skid = 'did:example:sender#key-1' + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter], { + more: 'protected', + skid, + }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected', skid }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + expect.assertions(6) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE( + cleartext, + [recipients[0].encrypter, recipients[1].encrypter], + { more: 'protected' }, + aad + ) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + it('Incompatible encrypters throw', async () => { + expect.assertions(1) + const enc1 = { enc: 'cool enc alg1' } as Encrypter + const enc2 = { enc: 'cool enc alg2' } as Encrypter + await expect(createJWE(cleartext, [enc1, enc2])).rejects.toThrowError('Incompatible encrypters passed') + }) + }) +}) + +describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encryption', () => { + describe('One recipient', () => { + let cleartext: Uint8Array, recipientKey: any, senderKey: any, decrypter: Decrypter + + beforeEach(() => { + recipientKey = generateX25519KeyPairFromSeed(randomBytes(32)) + senderKey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientKey.secretKey, senderKey.publicKey) + }) + + it('Creates with only ciphertext', async () => { + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid, no apu and no apv', async () => { + const kid = 'did:example:receiver#key-1' + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { + kid, + }) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toBeUndefined() + expect(jwe.recipients!![0].header.apv).toBeUndefined() + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with no kid, with apu and apv', async () => { + const apu = encodeBase64url('Alice') + const apv = encodeBase64url('Bob') + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { + apu, + apv, + }) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(jwe.recipients!![0].header.kid).toBeUndefined() + expect(jwe.recipients!![0].header.apu).toEqual(apu) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid and apu and apv', async () => { + const kid = 'did:example:receiver#key-1' + const apu = encodeBase64url('Alice') + const apv = encodeBase64url('Bob') + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { + kid, + apu, + apv, + }) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toEqual(apu) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const skid = 'did:example:sender#key-1' + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', skid, more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + expect.assertions(4) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + describe('using remote ECDH', () => { + const message = 'hello world' + const receiverPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const receiverRemoteECDH = createX25519ECDH(receiverPair.secretKey) + const senderPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const senderRemoteECDH: ECDH = createX25519ECDH(senderPair.secretKey) + + it('creates JWE with remote ECDH', async () => { + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(receiverPair.publicKey, senderRemoteECDH) + const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) + const decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW(receiverRemoteECDH, senderPair.publicKey) + const decryptedBytes = await decryptJWE(jwe, decrypter) + const receivedMessage = u8a.toString(decryptedBytes) + expect(receivedMessage).toEqual(message) + }) + }) + }) + + describe('Multiple recipients', () => { + let cleartext: any, senderkey: any + const recipients: any[] = [] + + beforeEach(() => { + senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + + recipients[0] = { kid: 'did:example:receiver1#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[0] = { + ...recipients[0], + ...{ + encrypter: a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipients[0].recipientkey.publicKey, + senderkey.secretKey, + { kid: recipients[0].kid } + ), + decrypter: a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipients[0].recipientkey.secretKey, + senderkey.publicKey + ), + }, + } + + recipients[1] = { kid: 'did:example:receiver2#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[1] = { + ...recipients[1], + ...{ + encrypter: a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipients[1].recipientkey.publicKey, + senderkey.secretKey, + { kid: recipients[1].kid } + ), + decrypter: a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipients[1].recipientkey.secretKey, + senderkey.publicKey + ), + }, + } + }) + + it('Creates with only ciphertext', async () => { + expect.assertions(4) + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + expect.assertions(4) + const skid = 'did:example:sender#key-1' + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter], { + more: 'protected', + skid, + }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected', skid }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + expect.assertions(6) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE( + cleartext, + [recipients[0].encrypter, recipients[1].encrypter], + { more: 'protected' }, + aad + ) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + it('Incompatible encrypters throw', async () => { + expect.assertions(1) + const enc1 = { enc: 'cool enc alg1' } as Encrypter + const enc2 = { enc: 'cool enc alg2' } as Encrypter + await expect(createJWE(cleartext, [enc1, enc2])).rejects.toThrowError('Incompatible encrypters passed') + }) + }) +}) diff --git a/packages/did-comm/src/__tests__/trust-ping-interop.test.ts b/packages/did-comm/src/__tests__/trust-ping-interop.test.ts index 0d15ac5dc..da7bfacc9 100644 --- a/packages/did-comm/src/__tests__/trust-ping-interop.test.ts +++ b/packages/did-comm/src/__tests__/trust-ping-interop.test.ts @@ -9,7 +9,7 @@ import { DIDDocument, Resolver } from 'did-resolver' import { IDIDComm } from '../types/IDIDComm.js' import { ExampleDidProvider } from '../../../test-utils/src' import 'cross-fetch/polyfill' -import { base64ToBytes, bytesToHex } from '@veramo/utils' +import { base64ToBytes, bytesToHex } from '../../../utils/src' import * as u8a from 'uint8arrays' diff --git a/packages/did-comm/src/didcomm.ts b/packages/did-comm/src/didcomm.ts index 97c71f936..4a7a1d36f 100644 --- a/packages/did-comm/src/didcomm.ts +++ b/packages/did-comm/src/didcomm.ts @@ -1,35 +1,37 @@ import { IAgentContext, - IResolver, - IMessage, + IAgentPlugin, IDIDManager, + IIdentifier, IKeyManager, + IMessage, IMessageHandler, - IAgentPlugin, - IIdentifier, + IResolver, } from '@veramo/core-types' import { - createAnonDecrypter, - createAuthDecrypter, + createJWE, Decrypter, decryptJWE, - JWE, ECDH, - createAnonEncrypter, - createJWE, - createAuthEncrypter, Encrypter, + JWE, verifyJWS, - xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, + x25519Decrypter, + x25519Encrypter, + xc20pAuthDecrypterEcdh1PuV3x25519WithXc20PkwV2, + xc20pAuthEncrypterEcdh1PuV3x25519WithXc20PkwV2, +} from 'did-jwt' +import { DIDDocument, parse as parseDidUrl, Service, VerificationMethod } from 'did-resolver' +import { + a256gcmAnonDecrypterX25519WithA256KW, + a256gcmAnonEncrypterX25519WithA256KW, a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW, - xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW, xc20pAnonDecrypterX25519WithA256KW, - a256gcmAnonDecrypterX25519WithA256KW, xc20pAnonEncrypterX25519WithA256KW, - a256gcmAnonEncrypterX25519WithA256KW, -} from 'did-jwt' -import { DIDDocument, parse as parseDidUrl, ServiceEndpoint, VerificationMethod, Service } from 'did-resolver' + xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, + xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, +} from './encryption/aesEncryption.js' import schema from './plugin.schema.json' assert { type: 'json' } @@ -37,23 +39,23 @@ import { v4 as uuidv4 } from 'uuid' import { createEcdhWrapper, - extractSenderEncryptionKey, extractManagedRecipients, + extractSenderEncryptionKey, mapRecipientsToLocalKeys, } from './utils.js' import { + _ExtendedIKey, + _NormalizedVerificationMethod, + bytesToUtf8String, decodeJoseBlob, dereferenceDidKeys, encodeJoseBlob, + hexToBytes, isDefined, mapIdentifierKeysToDoc, resolveDidOrThrow, - _ExtendedIKey, - _NormalizedVerificationMethod, - hexToBytes, stringToUtf8Bytes, - bytesToUtf8String, } from '@veramo/utils' import Debug from 'debug' @@ -514,14 +516,14 @@ export class DIDComm implements IAgentPlugin { if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { - decrypter = createAuthDecrypter(recipientECDH, senderKeyBytes) + decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithXc20PkwV2(recipientECDH, senderKeyBytes) } } else { packing = 'anoncrypt' if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { decrypter = xc20pAnonDecrypterX25519WithA256KW(recipientECDH) } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { - decrypter = createAnonDecrypter(recipientECDH) + decrypter = x25519Decrypter(recipientECDH) } } } diff --git a/packages/did-comm/src/encryption/aesEncryption.ts b/packages/did-comm/src/encryption/aesEncryption.ts new file mode 100644 index 000000000..0f8f56d8a --- /dev/null +++ b/packages/did-comm/src/encryption/aesEncryption.ts @@ -0,0 +1,259 @@ +import type { + AuthEncryptParams, + Decrypter, + ECDH, + Encrypter, + EncryptionResult, + KeyUnwrapper, + KeyWrapper, + ProtectedHeader, + Recipient, +} from 'did-jwt' +import { + computeX25519Ecdh1PUv3Kek, + computeX25519EcdhEsKek, + createFullEncrypter, + createX25519Ecdh1PUv3Kek, + createX25519EcdhEsKek, + xc20pDirDecrypter, + xc20pDirEncrypter +} from 'did-jwt' +import { randomBytes } from '@noble/hashes/utils' +import { AESKW } from '@stablelib/aes-kw' +import { AES } from '@stablelib/aes' +import { GCM } from '@stablelib/gcm' +import { fromString } from 'uint8arrays/from-string' +import { base64ToBytes, bytesToBase64url, encodeBase64url } from "@veramo/utils"; + +/** + * Creates a wrapper using AES-KW + * @param wrappingKey + */ +export const a256KeyWrapper: KeyWrapper = { + from: (wrappingKey: Uint8Array) => { + const wrap = async (cek: Uint8Array): Promise => { + return { ciphertext: new AESKW(wrappingKey).wrapKey(cek) } + } + return { wrap } + }, + + alg: 'A256KW', +} + +export function a256KeyUnwrapper(wrappingKey: Uint8Array): KeyUnwrapper { + const unwrap = async (wrappedCek: Uint8Array): Promise => { + try { + return new AESKW(wrappingKey).unwrapKey(wrappedCek) + } catch (e) { + return null + } + } + return { unwrap, alg: 'A256KW' } +} + +export function a256gcmEncrypter(key: Uint8Array): (cleartext: Uint8Array, aad?: Uint8Array) => EncryptionResult { + const blockcipher = new AES(key) + const cipher = new GCM(blockcipher) + return (cleartext: Uint8Array, aad?: Uint8Array) => { + const iv = randomBytes(cipher.nonceLength) + const sealed = cipher.seal(iv, cleartext, aad) + return { + ciphertext: sealed.subarray(0, sealed.length - cipher.tagLength), + tag: sealed.subarray(sealed.length - cipher.tagLength), + iv, + } + } +} + +export function a256gcmDirEncrypter(key: Uint8Array): Encrypter { + const a256gcmEncrypt = a256gcmEncrypter(key) + const enc = 'A256GCM' + const alg = 'dir' + + async function encrypt( + cleartext: Uint8Array, + protectedHeader: ProtectedHeader = {}, + aad?: Uint8Array + ): Promise { + const protHeader = encodeBase64url(JSON.stringify(Object.assign({ alg }, protectedHeader, { enc }))) + const encodedAad = fromString(aad ? `${protHeader}.${bytesToBase64url(aad)}` : protHeader, 'utf-8') + return { + ...a256gcmEncrypt(cleartext, encodedAad), + protectedHeader: protHeader, + } + } + + return { alg, enc, encrypt } +} + +export function a256gcmDirDecrypter(key: Uint8Array): Decrypter { + const cipher = new GCM(new AES(key)) + + async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise { + return cipher.open(iv, sealed, aad) + } + + return { alg: 'dir', enc: 'A256GCM', decrypt } +} + +export function a256gcmAnonEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'XC20P' } + ) +} + +export function xc20pAnonEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' } + ) +} + +export function xc20pAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+A256KW' + const enc = 'XC20P' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return xc20pDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function a256gcmAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+A256KW' + const enc = 'A256GCM' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {} +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' } + ) +} + +export function xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array +): Decrypter { + const alg = 'ECDH-1PU+A256KW' + const enc = 'XC20P' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (!kek) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return xc20pDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {} +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'A256GCM' } + ) +} + +export function a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array +): Decrypter { + const alg = 'ECDH-1PU+A256KW' + const enc = 'A256GCM' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (!kek) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} diff --git a/packages/did-comm/src/encryption/p256-ECDH-1PU.ts b/packages/did-comm/src/encryption/p256-ECDH-1PU.ts new file mode 100644 index 000000000..4c2966f7d --- /dev/null +++ b/packages/did-comm/src/encryption/p256-ECDH-1PU.ts @@ -0,0 +1,87 @@ +// // TODO: Implement this +// // kept the X25519 code for reference + + + + + + +// import type { ECDH, EphemeralKeyPair, Recipient } from 'did-jwt' +// import { concatKDF } from 'did-jwt' +// import { x25519 } from '@noble/curves/ed25519' +// import { generateX25519KeyPair, generateX25519KeyPairFromSeed } from '../utils.js' +// import { base64ToBytes, bytesToBase64url } from '@veramo/utils' +// +// export async function computeX25519Ecdh1PUv3Kek( +// recipient: Recipient, +// recipientSecret: Uint8Array | ECDH, +// senderPublicKey: Uint8Array, +// alg: string, +// ) { +// const crv = 'X25519' +// const keyLen = 256 +// const header = recipient.header +// if (header.epk?.crv !== crv || typeof header.epk.x == 'undefined') return null +// // ECDH-1PU requires additional shared secret between +// // static key of sender and static key of recipient +// const publicKey = base64ToBytes(header.epk.x) +// let zE: Uint8Array +// let zS: Uint8Array +// +// if (recipientSecret instanceof Uint8Array) { +// zE = x25519.getSharedSecret(recipientSecret, publicKey) +// zS = x25519.getSharedSecret(recipientSecret, senderPublicKey) +// } else { +// zE = await recipientSecret(publicKey) +// zS = await recipientSecret(senderPublicKey) +// } +// +// const sharedSecret = new Uint8Array(zE.length + zS.length) +// sharedSecret.set(zE) +// sharedSecret.set(zS, zE.length) +// +// // Key Encryption Key +// let producerInfo +// let consumerInfo +// if (recipient.header.apu) producerInfo = base64ToBytes(recipient.header.apu) +// if (recipient.header.apv) consumerInfo = base64ToBytes(recipient.header.apv) +// +// return concatKDF(sharedSecret, keyLen, alg, producerInfo, consumerInfo) +// } +// +// export async function createX25519Ecdh1PUv3Kek( +// recipientPublicKey: Uint8Array, +// senderSecret: Uint8Array | ECDH, +// alg: string, // must be provided as this is the key agreement alg + the key wrapper alg, Example: 'ECDH-ES+A256KW' +// apu: string | undefined, +// apv: string | undefined, +// ephemeralKeyPair: EphemeralKeyPair | undefined +// ) { +// const crv = 'X25519' +// const keyLen = 256 +// const ephemeral = ephemeralKeyPair ? generateX25519KeyPairFromSeed(ephemeralKeyPair.secretKey) : generateX25519KeyPair() +// const epk = { kty: 'OKP', crv, x: bytesToBase64url(ephemeral.publicKey) } +// const zE = x25519.getSharedSecret(ephemeral.secretKey, recipientPublicKey) +// +// // ECDH-1PU requires additional shared secret between +// // static key of sender and static key of recipient +// let zS +// if (senderSecret instanceof Uint8Array) { +// zS = x25519.getSharedSecret(senderSecret, recipientPublicKey) +// } else { +// zS = await senderSecret(recipientPublicKey) +// } +// +// const sharedSecret = new Uint8Array(zE.length + zS.length) +// sharedSecret.set(zE) +// sharedSecret.set(zS, zE.length) +// +// let partyUInfo: Uint8Array = new Uint8Array(0) +// let partyVInfo: Uint8Array = new Uint8Array(0) +// if (apu) partyUInfo = base64ToBytes(apu) +// if (apv) partyVInfo = base64ToBytes(apv) +// +// // Key Encryption Key +// const kek = concatKDF(sharedSecret, keyLen, alg, partyUInfo, partyVInfo) +// return { epk, kek } +// } diff --git a/packages/did-comm/src/encryption/p256-ECDH-ES.ts b/packages/did-comm/src/encryption/p256-ECDH-ES.ts new file mode 100644 index 000000000..d7387b9db --- /dev/null +++ b/packages/did-comm/src/encryption/p256-ECDH-ES.ts @@ -0,0 +1,53 @@ +// // TODO: Implement this +// // kept the X25519 code for reference + + + + + + +// import type { ECDH, EphemeralKeyPair, Recipient } from 'did-jwt' +// import { concatKDF } from 'did-jwt' +// import { x25519 } from '@noble/curves/ed25519' +// import { base64ToBytes, bytesToBase64url } from "@veramo/utils"; +// import { generateX25519KeyPair, generateX25519KeyPairFromSeed } from "../utils.js"; +// +// export async function computeX25519EcdhEsKek(recipient: Recipient, receiverSecret: Uint8Array | ECDH, alg: string) { +// const crv = 'X25519' +// const keyLen = 256 +// const header = recipient.header +// if (header.epk?.crv !== crv || typeof header.epk.x == 'undefined') return null +// const publicKey = base64ToBytes(header.epk.x) +// let sharedSecret +// if (receiverSecret instanceof Uint8Array) { +// sharedSecret = x25519.getSharedSecret(receiverSecret, publicKey) +// } else { +// sharedSecret = await receiverSecret(publicKey) +// } +// +// // Key Encryption Key +// let producerInfo: Uint8Array | undefined = undefined +// let consumerInfo: Uint8Array | undefined = undefined +// if (recipient.header.apu) producerInfo = base64ToBytes(recipient.header.apu) +// if (recipient.header.apv) consumerInfo = base64ToBytes(recipient.header.apv) +// return concatKDF(sharedSecret, keyLen, alg, producerInfo, consumerInfo) +// } +// +// export async function createX25519EcdhEsKek( +// recipientPublicKey: Uint8Array, +// senderSecret: Uint8Array | ECDH | undefined, // unused +// alg: string, +// apu: string | undefined, // unused +// apv: string | undefined, +// ephemeralKeyPair: EphemeralKeyPair | undefined +// ) { +// const crv = 'X25519' +// const keyLen = 256 +// const ephemeral = ephemeralKeyPair ? generateX25519KeyPairFromSeed(ephemeralKeyPair.secretKey) : generateX25519KeyPair() +// const epk = { kty: 'OKP', crv, x: bytesToBase64url(ephemeral.publicKey) } +// const sharedSecret = x25519.getSharedSecret(ephemeral.secretKey, recipientPublicKey) +// // Key Encryption Key +// const consumerInfo = base64ToBytes(apv ?? '') +// const kek = concatKDF(sharedSecret, keyLen, alg, undefined, consumerInfo) +// return { epk, kek } +// } diff --git a/packages/did-comm/src/protocols/routing-message-handler.ts b/packages/did-comm/src/protocols/routing-message-handler.ts index 298271f45..130e3e585 100644 --- a/packages/did-comm/src/protocols/routing-message-handler.ts +++ b/packages/did-comm/src/protocols/routing-message-handler.ts @@ -3,7 +3,10 @@ import { AbstractMessageHandler, Message } from '@veramo/message-handler' import Debug from 'debug' import { v4 } from 'uuid' import { IDIDComm } from '../types/IDIDComm.js' -import { MEDIATE_GRANT_MESSAGE_TYPE, MEDIATE_DENY_MESSAGE_TYPE } from './coordinate-mediation-message-handler.js' +import { + MEDIATE_GRANT_MESSAGE_TYPE, + MEDIATE_DENY_MESSAGE_TYPE, +} from './coordinate-mediation-message-handler.js' const debug = Debug('veramo:did-comm:routing-message-handler') @@ -13,7 +16,8 @@ export const FORWARD_MESSAGE_TYPE = 'https://didcomm.org/routing/2.0/forward' export const QUEUE_MESSAGE_TYPE = 'https://didcomm.org/routing/2.0/forward/queue-message' /** - * A plugin for the {@link @veramo/message-handler#MessageHandler} that handles forward messages for the Routing protocol. + * A plugin for the {@link @veramo/message-handler#MessageHandler} that handles forward messages for the Routing + * protocol. * @beta This API may change without a BREAKING CHANGE notice. */ export class RoutingMessageHandler extends AbstractMessageHandler { diff --git a/packages/did-comm/src/protocols/trust-ping-message-handler.ts b/packages/did-comm/src/protocols/trust-ping-message-handler.ts index 896f8746f..25ecd6abc 100644 --- a/packages/did-comm/src/protocols/trust-ping-message-handler.ts +++ b/packages/did-comm/src/protocols/trust-ping-message-handler.ts @@ -19,19 +19,23 @@ export function createTrustPingMessage(senderDidUrl: string, recipientDidUrl: st to: recipientDidUrl, id: v4(), body: { - responseRequested: true - } + responseRequested: true, + }, } } -export function createTrustPingResponse(senderDidUrl: string, recipientDidUrl: string, pingId: string): IDIDCommMessage { +export function createTrustPingResponse( + senderDidUrl: string, + recipientDidUrl: string, + pingId: string, +): IDIDCommMessage { return { type: TRUST_PING_RESPONSE_MESSAGE_TYPE, from: senderDidUrl, to: recipientDidUrl, id: `${pingId}-response`, thid: pingId, - body: {} + body: {}, } } @@ -54,13 +58,16 @@ export class TrustPingMessageHandler extends AbstractMessageHandler { try { const { from, to, id } = message if (!from) { - throw new Error("invalid_argument: Trust Ping Message received without `from` set") + throw new Error('invalid_argument: Trust Ping Message received without `from` set') } if (!to) { - throw new Error("invalid_argument: Trust Ping Message received without `to` set") + throw new Error('invalid_argument: Trust Ping Message received without `to` set') } const response = createTrustPingResponse(to!, from!, id) - const packedResponse = await context.agent.packDIDCommMessage({ message: response, packing: 'authcrypt'}) + const packedResponse = await context.agent.packDIDCommMessage({ + message: response, + packing: 'authcrypt', + }) const sent = await context.agent.sendDIDCommMessage({ messageId: response.id, packedMessage: packedResponse, @@ -73,7 +80,7 @@ export class TrustPingMessageHandler extends AbstractMessageHandler { return message } else if (message.type === TRUST_PING_RESPONSE_MESSAGE_TYPE) { debug('TrustPingResponse Message Received') - message.addMetaData({ type: 'TrustPingResponseReceived', value: 'true'}) + message.addMetaData({ type: 'TrustPingResponseReceived', value: 'true' }) return message } diff --git a/packages/did-comm/src/utils.ts b/packages/did-comm/src/utils.ts index 728702145..7407dd100 100644 --- a/packages/did-comm/src/utils.ts +++ b/packages/did-comm/src/utils.ts @@ -13,6 +13,7 @@ import { mapIdentifierKeysToDoc, resolveDidOrThrow, } from '@veramo/utils' +import { x25519 } from '@noble/curves/ed25519' const debug = Debug('veramo:did-comm:action-handler') @@ -108,3 +109,27 @@ export async function mapRecipientsToLocalKeys( const localKeys = potentialKeys.filter(isDefined) return localKeys } + +/** + * Generate private-public x25519 key pair + */ +export function generateX25519KeyPair(): { secretKey: Uint8Array; publicKey: Uint8Array } { + const secretKey = x25519.utils.randomPrivateKey() + return generateX25519KeyPairFromSeed(secretKey) +} + +/** + * Generate private-public x25519 key pair from a 32 byte secret. + */ +export function generateX25519KeyPairFromSeed(seed: Uint8Array): { + secretKey: Uint8Array + publicKey: Uint8Array +} { + if (seed.length !== 32) { + throw new Error(`x25519: seed must be 32 bytes`) + } + return { + publicKey: x25519.getPublicKey(seed), + secretKey: seed, + } +} diff --git a/packages/did-jwt/package.json b/packages/did-jwt/package.json index a7b71faef..ce22e45cd 100644 --- a/packages/did-jwt/package.json +++ b/packages/did-jwt/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.1", + "did-jwt": "^7.1.0-alpha.3", "did-resolver": "^4.0.1" }, "devDependencies": { diff --git a/packages/did-provider-key/src/key-did-provider.ts b/packages/did-provider-key/src/key-did-provider.ts index 862d1fd8e..c5ac3e89f 100644 --- a/packages/did-provider-key/src/key-did-provider.ts +++ b/packages/did-provider-key/src/key-did-provider.ts @@ -1,6 +1,6 @@ import { IAgentContext, IIdentifier, IKey, IKeyManager, IService, RequireOnly } from '@veramo/core-types' import { AbstractIdentifierProvider } from '@veramo/did-manager' -import { hexToBytes } from '@veramo/utils' +import { hexToBytes, bytesToUtf8String } from '@veramo/utils' import { base58btc } from 'multiformats/bases/base58' import Multicodec from 'multicodec' diff --git a/packages/key-manager/package.json b/packages/key-manager/package.json index 647234ad3..dcea38cf7 100644 --- a/packages/key-manager/package.json +++ b/packages/key-manager/package.json @@ -18,7 +18,7 @@ "@veramo/utils": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.4", - "did-jwt": "^7.2.1", + "did-jwt": "^7.2.2", "uint8arrays": "^4.0.3", "uuid": "^9.0.0" }, diff --git a/packages/kms-local/package.json b/packages/kms-local/package.json index 3763ac250..f2627c0c7 100644 --- a/packages/kms-local/package.json +++ b/packages/kms-local/package.json @@ -24,7 +24,7 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.1" + "did-jwt": "^7.1.0-alpha.3" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/selective-disclosure/package.json b/packages/selective-disclosure/package.json index c63291210..6b6ee35de 100644 --- a/packages/selective-disclosure/package.json +++ b/packages/selective-disclosure/package.json @@ -22,7 +22,7 @@ "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.1", + "did-jwt": "^7.1.0-alpha.3", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/selective-disclosure/src/action-handler.ts b/packages/selective-disclosure/src/action-handler.ts index ace18080f..648a4e899 100644 --- a/packages/selective-disclosure/src/action-handler.ts +++ b/packages/selective-disclosure/src/action-handler.ts @@ -5,8 +5,10 @@ import { ICredentialIssuer, IDataStoreORM, IDIDManager, + IKey, IKeyManager, TClaimsColumns, + VerifiableCredential, VerifiablePresentation, } from '@veramo/core-types' @@ -23,13 +25,7 @@ import { import schema from './plugin.schema.json' assert { type: 'json' } import { createJWT } from 'did-jwt' import Debug from 'debug' -import { - asArray, - bytesToBase64, - computeEntryHash, - decodeCredentialToObject, - extractIssuer, -} from '@veramo/utils' +import { asArray, bytesToBase64, computeEntryHash, decodeCredentialToObject, extractIssuer, } from '@veramo/utils' /** * This class adds support for creating @@ -77,7 +73,7 @@ export class SelectiveDisclosure implements IAgentPlugin { delete data.issuer Debug('veramo:selective-disclosure:create-sdr')('Signing SDR with', identifier.did) - const key = identifier.keys.find((k) => k.type === 'Secp256k1') + const key = identifier.keys.find((k: IKey) => k.type === 'Secp256k1') if (!key) throw Error('Signing key not found') const signer = (data: string | Uint8Array) => { let dataString, encoding: 'base64' | undefined @@ -183,7 +179,7 @@ export class SelectiveDisclosure implements IAgentPlugin { for (const credentialRequest of args.sdr.claims) { let credentials = (args.presentation?.verifiableCredential || []) .map(decodeCredentialToObject) - .filter((credential) => { + .filter((credential: VerifiableCredential) => { if ( credentialRequest.claimType && credentialRequest.claimValue && diff --git a/packages/utils/package.json b/packages/utils/package.json index 87ec4e7c2..2b7059ab9 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -18,7 +18,7 @@ "credential-status": "^2.0.5", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.1", + "did-jwt": "^7.1.0-alpha.3", "did-jwt-vc": "^3.1.0", "did-resolver": "^4.0.1", "multiformats": "^12.0.0", diff --git a/packages/utils/src/did-utils.ts b/packages/utils/src/did-utils.ts index d4dfc4696..7e4d52294 100644 --- a/packages/utils/src/did-utils.ts +++ b/packages/utils/src/did-utils.ts @@ -53,7 +53,7 @@ export function convertEd25519PrivateKeyToX25519(privateKey: Uint8Array): Uint8A */ export function convertIdentifierEncryptionKeys(identifier: IIdentifier): IKey[] { return identifier.keys - .map((key) => { + .map((key: IKey) => { if (key.type === 'Ed25519') { const publicBytes = hexToBytes(key.publicKeyHex) key.publicKeyHex = bytesToHex(convertEd25519PublicKeyToX25519(publicBytes)) @@ -83,7 +83,7 @@ export function convertIdentifierEncryptionKeys(identifier: IIdentifier): IKey[] */ export function compressIdentifierSecp256k1Keys(identifier: IIdentifier): IKey[] { return identifier.keys - .map((key) => { + .map((key: IKey) => { if (key.type === 'Secp256k1') { if (key.publicKeyHex) { const publicBytes = hexToBytes(key.publicKeyHex) @@ -253,7 +253,7 @@ export async function mapIdentifierKeysToDoc( const extendedKeys: _ExtendedIKey[] = documentKeys .map((verificationMethod) => { const localKey = localKeys.find( - (localKey) => + (localKey: IKey) => localKey.publicKeyHex === verificationMethod.publicKeyHex || compareBlockchainAccountId(localKey, verificationMethod), ) From f9ee365a83b1bd64082ef571b30858a7ed2a97f1 Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Wed, 17 May 2023 15:30:57 +0200 Subject: [PATCH 06/11] ci: try to parallelize CI steps using caches --- .github/workflows/build-and-test-on-pr.yml | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/build-and-test-on-pr.yml b/.github/workflows/build-and-test-on-pr.yml index 0c7664df0..56d232826 100644 --- a/.github/workflows/build-and-test-on-pr.yml +++ b/.github/workflows/build-and-test-on-pr.yml @@ -136,3 +136,50 @@ jobs: cache: 'pnpm' - run: pnpm run lint - run: pnpm run docs + + test-browser: + needs: build + runs-on: ubuntu-latest + steps: + - uses: pnpm/action-setup@v2 + with: + version: 8 + - run: pnpm add -g pnpm + - name: 'Restore build output' + uses: actions/cache/restore@v3 + with: + path: ${{ github.workspace }} + key: ${{ runner.os }}-build-${{ github.sha }}-${{ github.run_id }} + restore-keys: ${{ runner.os }}-build-${{ github.sha }} + fail-on-cache-miss: true + - name: 'Setup Node.js with pnpm cache' + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'pnpm' + - run: pnpm install --force + - name: 'Run browser tests' + run: pnpm test:browser + + lint-and-docs: + needs: build + runs-on: ubuntu-latest + steps: + - uses: pnpm/action-setup@v2 + with: + version: 8 + - run: pnpm add -g pnpm + - name: 'Restore build output' + uses: actions/cache/restore@v3 + with: + path: ${{ github.workspace }} + key: ${{ runner.os }}-build-${{ github.sha }}-${{ github.run_id }} + restore-keys: ${{ runner.os }}-build-${{ github.sha }} + fail-on-cache-miss: true + - name: 'Setup Node.js with pnpm cache' + uses: actions/setup-node@v3 + with: + node-version: 20 + cache: 'pnpm' + - run: pnpm run lint + - run: pnpm run docs From f34f6eef83070ba0d135b52295c24da5bab2f28d Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Wed, 17 May 2023 14:35:25 +0200 Subject: [PATCH 07/11] fix(deps): bump did-* libraries --- package.json | 2 +- packages/cli/package.json | 4 +- packages/core-types/package.json | 4 +- packages/credential-ld/package.json | 2 +- packages/credential-status/package.json | 4 +- packages/credential-w3c/package.json | 6 +-- packages/data-store-json/package.json | 2 +- packages/data-store/package.json | 2 +- packages/did-comm/package.json | 2 +- .../did-comm/src/encryption/aesEncryption.ts | 41 ++++++++++--------- packages/did-jwt/package.json | 4 +- packages/did-provider-ethr/package.json | 2 +- packages/did-provider-ion/package.json | 3 +- packages/did-provider-jwk/package.json | 2 +- .../did-provider-key/src/key-did-provider.ts | 7 +++- packages/did-provider-pkh/package.json | 2 +- packages/did-resolver/package.json | 2 +- packages/key-manager/package.json | 1 - packages/kms-local/package.json | 2 +- packages/remote-server/package.json | 2 +- packages/selective-disclosure/package.json | 2 +- packages/test-utils/package.json | 2 +- packages/tsconfig.settings.json | 2 +- packages/utils/package.json | 6 +-- 24 files changed, 56 insertions(+), 52 deletions(-) diff --git a/package.json b/package.json index 4eab44a02..bac9336ce 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@ethersproject/providers": "^5.7.2", "@ethersproject/transactions": "^5.7.0", "@ethersproject/wallet": "^5.7.0", - "@jest/globals": "^29.5.0", + "@jest/globals": "29.5.0", "@metamask/eth-sig-util": "6.0.0", "@microsoft/api-documenter": "7.22.16", "@microsoft/api-extractor": "7.35.2", diff --git a/packages/cli/package.json b/packages/cli/package.json index bc4a94f78..5b701cc6c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -69,7 +69,7 @@ "cross-fetch": "^3.1.6", "date-fns": "^2.28.0", "debug": "^4.3.3", - "did-resolver": "^4.0.1", + "did-resolver": "^4.1.0", "dotenv": "^16.0.0", "ethr-did-resolver": "^8.0.0", "express": "^4.18.2", @@ -92,7 +92,7 @@ "ts-json-schema-generator": "^1.2.0", "typeorm": "^0.3.10", "url-parse": "^1.5.4", - "web-did-resolver": "^2.0.21", + "web-did-resolver": "^2.0.24", "ws": "^8.11.0", "yaml": "^2.1.3" }, diff --git a/packages/core-types/package.json b/packages/core-types/package.json index f0acadac1..4f2b2a9ca 100644 --- a/packages/core-types/package.json +++ b/packages/core-types/package.json @@ -35,8 +35,8 @@ "dependencies": { "credential-status": "^2.0.5", "debug": "^4.3.3", - "did-jwt-vc": "^3.1.0", - "did-resolver": "^4.0.1" + "did-jwt-vc": "^3.2.1", + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/credential-ld/package.json b/packages/credential-ld/package.json index 18ae90b16..ab5309d80 100644 --- a/packages/credential-ld/package.json +++ b/packages/credential-ld/package.json @@ -31,7 +31,7 @@ "@veramo/utils": "workspace:^", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-resolver": "^4.0.1" + "did-resolver": "^4.1.0" }, "resolutions": { "@types/react": "18.0.26", diff --git a/packages/credential-status/package.json b/packages/credential-status/package.json index aea16f6c3..2ed59a87f 100644 --- a/packages/credential-status/package.json +++ b/packages/credential-status/package.json @@ -13,8 +13,8 @@ "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", "credential-status": "^2.0.5", - "did-jwt": "^7.1.0-alpha.3", - "did-resolver": "^4.0.1" + "did-jwt": "^7.2.0", + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/credential-w3c/package.json b/packages/credential-w3c/package.json index dba0e1b9f..da63a5001 100644 --- a/packages/credential-w3c/package.json +++ b/packages/credential-w3c/package.json @@ -18,9 +18,9 @@ "@veramo/utils": "workspace:^", "canonicalize": "^2.0.0", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.3", - "did-jwt-vc": "^3.1.0", - "did-resolver": "^4.0.1", + "did-jwt": "^7.2.0", + "did-jwt-vc": "^3.2.1", + "did-resolver": "^4.1.0", "uuid": "^9.0.0" }, "optionalDependencies": { diff --git a/packages/data-store-json/package.json b/packages/data-store-json/package.json index fffbdc560..2b75beed5 100644 --- a/packages/data-store-json/package.json +++ b/packages/data-store-json/package.json @@ -16,7 +16,7 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt-vc": "^3.1.0", + "did-jwt-vc": "^3.2.1", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/data-store/package.json b/packages/data-store/package.json index 92d85244e..32ee9087f 100644 --- a/packages/data-store/package.json +++ b/packages/data-store/package.json @@ -15,7 +15,7 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt-vc": "^3.1.0", + "did-jwt-vc": "^3.2.1", "typeorm": "^0.3.10", "uuid": "^9.0.0" }, diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index 2099ede11..9128c2785 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -29,7 +29,7 @@ "cross-fetch": "^3.1.6", "debug": "^4.3.3", "did-jwt": "^7.2.2", - "did-resolver": "^4.0.1", + "did-resolver": "^4.1.0", "isomorphic-webcrypto": "^2.3.8", "uuid": "^9.0.0" }, diff --git a/packages/did-comm/src/encryption/aesEncryption.ts b/packages/did-comm/src/encryption/aesEncryption.ts index 0f8f56d8a..71e22cf33 100644 --- a/packages/did-comm/src/encryption/aesEncryption.ts +++ b/packages/did-comm/src/encryption/aesEncryption.ts @@ -4,7 +4,6 @@ import type { ECDH, Encrypter, EncryptionResult, - KeyUnwrapper, KeyWrapper, ProtectedHeader, Recipient, @@ -16,14 +15,14 @@ import { createX25519Ecdh1PUv3Kek, createX25519EcdhEsKek, xc20pDirDecrypter, - xc20pDirEncrypter + xc20pDirEncrypter, } from 'did-jwt' import { randomBytes } from '@noble/hashes/utils' import { AESKW } from '@stablelib/aes-kw' import { AES } from '@stablelib/aes' import { GCM } from '@stablelib/gcm' import { fromString } from 'uint8arrays/from-string' -import { base64ToBytes, bytesToBase64url, encodeBase64url } from "@veramo/utils"; +import { base64ToBytes, bytesToBase64url, encodeBase64url } from '@veramo/utils' /** * Creates a wrapper using AES-KW @@ -40,7 +39,7 @@ export const a256KeyWrapper: KeyWrapper = { alg: 'A256KW', } -export function a256KeyUnwrapper(wrappingKey: Uint8Array): KeyUnwrapper { +export function a256KeyUnwrapper(wrappingKey: Uint8Array) { const unwrap = async (wrappedCek: Uint8Array): Promise => { try { return new AESKW(wrappingKey).unwrapKey(wrappedCek) @@ -51,7 +50,9 @@ export function a256KeyUnwrapper(wrappingKey: Uint8Array): KeyUnwrapper { return { unwrap, alg: 'A256KW' } } -export function a256gcmEncrypter(key: Uint8Array): (cleartext: Uint8Array, aad?: Uint8Array) => EncryptionResult { +export function a256gcmEncrypter( + key: Uint8Array, +): (cleartext: Uint8Array, aad?: Uint8Array) => EncryptionResult { const blockcipher = new AES(key) const cipher = new GCM(blockcipher) return (cleartext: Uint8Array, aad?: Uint8Array) => { @@ -73,7 +74,7 @@ export function a256gcmDirEncrypter(key: Uint8Array): Encrypter { async function encrypt( cleartext: Uint8Array, protectedHeader: ProtectedHeader = {}, - aad?: Uint8Array + aad?: Uint8Array, ): Promise { const protHeader = encodeBase64url(JSON.stringify(Object.assign({ alg }, protectedHeader, { enc }))) const encodedAad = fromString(aad ? `${protHeader}.${bytesToBase64url(aad)}` : protHeader, 'utf-8') @@ -99,7 +100,7 @@ export function a256gcmDirDecrypter(key: Uint8Array): Decrypter { export function a256gcmAnonEncrypterX25519WithA256KW( recipientPublicKey: Uint8Array, kid?: string, - apv?: string + apv?: string, ): Encrypter { return createFullEncrypter( recipientPublicKey, @@ -107,14 +108,14 @@ export function a256gcmAnonEncrypterX25519WithA256KW( { apv, kid }, { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, a256KeyWrapper, - { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'XC20P' } + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'XC20P' }, ) } export function xc20pAnonEncrypterX25519WithA256KW( recipientPublicKey: Uint8Array, kid?: string, - apv?: string + apv?: string, ): Encrypter { return createFullEncrypter( recipientPublicKey, @@ -122,7 +123,7 @@ export function xc20pAnonEncrypterX25519WithA256KW( { apv, kid }, { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, a256KeyWrapper, - { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' } + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, ) } @@ -134,7 +135,7 @@ export function xc20pAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array, - recipient?: Recipient + recipient?: Recipient, ): Promise { recipient = recipient const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) @@ -158,7 +159,7 @@ export function a256gcmAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array, - recipient?: Recipient + recipient?: Recipient, ): Promise { recipient = recipient const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) @@ -177,7 +178,7 @@ export function a256gcmAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array export function xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( recipientPublicKey: Uint8Array, senderSecret: Uint8Array | ECDH, - options: Partial = {} + options: Partial = {}, ): Encrypter { return createFullEncrypter( recipientPublicKey, @@ -185,13 +186,13 @@ export function xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( options, { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, a256KeyWrapper, - { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' } + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, ) } export function xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( recipientSecret: Uint8Array | ECDH, - senderPublicKey: Uint8Array + senderPublicKey: Uint8Array, ): Decrypter { const alg = 'ECDH-1PU+A256KW' const enc = 'XC20P' @@ -200,7 +201,7 @@ export function xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array, - recipient?: Recipient + recipient?: Recipient, ): Promise { recipient = recipient const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) @@ -219,7 +220,7 @@ export function xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( export function a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( recipientPublicKey: Uint8Array, senderSecret: Uint8Array | ECDH, - options: Partial = {} + options: Partial = {}, ): Encrypter { return createFullEncrypter( recipientPublicKey, @@ -227,13 +228,13 @@ export function a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( options, { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, a256KeyWrapper, - { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'A256GCM' } + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'A256GCM' }, ) } export function a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( recipientSecret: Uint8Array | ECDH, - senderPublicKey: Uint8Array + senderPublicKey: Uint8Array, ): Decrypter { const alg = 'ECDH-1PU+A256KW' const enc = 'A256GCM' @@ -242,7 +243,7 @@ export function a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array, - recipient?: Recipient + recipient?: Recipient, ): Promise { recipient = recipient const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) diff --git a/packages/did-jwt/package.json b/packages/did-jwt/package.json index ce22e45cd..a47f3a975 100644 --- a/packages/did-jwt/package.json +++ b/packages/did-jwt/package.json @@ -13,8 +13,8 @@ "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.3", - "did-resolver": "^4.0.1" + "did-jwt": "^7.2.0", + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-provider-ethr/package.json b/packages/did-provider-ethr/package.json index db6de4f95..2e8d496cf 100644 --- a/packages/did-provider-ethr/package.json +++ b/packages/did-provider-ethr/package.json @@ -22,7 +22,7 @@ "@veramo/core-types": "workspace:^", "@veramo/did-manager": "workspace:^", "debug": "^4.3.3", - "ethr-did": "^2.3.6" + "ethr-did": "^2.3.12" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-provider-ion/package.json b/packages/did-provider-ion/package.json index 1b2e14be4..1d4b32d59 100644 --- a/packages/did-provider-ion/package.json +++ b/packages/did-provider-ion/package.json @@ -23,11 +23,10 @@ "@veramo/key-manager": "workspace:^", "@veramo/kms-local": "workspace:^", "@veramo/utils": "workspace:^", - "@veramo/utils": "workspace:^", "canonicalize": "^2.0.0", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-resolver": "^4.0.1", + "did-resolver": "^4.1.0", "multihashes": "^4.0.3" }, "devDependencies": { diff --git a/packages/did-provider-jwk/package.json b/packages/did-provider-jwk/package.json index c0a11831b..5ce4462dc 100644 --- a/packages/did-provider-jwk/package.json +++ b/packages/did-provider-jwk/package.json @@ -15,7 +15,7 @@ "@veramo/did-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-resolver": "^4.0.1" + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-provider-key/src/key-did-provider.ts b/packages/did-provider-key/src/key-did-provider.ts index c5ac3e89f..590fa55f4 100644 --- a/packages/did-provider-key/src/key-did-provider.ts +++ b/packages/did-provider-key/src/key-did-provider.ts @@ -64,7 +64,12 @@ export class KeyDIDProvider extends AbstractIdentifierProvider { } async updateIdentifier( - args: { did: string; kms?: string | undefined; alias?: string | undefined; options?: any }, + args: { + did: string + kms?: string | undefined + alias?: string | undefined + options?: any + }, context: IAgentContext, ): Promise { throw new Error('KeyDIDProvider updateIdentifier not supported yet.') diff --git a/packages/did-provider-pkh/package.json b/packages/did-provider-pkh/package.json index 16cca66b7..0b232b943 100644 --- a/packages/did-provider-pkh/package.json +++ b/packages/did-provider-pkh/package.json @@ -18,7 +18,7 @@ "@veramo/did-manager": "workspace:^", "caip": "^1.1.0", "debug": "^4.3.3", - "did-resolver": "^4.0.1" + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-resolver/package.json b/packages/did-resolver/package.json index 6bbb3d847..458ff6237 100644 --- a/packages/did-resolver/package.json +++ b/packages/did-resolver/package.json @@ -14,7 +14,7 @@ "@veramo/utils": "workspace:^", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-resolver": "^4.0.1" + "did-resolver": "^4.1.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/key-manager/package.json b/packages/key-manager/package.json index dcea38cf7..55be388a0 100644 --- a/packages/key-manager/package.json +++ b/packages/key-manager/package.json @@ -16,7 +16,6 @@ "@noble/curves": "^1.0.0", "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", - "@veramo/utils": "workspace:^", "debug": "^4.3.4", "did-jwt": "^7.2.2", "uint8arrays": "^4.0.3", diff --git a/packages/kms-local/package.json b/packages/kms-local/package.json index f2627c0c7..9f8c87ea0 100644 --- a/packages/kms-local/package.json +++ b/packages/kms-local/package.json @@ -24,7 +24,7 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.3" + "did-jwt": "^7.2.0" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/remote-server/package.json b/packages/remote-server/package.json index 3fb5c4817..6ca03c2c1 100644 --- a/packages/remote-server/package.json +++ b/packages/remote-server/package.json @@ -14,7 +14,7 @@ "@veramo/remote-client": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-resolver": "^4.0.1", + "did-resolver": "^4.1.0", "express": "^4.18.2", "passport": "^0.6.0", "passport-http-bearer": "^1.0.1", diff --git a/packages/selective-disclosure/package.json b/packages/selective-disclosure/package.json index 6b6ee35de..8a017f6d3 100644 --- a/packages/selective-disclosure/package.json +++ b/packages/selective-disclosure/package.json @@ -22,7 +22,7 @@ "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.3", + "did-jwt": "^7.2.0", "uuid": "^9.0.0" }, "devDependencies": { diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 82661c090..1013214cb 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -14,7 +14,7 @@ "@veramo/did-discovery": "workspace:*", "@veramo/did-manager": "workspace:*", "@veramo/utils": "workspace:*", - "did-resolver": "^4.0.1" + "did-resolver": "^4.1.0" }, "devDependencies": { "typescript": "5.1.3" diff --git a/packages/tsconfig.settings.json b/packages/tsconfig.settings.json index 003b5d245..1b337f7ed 100644 --- a/packages/tsconfig.settings.json +++ b/packages/tsconfig.settings.json @@ -24,7 +24,7 @@ "ts-node": { "compilerOptions": { "module": "CommonJS" - }, + } }, "exclude": [ "**/__tests__/**/*", diff --git a/packages/utils/package.json b/packages/utils/package.json index 2b7059ab9..b32564b6a 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -18,9 +18,9 @@ "credential-status": "^2.0.5", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "did-jwt": "^7.1.0-alpha.3", - "did-jwt-vc": "^3.1.0", - "did-resolver": "^4.0.1", + "did-jwt": "^7.2.0", + "did-jwt-vc": "^3.2.1", + "did-resolver": "^4.1.0", "multiformats": "^12.0.0", "uint8arrays": "^4.0.3" }, From e71a5a0554c8524843de5f6dba324d370607296a Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Thu, 1 Jun 2023 12:22:05 +0200 Subject: [PATCH 08/11] fix(data-store): compare decrypted keys when importing --- .../src/identifier/private-key-store.ts | 11 +-- .../src/identifier/private-key-store.ts | 17 +++-- .../src/__tests__/jwk.test.ts | 68 +++++++++++++++++++ 3 files changed, 87 insertions(+), 9 deletions(-) create mode 100644 packages/did-provider-jwk/src/__tests__/jwk.test.ts diff --git a/packages/data-store-json/src/identifier/private-key-store.ts b/packages/data-store-json/src/identifier/private-key-store.ts index ae98cdf7c..2d6cf7760 100644 --- a/packages/data-store-json/src/identifier/private-key-store.ts +++ b/packages/data-store-json/src/identifier/private-key-store.ts @@ -72,17 +72,20 @@ export class PrivateKeyStoreJson extends AbstractPrivateKeyStore { alias, }), ) - if (this.secretBox && key.privateKeyHex) { - const copy = key.privateKeyHex - key.privateKeyHex = await this.secretBox.encrypt(copy) - } const existingKey = this.cacheTree.privateKeys[key.alias] + if (existingKey && this.secretBox) { + existingKey.privateKeyHex = await this.secretBox.decrypt(existingKey.privateKeyHex) + } if (existingKey && existingKey.privateKeyHex !== key.privateKeyHex) { throw new Error( `key_already_exists: A key with this alias exists but with different data. Please use a different alias.`, ) } + if (this.secretBox && key.privateKeyHex) { + const copy = key.privateKeyHex + key.privateKeyHex = await this.secretBox.encrypt(copy) + } const oldTree = deserialize(serialize(this.cacheTree, { lossy: true })) this.cacheTree.privateKeys[key.alias] = key await this.notifyUpdate(oldTree, this.cacheTree) diff --git a/packages/data-store/src/identifier/private-key-store.ts b/packages/data-store/src/identifier/private-key-store.ts index f50956dc3..0a23c80b7 100644 --- a/packages/data-store/src/identifier/private-key-store.ts +++ b/packages/data-store/src/identifier/private-key-store.ts @@ -1,6 +1,10 @@ -import { AbstractSecretBox, AbstractPrivateKeyStore } from '@veramo/key-manager' +import { + AbstractPrivateKeyStore, + AbstractSecretBox, + ImportablePrivateKey, + ManagedPrivateKey, +} from '@veramo/key-manager' import { DataSource } from 'typeorm' -import { ImportablePrivateKey, ManagedPrivateKey } from '@veramo/key-manager' import { PrivateKey } from '../entities/private-key.js' import { v4 as uuid4 } from 'uuid' import Debug from 'debug' @@ -47,18 +51,21 @@ export class PrivateKeyStore extends AbstractPrivateKeyStore { const key = new PrivateKey() key.alias = args.alias || uuid4() key.privateKeyHex = args.privateKeyHex - if (this.secretBox && key.privateKeyHex) { - key.privateKeyHex = await this.secretBox.encrypt(key.privateKeyHex) - } key.type = args.type debug('Saving private key data', args.alias) const keyRepo = await (await getConnectedDb(this.dbConnection)).getRepository(PrivateKey) const existingKey = await keyRepo.findOneBy({ alias: key.alias }) + if (existingKey && this.secretBox) { + existingKey.privateKeyHex = await this.secretBox.decrypt(existingKey.privateKeyHex) + } if (existingKey && existingKey.privateKeyHex !== key.privateKeyHex) { throw new Error( `key_already_exists: A key with this alias exists but with different data. Please use a different alias.`, ) } + if (this.secretBox && key.privateKeyHex) { + key.privateKeyHex = await this.secretBox.encrypt(key.privateKeyHex) + } await keyRepo.save(key) return key } diff --git a/packages/did-provider-jwk/src/__tests__/jwk.test.ts b/packages/did-provider-jwk/src/__tests__/jwk.test.ts new file mode 100644 index 000000000..bd46f8dcf --- /dev/null +++ b/packages/did-provider-jwk/src/__tests__/jwk.test.ts @@ -0,0 +1,68 @@ +import { JwkDIDProvider } from '../jwk-did-provider' +import { IDIDManager, IKeyManager } from "@veramo/core-types"; +import { createAgent } from '@veramo/core' +import { MemoryKeyStore, MemoryPrivateKeyStore, KeyManager } from '@veramo/key-manager' +import { KeyManagementSystem } from '@veramo/kms-local' +import { DIDManager, MemoryDIDStore } from "@veramo/did-manager"; + +const defaultKms = 'memory' +const ionDIDProvider = new JwkDIDProvider({ defaultKms }) + +const agent = createAgent({ + plugins: [ + new KeyManager({ + store: new MemoryKeyStore(), + kms: { + [defaultKms]: new KeyManagementSystem(new MemoryPrivateKeyStore()), + }, + }), + new DIDManager({ + providers: { + 'did:jwk': ionDIDProvider, + }, + defaultProvider: 'did:jwk', + store: new MemoryDIDStore(), + }), + ], +}) +describe('create did:jwk', () => { + it('Secp256k1', async () => { + const id = await agent.didManagerCreate({ + options: { + keyType: 'Secp256k1', + privateKeyHex: 'a5e81a8cd50cf5c31d5b87db3e153e2817f86de350a60edc2335f76d5c3b4e0d' + } + }) + expect(id.did).toEqual('did:jwk:eyJhbGciOiJFUzI1NksiLCJjcnYiOiJzZWNwMjU2azEiLCJrdHkiOiJFQyIsInVzZSI6InNpZyIsIngiOiJVNV85NlJMQWxMeEl0a3llNXhzcnJzNGt4eEM4clN4N3JNN1dGZllLNVRrIiwieSI6IlNjM0pVM25yVUZWdEVjc0stckRscHNxTXRIWFVFN0x4SXdmTUxYOVVPTjQifQ') + }) + + it('Ed25519', async () => { + const id = await agent.didManagerCreate({ + options: { + keyType: 'Ed25519', + privateKeyHex: 'a5e81a8cd50cf5c31d5b87db3e153e2817f86de350a60edc2335f76d5c3b4e0d' + } + }) + expect(id.did).toEqual('did:jwk:eyJhbGciOiJFZERTQSIsImNydiI6IkVkMjU1MTkiLCJrdHkiOiJPS1AiLCJ1c2UiOiJzaWciLCJ4IjoiTTNodVJCZnJpU3lHemlJS3pUSE5nS1djSVhuX3IxUzYxRnZBcUQyVmhSUSJ9') + }) + + it('X25519', async () => { + const id = await agent.didManagerCreate({ + options: { + keyType: 'X25519', + privateKeyHex: 'a5e81a8cd50cf5c31d5b87db3e153e2817f86de350a60edc2335f76d5c3b4e0d' + } + }) + expect(id.did).toEqual('did:jwk:eyJhbGciOiJFQ0RILUVTIiwiY3J2IjoiWDI1NTE5Iiwia3R5IjoiT0tQIiwidXNlIjoiZW5jIiwieCI6IlVuNFNEWk12R2dReENiZkRBOWpwNjlyNDdvVWdsSF93eU1aRjU2THAwbU0ifQ') + }) + + it('Secp256r1', async () => { + const id = await agent.didManagerCreate({ + options: { + keyType: 'Secp256r1', + privateKeyHex: 'a5e81a8cd50cf5c31d5b87db3e153e2817f86de350a60edc2335f76d5c3b4e0d' + } + }) + expect(id.did).toEqual('did:jwk:eyJhbGciOiJFUzI1NiIsImNydiI6IlAtMjU2Iiwia3R5IjoiRUMiLCJ1c2UiOiJzaWciLCJ4IjoiejhTTlNYTVgxUjZlVEt6SkdtLUE3ZWpBZkZsdURsaUhKdW9nT2FQc0REUSIsInkiOiJLUUtBTWVwTU56dHJseTB6ODI3MTg0dDRQdkFuU0lULW1MMFFsaUg1enU0In0') + }) +}) From 56a9e2f818c1aee114b0117c29e2dd8c278f5728 Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Thu, 1 Jun 2023 12:52:59 +0200 Subject: [PATCH 09/11] feat(did-comm): initial support for A256CBC-HS512 content encryption --- .../did-comm/src/__tests__/encryption.test.ts | 615 ++++++++++++++++-- .../did-comm/src/encryption/aesEncryption.ts | 256 +++++++- .../src/encryption/createEncrypter.ts | 100 +++ 3 files changed, 912 insertions(+), 59 deletions(-) create mode 100644 packages/did-comm/src/encryption/createEncrypter.ts diff --git a/packages/did-comm/src/__tests__/encryption.test.ts b/packages/did-comm/src/__tests__/encryption.test.ts index 9dce01a2f..465c4f327 100644 --- a/packages/did-comm/src/__tests__/encryption.test.ts +++ b/packages/did-comm/src/__tests__/encryption.test.ts @@ -1,7 +1,11 @@ import { createJWE, createX25519ECDH, Decrypter, decryptJWE, ECDH, Encrypter, JWE } from 'did-jwt' -import { randomBytes } from "@noble/hashes/utils"; -import { generateX25519KeyPairFromSeed } from "../utils.js"; +import { randomBytes } from '@noble/hashes/utils' +import { generateX25519KeyPairFromSeed } from '../utils.js' import { + a256cbcHs512AnonDecrypterX25519WithA256KW, + a256cbcHs512AnonEncrypterX25519WithA256KW, + a256cbcHs512AuthDecrypterX25519WithA256KW, + a256cbcHs512AuthEncrypterX25519WithA256KW, a256gcmAnonDecrypterX25519WithA256KW, a256gcmAnonEncrypterX25519WithA256KW, a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW, @@ -11,7 +15,7 @@ import { xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, } from '../encryption/aesEncryption.js' -import { decodeBase64url, encodeBase64url } from "../../../utils/src"; +import { decodeBase64url, encodeBase64url } from '../../../utils/src' import * as u8a from 'uint8arrays' @@ -132,6 +136,7 @@ const test_vectors = { fail: [], invalid: [], } + describe('One recipient A256KW', () => { let pubkey, secretkey, cleartext: Uint8Array, encrypter: Encrypter, decrypter: Decrypter @@ -226,7 +231,6 @@ describe('Multiple recipients A256KW', () => { }) }) - describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encryption', () => { describe('One recipient', () => { let cleartext: Uint8Array, recipientKey: any, senderKey: any, decrypter: Decrypter @@ -239,7 +243,10 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt }) it('Creates with only ciphertext', async () => { - const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) expect.assertions(3) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -249,9 +256,13 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt it('Creates with kid, no apu and no apv', async () => { const kid = 'did:example:receiver#key-1' - const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { - kid, - }) + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + kid, + }, + ) expect.assertions(6) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -265,10 +276,14 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt it('Creates with no kid, apu and apv', async () => { const apu = encodeBase64url('Alice') const apv = encodeBase64url('Bob') - const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { - apu, - apv, - }) + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + apu, + apv, + }, + ) expect.assertions(6) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -283,11 +298,15 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt const kid = 'did:example:receiver#key-1' const apu = encodeBase64url('Alice') const apv = encodeBase64url('Bob') - const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { - kid, - apu, - apv, - }) + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + kid, + apu, + apv, + }, + ) expect.assertions(6) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -299,7 +318,10 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt }) it('Creates with data in protected header', async () => { - const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) const skid = 'did:example:sender#key-1' expect.assertions(3) const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) @@ -309,7 +331,10 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt }) it('Creates with aad', async () => { - const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) expect.assertions(4) const aad = u8a.fromString('this data is authenticated') const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) @@ -337,9 +362,15 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt }) it('creates and decrypts auth JWE', async () => { - const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(receiverPair.publicKey, senderRemoteECDH) + const encrypter = xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + receiverPair.publicKey, + senderRemoteECDH, + ) const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) - const decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(receiverRemoteECDH, senderPair.publicKey) + const decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( + receiverRemoteECDH, + senderPair.publicKey, + ) const decryptedBytes = await decryptJWE(jwe, decrypter) const receivedMessage = u8a.toString(decryptedBytes) expect(receivedMessage).toEqual(message) @@ -370,34 +401,40 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) cleartext = u8a.fromString('my secret message') - recipients[0] = { kid: 'did:example:receiver1#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[0] = { + kid: 'did:example:receiver1#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } recipients[0] = { ...recipients[0], ...{ encrypter: xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( recipients[0].recipientkey.publicKey, senderkey.secretKey, - { kid: recipients[0].kid } + { kid: recipients[0].kid }, ), decrypter: xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( recipients[0].recipientkey.secretKey, - senderkey.publicKey + senderkey.publicKey, ), }, } - recipients[1] = { kid: 'did:example:receiver2#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[1] = { + kid: 'did:example:receiver2#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } recipients[1] = { ...recipients[1], ...{ encrypter: xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( recipients[1].recipientkey.publicKey, senderkey.secretKey, - { kid: recipients[1].kid } + { kid: recipients[1].kid }, ), decrypter: xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( recipients[1].recipientkey.secretKey, - senderkey.publicKey + senderkey.publicKey, ), }, } @@ -432,7 +469,7 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with XC20P content encrypt cleartext, [recipients[0].encrypter, recipients[1].encrypter], { more: 'protected' }, - aad + aad, ) expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'XC20P', more: 'protected' }) @@ -556,20 +593,32 @@ describe('ECDH-ES+A256KW (X25519), Key Wrapping Mode with A256GCM content encryp senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) cleartext = u8a.fromString('my secret message') - recipients[0] = { kid: 'did:example:receiver1#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[0] = { + kid: 'did:example:receiver1#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } recipients[0] = { ...recipients[0], ...{ - encrypter: a256gcmAnonEncrypterX25519WithA256KW(recipients[0].recipientkey.publicKey, recipients[0].kid), + encrypter: a256gcmAnonEncrypterX25519WithA256KW( + recipients[0].recipientkey.publicKey, + recipients[0].kid, + ), decrypter: a256gcmAnonDecrypterX25519WithA256KW(recipients[0].recipientkey.secretKey), }, } - recipients[1] = { kid: 'did:example:receiver2#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[1] = { + kid: 'did:example:receiver2#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } recipients[1] = { ...recipients[1], ...{ - encrypter: a256gcmAnonEncrypterX25519WithA256KW(recipients[1].recipientkey.publicKey, recipients[1].kid), + encrypter: a256gcmAnonEncrypterX25519WithA256KW( + recipients[1].recipientkey.publicKey, + recipients[1].kid, + ), decrypter: a256gcmAnonDecrypterX25519WithA256KW(recipients[1].recipientkey.secretKey), }, } @@ -604,7 +653,7 @@ describe('ECDH-ES+A256KW (X25519), Key Wrapping Mode with A256GCM content encryp cleartext, [recipients[0].encrypter, recipients[1].encrypter], { more: 'protected' }, - aad + aad, ) expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected' }) @@ -636,7 +685,10 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry }) it('Creates with only ciphertext', async () => { - const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) expect.assertions(3) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -646,9 +698,13 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry it('Creates with kid, no apu and no apv', async () => { const kid = 'did:example:receiver#key-1' - const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { - kid, - }) + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + kid, + }, + ) expect.assertions(6) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -662,10 +718,14 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry it('Creates with no kid, with apu and apv', async () => { const apu = encodeBase64url('Alice') const apv = encodeBase64url('Bob') - const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { - apu, - apv, - }) + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + apu, + apv, + }, + ) expect.assertions(6) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -680,11 +740,15 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry const kid = 'did:example:receiver#key-1' const apu = encodeBase64url('Alice') const apv = encodeBase64url('Bob') - const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey, { - kid, - apu, - apv, - }) + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + kid, + apu, + apv, + }, + ) expect.assertions(6) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -696,7 +760,10 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry }) it('Creates with data in protected header', async () => { - const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) const skid = 'did:example:sender#key-1' expect.assertions(3) const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) @@ -706,7 +773,10 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry }) it('Creates with aad', async () => { - const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) expect.assertions(4) const aad = u8a.fromString('this data is authenticated') const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) @@ -725,9 +795,15 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry const senderRemoteECDH: ECDH = createX25519ECDH(senderPair.secretKey) it('creates JWE with remote ECDH', async () => { - const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(receiverPair.publicKey, senderRemoteECDH) + const encrypter = a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + receiverPair.publicKey, + senderRemoteECDH, + ) const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) - const decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW(receiverRemoteECDH, senderPair.publicKey) + const decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( + receiverRemoteECDH, + senderPair.publicKey, + ) const decryptedBytes = await decryptJWE(jwe, decrypter) const receivedMessage = u8a.toString(decryptedBytes) expect(receivedMessage).toEqual(message) @@ -743,34 +819,40 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) cleartext = u8a.fromString('my secret message') - recipients[0] = { kid: 'did:example:receiver1#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[0] = { + kid: 'did:example:receiver1#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } recipients[0] = { ...recipients[0], ...{ encrypter: a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( recipients[0].recipientkey.publicKey, senderkey.secretKey, - { kid: recipients[0].kid } + { kid: recipients[0].kid }, ), decrypter: a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( recipients[0].recipientkey.secretKey, - senderkey.publicKey + senderkey.publicKey, ), }, } - recipients[1] = { kid: 'did:example:receiver2#key-1', recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)) } + recipients[1] = { + kid: 'did:example:receiver2#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } recipients[1] = { ...recipients[1], ...{ encrypter: a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( recipients[1].recipientkey.publicKey, senderkey.secretKey, - { kid: recipients[1].kid } + { kid: recipients[1].kid }, ), decrypter: a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( recipients[1].recipientkey.secretKey, - senderkey.publicKey + senderkey.publicKey, ), }, } @@ -805,7 +887,7 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry cleartext, [recipients[0].encrypter, recipients[1].encrypter], { more: 'protected' }, - aad + aad, ) expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256GCM', more: 'protected' }) @@ -824,3 +906,422 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry }) }) }) + + +describe('ECDH-ES+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content encryption', () => { + describe('One recipient', () => { + let cleartext: Uint8Array, recipientKey: any, senderKey: any, decrypter: Decrypter + + beforeEach(() => { + recipientKey = generateX25519KeyPairFromSeed(randomBytes(32)) + senderKey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + decrypter = a256cbcHs512AnonDecrypterX25519WithA256KW(recipientKey.secretKey) + }) + + it('Creates with only ciphertext', async () => { + const encrypter = a256cbcHs512AnonEncrypterX25519WithA256KW(recipientKey.publicKey) + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid, no apu and no apv', async () => { + const kid = 'did:example:receiver#key-1' + const encrypter = a256cbcHs512AnonEncrypterX25519WithA256KW(recipientKey.publicKey, kid) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toBeUndefined() + expect(jwe.recipients!![0].header.apv).toBeUndefined() + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with no kid, with apv', async () => { + const apv = encodeBase64url('Bob') + const encrypter = a256cbcHs512AnonEncrypterX25519WithA256KW(recipientKey.publicKey, undefined, apv) + expect.assertions(5) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(jwe.recipients!![0].header.kid).toBeUndefined() + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid and apv', async () => { + const kid = 'did:example:receiver#key-1' + const apv = encodeBase64url('Bob') + const encrypter = a256cbcHs512AnonEncrypterX25519WithA256KW(recipientKey.publicKey, kid, apv) + expect.assertions(5) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + const encrypter = a256cbcHs512AnonEncrypterX25519WithA256KW(recipientKey.publicKey) + const skid = 'did:example:sender#key-1' + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', skid, more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + const encrypter = a256cbcHs512AnonEncrypterX25519WithA256KW(recipientKey.publicKey) + expect.assertions(4) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + describe('using remote ECDH', () => { + const message = 'hello world' + const receiverPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const receiverRemoteECDH = createX25519ECDH(receiverPair.secretKey) + + it('creates JWE with remote ECDH', async () => { + const encrypter = a256cbcHs512AnonEncrypterX25519WithA256KW(receiverPair.publicKey) + const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) + const decrypter = a256cbcHs512AnonDecrypterX25519WithA256KW(receiverRemoteECDH) + const decryptedBytes = await decryptJWE(jwe, decrypter) + const receivedMessage = u8a.toString(decryptedBytes) + expect(receivedMessage).toEqual(message) + }) + }) + }) + + describe('Multiple recipients', () => { + let cleartext: any, senderkey: any + const recipients: any[] = [] + + beforeEach(() => { + senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + + recipients[0] = { + kid: 'did:example:receiver1#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } + recipients[0] = { + ...recipients[0], + ...{ + encrypter: a256cbcHs512AnonEncrypterX25519WithA256KW( + recipients[0].recipientkey.publicKey, + recipients[0].kid, + ), + decrypter: a256cbcHs512AnonDecrypterX25519WithA256KW(recipients[0].recipientkey.secretKey), + }, + } + + recipients[1] = { + kid: 'did:example:receiver2#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } + recipients[1] = { + ...recipients[1], + ...{ + encrypter: a256cbcHs512AnonEncrypterX25519WithA256KW( + recipients[1].recipientkey.publicKey, + recipients[1].kid, + ), + decrypter: a256cbcHs512AnonDecrypterX25519WithA256KW(recipients[1].recipientkey.secretKey), + }, + } + }) + + it('Creates with only ciphertext', async () => { + expect.assertions(4) + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + expect.assertions(4) + const skid = 'did:example:sender#key-1' + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter], { + more: 'protected', + skid, + }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected', skid }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + expect.assertions(6) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE( + cleartext, + [recipients[0].encrypter, recipients[1].encrypter], + { more: 'protected' }, + aad, + ) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + it('Incompatible encrypters throw', async () => { + expect.assertions(1) + const enc1 = { enc: 'cool enc alg1' } as Encrypter + const enc2 = { enc: 'cool enc alg2' } as Encrypter + await expect(createJWE(cleartext, [enc1, enc2])).rejects.toThrowError('Incompatible encrypters passed') + }) + }) +}) + +describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content encryption', () => { + describe('One recipient', () => { + let cleartext: Uint8Array, recipientKey: any, senderKey: any, decrypter: Decrypter + + beforeEach(() => { + recipientKey = generateX25519KeyPairFromSeed(randomBytes(32)) + senderKey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + decrypter = a256cbcHs512AuthDecrypterX25519WithA256KW(recipientKey.secretKey, senderKey.publicKey) + }) + + it('Creates with only ciphertext', async () => { + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid, no apu and no apv', async () => { + const kid = 'did:example:receiver#key-1' + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + kid, + }, + ) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toBeUndefined() + expect(jwe.recipients!![0].header.apv).toBeUndefined() + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with no kid, with apu and apv', async () => { + const apu = encodeBase64url('Alice') + const apv = encodeBase64url('Bob') + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + apu, + apv, + }, + ) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(jwe.recipients!![0].header.kid).toBeUndefined() + expect(jwe.recipients!![0].header.apu).toEqual(apu) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with kid and apu and apv', async () => { + const kid = 'did:example:receiver#key-1' + const apu = encodeBase64url('Alice') + const apv = encodeBase64url('Bob') + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + { + kid, + apu, + apv, + }, + ) + expect.assertions(6) + const jwe = await createJWE(cleartext, [encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(jwe.recipients!![0].header.kid).toEqual(kid) + expect(jwe.recipients!![0].header.apu).toEqual(apu) + expect(jwe.recipients!![0].header.apv).toEqual(apv) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) + const skid = 'did:example:sender#key-1' + expect.assertions(3) + const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', skid, more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientKey.publicKey, + senderKey.secretKey, + ) + expect.assertions(4) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected' }) + expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + describe('using remote ECDH', () => { + const message = 'hello world' + const receiverPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const receiverRemoteECDH = createX25519ECDH(receiverPair.secretKey) + const senderPair = generateX25519KeyPairFromSeed(randomBytes(32)) + const senderRemoteECDH: ECDH = createX25519ECDH(senderPair.secretKey) + + it('creates JWE with remote ECDH', async () => { + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( + receiverPair.publicKey, + senderRemoteECDH, + ) + const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) + const decrypter = a256cbcHs512AuthDecrypterX25519WithA256KW( + receiverRemoteECDH, + senderPair.publicKey, + ) + const decryptedBytes = await decryptJWE(jwe, decrypter) + const receivedMessage = u8a.toString(decryptedBytes) + expect(receivedMessage).toEqual(message) + }) + }) + }) + + describe('Multiple recipients', () => { + let cleartext: any, senderkey: any + const recipients: any[] = [] + + beforeEach(() => { + senderkey = generateX25519KeyPairFromSeed(randomBytes(32)) + cleartext = u8a.fromString('my secret message') + + recipients[0] = { + kid: 'did:example:receiver1#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } + recipients[0] = { + ...recipients[0], + ...{ + encrypter: a256cbcHs512AuthEncrypterX25519WithA256KW( + recipients[0].recipientkey.publicKey, + senderkey.secretKey, + { kid: recipients[0].kid }, + ), + decrypter: a256cbcHs512AuthDecrypterX25519WithA256KW( + recipients[0].recipientkey.secretKey, + senderkey.publicKey, + ), + }, + } + + recipients[1] = { + kid: 'did:example:receiver2#key-1', + recipientkey: generateX25519KeyPairFromSeed(randomBytes(32)), + } + recipients[1] = { + ...recipients[1], + ...{ + encrypter: a256cbcHs512AuthEncrypterX25519WithA256KW( + recipients[1].recipientkey.publicKey, + senderkey.secretKey, + { kid: recipients[1].kid }, + ), + decrypter: a256cbcHs512AuthDecrypterX25519WithA256KW( + recipients[1].recipientkey.secretKey, + senderkey.publicKey, + ), + }, + } + }) + + it('Creates with only ciphertext', async () => { + expect.assertions(4) + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter]) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + }) + + it('Creates with data in protected header', async () => { + expect.assertions(4) + const skid = 'did:example:sender#key-1' + const jwe = await createJWE(cleartext, [recipients[0].encrypter, recipients[1].encrypter], { + more: 'protected', + skid, + }) + expect(jwe.aad).toBeUndefined() + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected', skid }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + }) + + it('Creates with aad', async () => { + expect.assertions(6) + const aad = u8a.fromString('this data is authenticated') + const jwe = await createJWE( + cleartext, + [recipients[0].encrypter, recipients[1].encrypter], + { more: 'protected' }, + aad, + ) + expect(u8a.fromString(jwe.aad!!, 'base64url')).toEqual(aad) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected' }) + expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) + expect(await decryptJWE(jwe, recipients[1].decrypter)).toEqual(cleartext) + delete jwe.aad + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + await expect(decryptJWE(jwe, recipients[0].decrypter)).rejects.toThrowError('Failed to decrypt') + }) + + it('Incompatible encrypters throw', async () => { + expect.assertions(1) + const enc1 = { enc: 'cool enc alg1' } as Encrypter + const enc2 = { enc: 'cool enc alg2' } as Encrypter + await expect(createJWE(cleartext, [enc1, enc2])).rejects.toThrowError('Incompatible encrypters passed') + }) + }) +}) diff --git a/packages/did-comm/src/encryption/aesEncryption.ts b/packages/did-comm/src/encryption/aesEncryption.ts index 71e22cf33..b69ff0506 100644 --- a/packages/did-comm/src/encryption/aesEncryption.ts +++ b/packages/did-comm/src/encryption/aesEncryption.ts @@ -11,7 +11,6 @@ import type { import { computeX25519Ecdh1PUv3Kek, computeX25519EcdhEsKek, - createFullEncrypter, createX25519Ecdh1PUv3Kek, createX25519EcdhEsKek, xc20pDirDecrypter, @@ -22,7 +21,9 @@ import { AESKW } from '@stablelib/aes-kw' import { AES } from '@stablelib/aes' import { GCM } from '@stablelib/gcm' import { fromString } from 'uint8arrays/from-string' -import { base64ToBytes, bytesToBase64url, encodeBase64url } from '@veramo/utils' +import { base64ToBytes, bytesToBase64url, concat, encodeBase64url } from '@veramo/utils' +import crypto from 'isomorphic-webcrypto' +import { createFullEncrypter } from './createEncrypter.js' /** * Creates a wrapper using AES-KW @@ -97,6 +98,206 @@ export function a256gcmDirDecrypter(key: Uint8Array): Decrypter { return { alg: 'dir', enc: 'A256GCM', decrypt } } +const MAX_INT32 = 2 ** 32 + +function writeUInt32BE(buf: Uint8Array, value: number, offset?: number) { + if (value < 0 || value >= MAX_INT32) { + throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${value}`) + } + buf.set([value >>> 24, value >>> 16, value >>> 8, value & 0xff], offset) +} + +function uint64be(value: number) { + const high = Math.floor(value / MAX_INT32) + const low = value % MAX_INT32 + const buf = new Uint8Array(8) + writeUInt32BE(buf, high, 0) + writeUInt32BE(buf, low, 4) + return buf +} + +/** + * Code copied and adapted from https://github.com/panva/jose + * @param enc - the JWE content encryption algorithm (e.g. A256CBC-HS512) + * @param plaintext - the content to encrypt + * @param cek - the raw content encryption key + * @param providedIV - optional provided Initialization Vector + * @param aad - optional additional authenticated data + */ +async function cbcEncrypt( + enc: string = 'A256CBC-HS512', + plaintext: Uint8Array, + cek: Uint8Array, + providedIV?: Uint8Array, + aad: Uint8Array = new Uint8Array(0), +) { + // A256CBC-HS512 CEK size should be 512 bits; first 256 bits are used for HMAC with SHA-512 and the rest for AES-CBC + const keySize = parseInt(enc.slice(1, 4), 10) + const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, [ + 'encrypt', + ]) + const macKey = await crypto.subtle.importKey( + 'raw', + cek.subarray(0, keySize >> 3), + { + hash: `SHA-${keySize << 1}`, + name: 'HMAC', + }, + false, + ['sign'], + ) + + if (providedIV && providedIV.length !== keySize >> 4) { + throw new Error(`illegal_argument: Invalid IV size, expected ${keySize >> 4}, got ${providedIV.length}`) + } + const iv = providedIV ?? randomBytes(keySize >> 4) + + const ciphertext = new Uint8Array( + await crypto.subtle.encrypt( + { + iv, + name: 'AES-CBC', + }, + encKey, + plaintext, + ), + ) + + const macData = concat([aad, iv, ciphertext, uint64be(aad.length << 3)]) + const tag = new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3)) + + return { enc: 'dir', ciphertext, tag, iv } +} + +export function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean { + if (a.length !== b.length) { + return false + } + let result = 0 + let len = a.length + for (let i = 0; i < len; i++) { + result |= a[i] ^ b[i] + } + return result === 0 +} + +async function cbcDecrypt( + enc: string = 'A256CBC-HS512', + cek: Uint8Array, + ciphertext: Uint8Array, + iv: Uint8Array, + tag: Uint8Array, + aad: Uint8Array, +) { + const keySize = parseInt(enc.slice(1, 4), 10) + const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, [ + 'decrypt', + ]) + const macKey = await crypto.subtle.importKey( + 'raw', + cek.subarray(0, keySize >> 3), + { + hash: `SHA-${keySize << 1}`, + name: 'HMAC', + }, + false, + ['sign'], + ) + + const macData = concat([aad, iv, ciphertext, uint64be(aad.length << 3)]) + const expectedTag = new Uint8Array( + (await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3), + ) + + let macCheckPassed!: boolean + try { + macCheckPassed = timingSafeEqual(tag, expectedTag) + } catch { + // + } + if (!macCheckPassed) { + // current JWE decryption pipeline tries to decrypt multiple times with different keys, so return null instead of + // throwing an error + return null + // throw new Error('jwe_decryption_failed: MAC check failed') + } + + let plaintext: Uint8Array | null = null + try { + plaintext = new Uint8Array(await crypto.subtle.decrypt({ iv, name: 'AES-CBC' }, encKey, ciphertext)) + } catch (e: any) { + // current JWE decryption pipeline tries to decrypt multiple times with different keys, so return null instead of + // throwing an error + } + + return plaintext +} + +export function a256cbcHs512DirDecrypter(key: Uint8Array): Decrypter { + // const cipher = new GCM(new AES(key)) + + async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise { + // did-jwt#decryptJWE combines the ciphertext and the tag into a single `sealed` array + const TAG_LENGTH = 32 + const ciphertext = sealed.subarray(0, sealed.length - TAG_LENGTH) + const tag = sealed.subarray(sealed.length - TAG_LENGTH) + return cbcDecrypt('A256CBC-HS512', key, ciphertext, iv, tag, aad ?? new Uint8Array(0)) + } + + return { alg: 'dir', enc: 'A256GCM', decrypt } +} + +export function a256cbcHs512DirEncrypter(cek: Uint8Array): Encrypter { + const enc = 'A256CBC-HS512' + const alg = 'dir' + + async function encrypt( + cleartext: Uint8Array, + protectedHeader: ProtectedHeader = {}, + aad?: Uint8Array, + ): Promise { + const protHeader = encodeBase64url(JSON.stringify(Object.assign({ alg }, protectedHeader, { enc }))) + const encodedAad = fromString(aad ? `${protHeader}.${bytesToBase64url(aad)}` : protHeader, 'utf-8') + const iv: Uint8Array | undefined = protectedHeader.iv ? base64ToBytes(protectedHeader.iv) : undefined + return { + ...(await cbcEncrypt('A256CBC-HS512', cleartext, cek, iv, encodedAad)), + protectedHeader: protHeader, + } + } + + return { alg, enc, encrypt } +} + +export function a256cbcHs512AnonEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, + ) +} + +export function a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {}, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, + ) +} + export function a256gcmAnonEncrypterX25519WithA256KW( recipientPublicKey: Uint8Array, kid?: string, @@ -151,6 +352,57 @@ export function xc20pAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | return { alg, enc, decrypt } } +export function a256cbcHs512AnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+A256KW' + const enc = 'A256CBC-HS512' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function a256cbcHs512AuthDecrypterX25519WithA256KW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array, +): Decrypter { + const alg = 'ECDH-1PU+A256KW' + const enc = 'A256CBC-HS512' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + export function a256gcmAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { const alg = 'ECDH-ES+A256KW' const enc = 'A256GCM' diff --git a/packages/did-comm/src/encryption/createEncrypter.ts b/packages/did-comm/src/encryption/createEncrypter.ts new file mode 100644 index 000000000..4471b9941 --- /dev/null +++ b/packages/did-comm/src/encryption/createEncrypter.ts @@ -0,0 +1,100 @@ +import { + AuthEncryptParams, + ContentEncrypter, + ECDH, + Encrypter, + EncryptionResult, + EphemeralKeyPair, + genX25519EphemeralKeyPair, + KekCreator, + KeyWrapper, + ProtectedHeader, + Recipient, +} from 'did-jwt' +import { bytesToBase64url } from '@veramo/utils' +import { randomBytes } from '@noble/hashes/utils' + +/** + * Compute the length of the content encryption key based on the algorithm. + * Only considering the algorithms known to did-comm. + * @param enc + */ +const cekLength = (enc: string) => { + switch (enc) { + case 'A256CBC-HS512': + return 512 + case 'A256GCM': + case 'XC20P': + return 256 + default: + return 256 + } +} + +// duplicate of the method from did-jwt, where the Content Encryption key length is assumed to be 256 bits +export function createFullEncrypter( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH | undefined, + options: Partial = {}, + kekCreator: KekCreator, + keyWrapper: KeyWrapper, + contentEncrypter: ContentEncrypter, +): Encrypter { + async function encryptCek(cek: Uint8Array, ephemeralKeyPair?: EphemeralKeyPair): Promise { + const { epk, kek } = await kekCreator.createKek( + recipientPublicKey, + senderSecret, + `${kekCreator.alg}+${keyWrapper.alg}`, + options.apu, + options.apv, + ephemeralKeyPair, + ) + const res = await keyWrapper.from(kek).wrap(cek) + const recipient: Recipient = { + encrypted_key: bytesToBase64url(res.ciphertext), + header: {}, + } + if (res.iv) recipient.header.iv = bytesToBase64url(res.iv) + if (res.tag) recipient.header.tag = bytesToBase64url(res.tag) + if (options.kid) recipient.header.kid = options.kid + if (options.apu) recipient.header.apu = options.apu + if (options.apv) recipient.header.apv = options.apv + if (!ephemeralKeyPair) { + recipient.header.alg = `${kekCreator.alg}+${keyWrapper.alg}` + recipient.header.epk = epk + } + + return recipient + } + + async function encrypt( + cleartext: Uint8Array, + protectedHeader: ProtectedHeader = {}, + aad?: Uint8Array, + ephemeralKeyPair?: EphemeralKeyPair, + ): Promise { + // we won't want alg to be set to dir from xc20pDirEncrypter + Object.assign(protectedHeader, { alg: undefined }) + // Content Encryption Key + const cek = randomBytes(cekLength(contentEncrypter.enc) >> 3) + const recipient: Recipient = await encryptCek(cek, ephemeralKeyPair) + // getting an ephemeral key means the epk is set only once per all recipients + if (ephemeralKeyPair) { + protectedHeader.alg = `${kekCreator.alg}+${keyWrapper.alg}` + protectedHeader.epk = ephemeralKeyPair.publicKeyJWK + } + return { + ...(await contentEncrypter.from(cek).encrypt(cleartext, protectedHeader, aad)), + recipient, + cek, + } + } + + return { + alg: keyWrapper.alg, + enc: contentEncrypter.enc, + encrypt, + encryptCek, + genEpk: genX25519EphemeralKeyPair, + } +} From cde9e31e3a0f5b92e34000936330feb417ff2c17 Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Tue, 6 Jun 2023 10:06:43 +0200 Subject: [PATCH 10/11] feat(did-comm): add support for A256CBC-HS512 content encryption --- packages/did-comm/package.json | 1 + .../did-comm/src/__tests__/encryption.test.ts | 52 +- .../did-comm/src/__tests__/packing.test.ts | 495 ++++++++++------- packages/did-comm/src/didcomm.ts | 149 +++-- .../src/encryption/a256cbc-hs512-dir.ts | 175 ++++++ .../did-comm/src/encryption/a256gcm-dir.ts | 52 ++ .../src/encryption/a256kw-encrypters.ts | 270 +++++++++ packages/did-comm/src/encryption/a256kw.ts | 28 + .../did-comm/src/encryption/aesEncryption.ts | 512 ------------------ .../src/encryption/xc20pkw-encrypters.ts | 285 ++++++++++ packages/did-comm/src/encryption/xc20pkw.ts | 48 ++ packages/did-comm/src/plugin.schema.json | 3 +- packages/did-comm/src/types/message-types.ts | 2 +- 13 files changed, 1286 insertions(+), 786 deletions(-) create mode 100644 packages/did-comm/src/encryption/a256cbc-hs512-dir.ts create mode 100644 packages/did-comm/src/encryption/a256gcm-dir.ts create mode 100644 packages/did-comm/src/encryption/a256kw-encrypters.ts create mode 100644 packages/did-comm/src/encryption/a256kw.ts delete mode 100644 packages/did-comm/src/encryption/aesEncryption.ts create mode 100644 packages/did-comm/src/encryption/xc20pkw-encrypters.ts create mode 100644 packages/did-comm/src/encryption/xc20pkw.ts diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index 9128c2785..290044dd1 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -23,6 +23,7 @@ "@stablelib/aes": "^1.0.1", "@stablelib/aes-kw": "^1.0.1", "@stablelib/gcm": "^1.0.2", + "@stablelib/xchacha20poly1305": "^1.0.1", "@veramo/core-types": "workspace:^", "@veramo/message-handler": "workspace:^", "@veramo/utils": "workspace:^", diff --git a/packages/did-comm/src/__tests__/encryption.test.ts b/packages/did-comm/src/__tests__/encryption.test.ts index 465c4f327..a6258ef82 100644 --- a/packages/did-comm/src/__tests__/encryption.test.ts +++ b/packages/did-comm/src/__tests__/encryption.test.ts @@ -14,7 +14,7 @@ import { xc20pAnonEncrypterX25519WithA256KW, xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, -} from '../encryption/aesEncryption.js' +} from '../encryption/a256kw-encrypters.js' import { decodeBase64url, encodeBase64url } from '../../../utils/src' import * as u8a from 'uint8arrays' @@ -907,7 +907,6 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256GCM content encry }) }) - describe('ECDH-ES+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content encryption', () => { describe('One recipient', () => { let cleartext: Uint8Array, recipientKey: any, senderKey: any, decrypter: Decrypter @@ -972,7 +971,11 @@ describe('ECDH-ES+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content expect.assertions(3) const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) expect(jwe.aad).toBeUndefined() - expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', skid, more: 'protected' }) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ + enc: 'A256CBC-HS512', + skid, + more: 'protected', + }) expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) }) @@ -1060,7 +1063,11 @@ describe('ECDH-ES+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content skid, }) expect(jwe.aad).toBeUndefined() - expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected', skid }) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ + enc: 'A256CBC-HS512', + more: 'protected', + skid, + }) expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) }) @@ -1104,10 +1111,7 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content }) it('Creates with only ciphertext', async () => { - const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( - recipientKey.publicKey, - senderKey.secretKey, - ) + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) expect.assertions(3) const jwe = await createJWE(cleartext, [encrypter]) expect(jwe.aad).toBeUndefined() @@ -1179,23 +1183,21 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content }) it('Creates with data in protected header', async () => { - const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( - recipientKey.publicKey, - senderKey.secretKey, - ) + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) const skid = 'did:example:sender#key-1' expect.assertions(3) const jwe = await createJWE(cleartext, [encrypter], { skid, more: 'protected' }) expect(jwe.aad).toBeUndefined() - expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', skid, more: 'protected' }) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ + enc: 'A256CBC-HS512', + skid, + more: 'protected', + }) expect(await decryptJWE(jwe, decrypter)).toEqual(cleartext) }) it('Creates with aad', async () => { - const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( - recipientKey.publicKey, - senderKey.secretKey, - ) + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW(recipientKey.publicKey, senderKey.secretKey) expect.assertions(4) const aad = u8a.fromString('this data is authenticated') const jwe = await createJWE(cleartext, [encrypter], { more: 'protected' }, aad) @@ -1214,15 +1216,9 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content const senderRemoteECDH: ECDH = createX25519ECDH(senderPair.secretKey) it('creates JWE with remote ECDH', async () => { - const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW( - receiverPair.publicKey, - senderRemoteECDH, - ) + const encrypter = a256cbcHs512AuthEncrypterX25519WithA256KW(receiverPair.publicKey, senderRemoteECDH) const jwe: JWE = await createJWE(u8a.fromString(message), [encrypter]) - const decrypter = a256cbcHs512AuthDecrypterX25519WithA256KW( - receiverRemoteECDH, - senderPair.publicKey, - ) + const decrypter = a256cbcHs512AuthDecrypterX25519WithA256KW(receiverRemoteECDH, senderPair.publicKey) const decryptedBytes = await decryptJWE(jwe, decrypter) const receivedMessage = u8a.toString(decryptedBytes) expect(receivedMessage).toEqual(message) @@ -1294,7 +1290,11 @@ describe('ECDH-1PU+A256KW (X25519), Key Wrapping Mode with A256CBC-HS512 content skid, }) expect(jwe.aad).toBeUndefined() - expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ enc: 'A256CBC-HS512', more: 'protected', skid }) + expect(JSON.parse(decodeBase64url(jwe.protected))).toEqual({ + enc: 'A256CBC-HS512', + more: 'protected', + skid, + }) expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) expect(await decryptJWE(jwe, recipients[0].decrypter)).toEqual(cleartext) }) diff --git a/packages/did-comm/src/__tests__/packing.test.ts b/packages/did-comm/src/__tests__/packing.test.ts index 759455052..5408f19ca 100644 --- a/packages/did-comm/src/__tests__/packing.test.ts +++ b/packages/did-comm/src/__tests__/packing.test.ts @@ -1,204 +1,183 @@ -import { DIDComm } from "../didcomm.js" -import { - IDIDManager, - IIdentifier, - IKeyManager, - IResolver, - TAgent, -} from '../../../core-types/src' -import { - createAgent -} from '../../../core/src' +import { DIDComm } from '../didcomm.js' +import { IDIDManager, IIdentifier, IKeyManager, IResolver, TAgent } from '../../../core-types/src' +import { createAgent } from '../../../core/src' import { DIDManager, MemoryDIDStore } from '../../../did-manager/src' import { KeyManager, MemoryKeyStore, MemoryPrivateKeyStore } from '../../../key-manager/src' import { KeyManagementSystem } from '../../../kms-local/src' import { getDidKeyResolver, KeyDIDProvider } from '../../../did-provider-key/src' import { DIDResolverPlugin } from '../../../did-resolver/src' -import { DIDDocument, Resolver } from 'did-resolver' +import { type DIDDocument, Resolver } from 'did-resolver' +import { type IDIDComm } from '../types/IDIDComm.js' +import { base64ToBytes, bytesToUtf8String } from '@veramo/utils' const multiBaseDoc = { - "@context": [ - "https://www.w3.org/ns/did/v1", - "https://w3id.org/security/suites/jws-2020/v1" - ], - "controller": "did:web:portcullis.1keep.com", - "id": "did:web:portcullis.1keep.com", - "keyAgreement": [ - "did:web:portcullis.1keep.com#1" - ], - "service": [ + '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/jws-2020/v1'], + controller: 'did:web:portcullis.1keep.com', + id: 'did:web:portcullis.1keep.com', + keyAgreement: ['did:web:portcullis.1keep.com#1'], + service: [ { - "accept": [ - "didcomm/v2" - ], - "id": "#didcomm", - "routingKeys": [], - "serviceEndpoint": "https://portcullis.1keep.com/didcomm", - "type": "DIDCommMessaging" - } + accept: ['didcomm/v2'], + id: '#didcomm', + routingKeys: [], + serviceEndpoint: 'https://portcullis.1keep.com/didcomm', + type: 'DIDCommMessaging', + }, ], - "verificationMethod": [ + verificationMethod: [ { - "controller": "did:web:portcullis.1keep.com", - "id": "did:web:portcullis.1keep.com#0", - "publicKeyMultibase": "z8FRmkyRH9xAsLCk51yXN2Qy6uq4eN4iAesa3v3Hv889v", - "type": "Ed25519VerificationKey2020" + controller: 'did:web:portcullis.1keep.com', + id: 'did:web:portcullis.1keep.com#0', + publicKeyMultibase: 'z8FRmkyRH9xAsLCk51yXN2Qy6uq4eN4iAesa3v3Hv889v', + type: 'Ed25519VerificationKey2020', }, { - "controller": "did:web:portcullis.1keep.com", - "id": "did:web:portcullis.1keep.com#1", - "publicKeyMultibase": "z6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud", - "type": "X25519KeyAgreementKey2020" - } - ] + controller: 'did:web:portcullis.1keep.com', + id: 'did:web:portcullis.1keep.com#1', + publicKeyMultibase: 'z6LSpSrLxbAhg2SHwKk7kwpsH7DM7QjFS5iK6qP87eViohud', + type: 'X25519KeyAgreementKey2020', + }, + ], } const base58Doc = { - "@context": [ - "https://www.w3.org/ns/did/v1", - "https://w3id.org/security/suites/jws-2020/v1" - ], - "authentication": [ - "did:web:verifiable.ink#0" - ], - "controller": "did:web:verifiable.ink", - "id": "did:web:verifiable.ink", - "keyAgreement": [ - "did:web:verifiable.ink#1" - ], - "service": [ + '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/jws-2020/v1'], + authentication: ['did:web:verifiable.ink#0'], + controller: 'did:web:verifiable.ink', + id: 'did:web:verifiable.ink', + keyAgreement: ['did:web:verifiable.ink#1'], + service: [ { - "accept": [ - "didcomm/v2" - ], - "id": "did:web:verifiable.ink#didcomm", - "routingKeys": [], - "serviceEndpoint": "https://verifiable.ink/didcomm", - "type": "DIDCommMessaging" - } + accept: ['didcomm/v2'], + id: 'did:web:verifiable.ink#didcomm', + routingKeys: [], + serviceEndpoint: 'https://verifiable.ink/didcomm', + type: 'DIDCommMessaging', + }, ], - "verificationMethod": [ + verificationMethod: [ { - "controller": "did:web:verifiable.ink", - "id": "did:web:verifiable.ink#0", - "publicKeyBase58": "JDTRH3N5xMFxRnDzn4NdZc1NPUm9w9Y4ZSehnscCKqBw", - "type": "Ed25519VerificationKey2018" + controller: 'did:web:verifiable.ink', + id: 'did:web:verifiable.ink#0', + publicKeyBase58: 'JDTRH3N5xMFxRnDzn4NdZc1NPUm9w9Y4ZSehnscCKqBw', + type: 'Ed25519VerificationKey2018', }, { - "controller": "did:web:verifiable.ink", - "id": "did:web:verifiable.ink#1", - "publicKeyBase58": "Djiwiqccx8kupbtbkMYioj3F4eL9GUcsPJ9LUmNJFN7n", - "type": "X25519KeyAgreementKey2019" - } - ] + controller: 'did:web:verifiable.ink', + id: 'did:web:verifiable.ink#1', + publicKeyBase58: 'Djiwiqccx8kupbtbkMYioj3F4eL9GUcsPJ9LUmNJFN7n', + type: 'X25519KeyAgreementKey2019', + }, + ], } const hexDoc = { - "@context": "https://www.w3.org/ns/did/v1", - "id": "did:web:iiw-demo.herokuapp.com", - "verificationMethod": [ + '@context': 'https://www.w3.org/ns/did/v1', + id: 'did:web:iiw-demo.herokuapp.com', + verificationMethod: [ { - "id": "did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e", - "type": "Ed25519VerificationKey2018", - "controller": "did:web:iiw-demo.herokuapp.com", - "publicKeyHex": "6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e" + id: 'did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e', + type: 'Ed25519VerificationKey2018', + controller: 'did:web:iiw-demo.herokuapp.com', + publicKeyHex: '6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e', }, { - "id": "did:web:iiw-demo.herokuapp.com#6e5db42d8d42bca9eee16fef45d41cd3cfaa52fa726ade05055f7d09dcfbf669", - "type": "X25519KeyAgreementKey2019", - "controller": "did:web:iiw-demo.herokuapp.com", - "publicKeyHex": "6e5db42d8d42bca9eee16fef45d41cd3cfaa52fa726ade05055f7d09dcfbf669" - } + id: 'did:web:iiw-demo.herokuapp.com#6e5db42d8d42bca9eee16fef45d41cd3cfaa52fa726ade05055f7d09dcfbf669', + type: 'X25519KeyAgreementKey2019', + controller: 'did:web:iiw-demo.herokuapp.com', + publicKeyHex: '6e5db42d8d42bca9eee16fef45d41cd3cfaa52fa726ade05055f7d09dcfbf669', + }, ], - "authentication": [ - "did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e" + authentication: [ + 'did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e', ], - "assertionMethod": [ - "did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e" + assertionMethod: [ + 'did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e', ], - "keyAgreement": [ - "did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e", - "did:web:iiw-demo.herokuapp.com#6e5db42d8d42bca9eee16fef45d41cd3cfaa52fa726ade05055f7d09dcfbf669" + keyAgreement: [ + 'did:web:iiw-demo.herokuapp.com#6eb094077b42b299c8ab5e1981e3dba7e9e331c26acdde4c6bd434dcb4bf856e', + 'did:web:iiw-demo.herokuapp.com#6e5db42d8d42bca9eee16fef45d41cd3cfaa52fa726ade05055f7d09dcfbf669', ], - "service": [ + service: [ { - "id": "did:web:iiw-demo.herokuapp.com#msg", - "type": "Messaging", - "serviceEndpoint": "https://iiw-demo.herokuapp.com/messaging", - "description": "Handles incoming POST messages" + id: 'did:web:iiw-demo.herokuapp.com#msg', + type: 'Messaging', + serviceEndpoint: 'https://iiw-demo.herokuapp.com/messaging', + description: 'Handles incoming POST messages', }, { - "id": "did:web:iiw-demo.herokuapp.com#msg-didcomm", - "type": "DIDCommMessaging", - "serviceEndpoint": "https://iiw-demo.herokuapp.com/messaging", - "description": "Handles incoming DIDComm messages" - } - ] + id: 'did:web:iiw-demo.herokuapp.com#msg-didcomm', + type: 'DIDCommMessaging', + serviceEndpoint: 'https://iiw-demo.herokuapp.com/messaging', + description: 'Handles incoming DIDComm messages', + }, + ], } // https://github.com/aviarytech/didcomm/blob/master/tests/fixtures/didDocs/alice.json const jwkDocX = { - "@context": ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/jws-2020/v1"], - "id": "did:example:alice", - "verificationMethod": [ - { - "id": "did:example:alice#key-0", - "controller": "did:example:alice", - "type": "JsonWebKey2020", - "publicKeyJwk": { - "kty": "OKP", - "crv": "X25519", - "x": "tsc9iYfy4hv2Mz5Q-ztGjKXeXzWUDWl5DLpfepJg4Wc" - } - } - ], - "authentication": ["did:example:alice#key-0"], - "assertionMethod": ["did:example:alice#key-0"], - "keyAgreement": ["did:example:alice#key-0"], - "service": [ - { - "id": "did:example:alice#didcomm", - "type": "DIDCommMessaging", - "serviceEndpoint": "http://example.com/didcomm", - "routingKeys": [] - } - ] + '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/jws-2020/v1'], + id: 'did:example:alice', + verificationMethod: [ + { + id: 'did:example:alice#key-0', + controller: 'did:example:alice', + type: 'JsonWebKey2020', + publicKeyJwk: { + kty: 'OKP', + crv: 'X25519', + x: 'tsc9iYfy4hv2Mz5Q-ztGjKXeXzWUDWl5DLpfepJg4Wc', + }, + }, + ], + authentication: ['did:example:alice#key-0'], + assertionMethod: ['did:example:alice#key-0'], + keyAgreement: ['did:example:alice#key-0'], + service: [ + { + id: 'did:example:alice#didcomm', + type: 'DIDCommMessaging', + serviceEndpoint: 'http://example.com/didcomm', + routingKeys: [], + }, + ], } const jwkDocEd = { - "@context": ["https://www.w3.org/ns/did/v1", "https://w3id.org/security/suites/jws-2020/v1"], - "id": "did:example:alice", - "verificationMethod": [ - { - "id": "did:example:alice#key-0", - "controller": "did:example:alice", - "type": "JsonWebKey2020", - "publicKeyJwk": { - "kty": "OKP", - "crv": "Ed25519", - "x": "CV-aGlld3nVdgnhoZK0D36Wk-9aIMlZjZOK2XhPMnkQ" - } - } - ], - "authentication": ["did:example:alice#key-0"], - "assertionMethod": ["did:example:alice#key-0"], - "keyAgreement": ["did:example:alice#key-0"], - "service": [ - { - "id": "did:example:alice#didcomm", - "type": "DIDCommMessaging", - "serviceEndpoint": "http://example.com/didcomm", - "routingKeys": [] - } - ] + '@context': ['https://www.w3.org/ns/did/v1', 'https://w3id.org/security/suites/jws-2020/v1'], + id: 'did:example:alice', + verificationMethod: [ + { + id: 'did:example:alice#key-0', + controller: 'did:example:alice', + type: 'JsonWebKey2020', + publicKeyJwk: { + kty: 'OKP', + crv: 'Ed25519', + x: 'CV-aGlld3nVdgnhoZK0D36Wk-9aIMlZjZOK2XhPMnkQ', + }, + }, + ], + authentication: ['did:example:alice#key-0'], + assertionMethod: ['did:example:alice#key-0'], + keyAgreement: ['did:example:alice#key-0'], + service: [ + { + id: 'did:example:alice#didcomm', + type: 'DIDCommMessaging', + serviceEndpoint: 'http://example.com/didcomm', + routingKeys: [], + }, + ], } describe('didComm', () => { - let didKeyIdentifier: IIdentifier - let agent: TAgent + let senderDID: IIdentifier + let recipientDID: IIdentifier + let agent: TAgent beforeAll(async () => { - agent = createAgent({ + agent = createAgent({ plugins: [ new KeyManager({ store: new MemoryKeyStore(), @@ -216,94 +195,202 @@ describe('didComm', () => { new DIDResolverPlugin({ resolver: new Resolver({ ...getDidKeyResolver(), - 'fake': async (did: string) => { + fake: async (did: string) => { let doc: DIDDocument - if (did === "did:fake:base58") { + if (did === 'did:fake:base58') { doc = base58Doc - } else if (did === "did:fake:multibase") { + } else if (did === 'did:fake:multibase') { doc = multiBaseDoc - } else if (did === "did:fake:hex") { + } else if (did === 'did:fake:hex') { doc = hexDoc - } else if (did === "did:fake:jwkx") { + } else if (did === 'did:fake:jwkx') { doc = jwkDocX - } else if (did === "did:fake:jwked") { + } else if (did === 'did:fake:jwked') { doc = jwkDocEd } else { - throw new Error("Bad didUrl for fake resolver: " + did) + throw new Error('Bad didUrl for fake resolver: ' + did) } // DIDResolutionResult return { didResolutionMetadata: {}, didDocument: doc, - didDocumentMetadata: {} + didDocumentMetadata: {}, } - } - }) + }, + }), }), - new DIDComm() + new DIDComm(), ], }) - didKeyIdentifier = await agent.didManagerCreate() + senderDID = await agent.didManagerGetOrCreate({ + provider: 'did:key', + alias: 'did-comm packing sender DID', + }) + recipientDID = await agent.didManagerGetOrCreate({ + provider: 'did:key', + alias: 'did-comm packing receiver DID', + }) }) - const testMessage = (receiverDID: string) => { + const createTestMessage = (receiverDID: string) => { return { type: 'test', - from: didKeyIdentifier.did, + from: senderDID.did, to: receiverDID, id: 'test', body: { hello: 'world' }, } } - it('should pack message for public key as base58', async () => { - const packedMessage = await agent.packDIDCommMessage({ - message: testMessage("did:fake:base58"), - packing: 'authcrypt' + describe('recipient key formats', () => { + it('should pack message for public key as base58', async () => { + const packedMessage = await agent.packDIDCommMessage({ + message: createTestMessage('did:fake:base58'), + packing: 'authcrypt', + }) + expect(packedMessage).toBeDefined() }) - expect(packedMessage).toBeDefined() - }) - it.todo('should unpack message packed for base58') + it.todo('should unpack message packed for base58') - it('should pack message for public key as multibase', async () => { - const packedMessage = await agent.packDIDCommMessage({ - message: testMessage("did:fake:multibase"), - packing: 'authcrypt' + it('should pack message for public key as multibase', async () => { + const packedMessage = await agent.packDIDCommMessage({ + message: createTestMessage('did:fake:multibase'), + packing: 'authcrypt', + }) + expect(packedMessage).toBeDefined() }) - expect(packedMessage).toBeDefined() - }) - it.todo('should unpack message packed for multibase') + it.todo('should unpack message packed for multibase') - it('should pack message for public key as hex', async () => { - const packedMessage = await agent.packDIDCommMessage({ - message: testMessage("did:fake:hex"), - packing: 'authcrypt' + it('should pack message for public key as hex', async () => { + const packedMessage = await agent.packDIDCommMessage({ + message: createTestMessage('did:fake:hex'), + packing: 'authcrypt', + }) + expect(packedMessage).toBeDefined() }) - expect(packedMessage).toBeDefined() - }) - it.todo('should unpack message packed for hex') + it.todo('should unpack message packed for hex') - it('should pack message for public key as jwk with X25519 crv', async () => { - const packedMessage = await agent.packDIDCommMessage({ - message: testMessage("did:fake:jwkx"), - packing: 'authcrypt' + it('should pack message for public key as jwk with X25519 crv', async () => { + const packedMessage = await agent.packDIDCommMessage({ + message: createTestMessage('did:fake:jwkx'), + packing: 'authcrypt', + }) + expect(packedMessage).toBeDefined() }) - expect(packedMessage).toBeDefined() - }) - it.todo('should unpack message packed for jwk with X25519 crv') + it.todo('should unpack message packed for jwk with X25519 crv') - it('should pack message for public key as jwk with Ed25519 crv', async () => { - const packedMessage = await agent.packDIDCommMessage({ - message: testMessage("did:fake:jwked"), - packing: 'authcrypt' + it('should pack message for public key as jwk with Ed25519 crv', async () => { + const packedMessage = await agent.packDIDCommMessage({ + message: createTestMessage('did:fake:jwked'), + packing: 'authcrypt', + }) + expect(packedMessage).toBeDefined() }) - expect(packedMessage).toBeDefined() + + it.todo('should unpack message packed for jwk with Ed25519 crv') }) - it.todo('should unpack message packed for jwk with Ed25519 crv') + describe('packing and algorithms', () => { + describe('anoncrypt packing', () => { + const packing = 'anoncrypt' + it(`should pack and unpack using ${packing}`, async () => { + const message = createTestMessage(recipientDID.did) + const packedMessage = await agent.packDIDCommMessage({ + message, + packing: packing as any, + }) + const unpackedMessage = await agent.unpackDIDCommMessage(packedMessage) + expect(unpackedMessage.message).toEqual(message) + }) + + describe.each(['XC20P', 'A256GCM', 'A256CBC-HS512'])(`%s enc`, (enc) => { + it(`should pack and unpack using ${packing} packing and ${enc} enc`, async () => { + const message = createTestMessage(recipientDID.did) + const packedMessage = await agent.packDIDCommMessage({ + message, + packing: packing as any, + options: { + enc: enc as any, + }, + }) + const unpackedMessage = await agent.unpackDIDCommMessage(packedMessage) + expect(unpackedMessage.message).toEqual(message) + }) + + it.each(['ECDH-ES+A256KW', 'ECDH-ES+XC20PKW'])( + `should pack and unpack using ${packing} packing and ${enc} enc and %s alg`, + async (alg) => { + const message = createTestMessage(recipientDID.did) + const packedMessage = await agent.packDIDCommMessage({ + message, + packing: packing as any, + options: { + enc: enc as any, + alg: alg as any, + }, + }) + const protectedHeader = JSON.parse( + bytesToUtf8String(base64ToBytes(JSON.parse(packedMessage.message).protected)), + ) + expect(protectedHeader.alg).toEqual(alg) + expect(protectedHeader.enc).toEqual(enc) + const unpackedMessage = await agent.unpackDIDCommMessage(packedMessage) + expect(unpackedMessage.metaData.packing).toEqual(packing) + expect(unpackedMessage.message).toEqual(message) + }, + ) + }) + }) + + describe('authcrypt packing', () => { + const packing = 'authcrypt' + it(`should pack and unpack using ${packing}`, async () => { + const message = createTestMessage(recipientDID.did) + const packedMessage = await agent.packDIDCommMessage({ + message, + packing: packing as any, + }) + const unpackedMessage = await agent.unpackDIDCommMessage(packedMessage) + expect(unpackedMessage.message).toEqual(message) + }) + + describe.each(['XC20P', 'A256GCM', 'A256CBC-HS512'])(`%s enc`, (enc) => { + it(`should pack and unpack using ${packing} packing and ${enc} enc`, async () => { + const message = createTestMessage(recipientDID.did) + const packedMessage = await agent.packDIDCommMessage({ + message, + packing: packing as any, + options: { + enc: enc as any, + }, + }) + const unpackedMessage = await agent.unpackDIDCommMessage(packedMessage) + expect(unpackedMessage.message).toEqual(message) + }) + + it.each(['ECDH-1PU+A256KW', 'ECDH-1PU+XC20PKW'])( + `should pack and unpack using ${packing} packing and ${enc} enc and %s alg`, + async (alg) => { + const message = createTestMessage(recipientDID.did) + const packedMessage = await agent.packDIDCommMessage({ + message, + packing: packing as any, + options: { + enc: enc as any, + alg: alg as any, + }, + }) + const unpackedMessage = await agent.unpackDIDCommMessage(packedMessage) + expect(unpackedMessage.metaData.packing).toEqual(packing) + expect(unpackedMessage.message).toEqual(message) + }, + ) + }) + }) + }) }) diff --git a/packages/did-comm/src/didcomm.ts b/packages/did-comm/src/didcomm.ts index 4a7a1d36f..8e753599c 100644 --- a/packages/did-comm/src/didcomm.ts +++ b/packages/did-comm/src/didcomm.ts @@ -8,21 +8,13 @@ import { IMessageHandler, IResolver, } from '@veramo/core-types' -import { - createJWE, - Decrypter, - decryptJWE, - ECDH, - Encrypter, - JWE, - verifyJWS, - x25519Decrypter, - x25519Encrypter, - xc20pAuthDecrypterEcdh1PuV3x25519WithXc20PkwV2, - xc20pAuthEncrypterEcdh1PuV3x25519WithXc20PkwV2, -} from 'did-jwt' +import { createJWE, Decrypter, decryptJWE, ECDH, Encrypter, JWE, verifyJWS } from 'did-jwt' import { DIDDocument, parse as parseDidUrl, Service, VerificationMethod } from 'did-resolver' import { + a256cbcHs512AnonDecrypterX25519WithA256KW, + a256cbcHs512AnonEncrypterX25519WithA256KW, + a256cbcHs512AuthDecrypterX25519WithA256KW, + a256cbcHs512AuthEncrypterX25519WithA256KW, a256gcmAnonDecrypterX25519WithA256KW, a256gcmAnonEncrypterX25519WithA256KW, a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW, @@ -31,7 +23,22 @@ import { xc20pAnonEncrypterX25519WithA256KW, xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW, xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW, -} from './encryption/aesEncryption.js' +} from './encryption/a256kw-encrypters.js' + +import { + a256cbcHs512AnonDecrypterX25519WithXC20PKW, + a256cbcHs512AnonEncrypterX25519WithXC20PKW, + a256cbcHs512AuthDecrypterX25519WithXC20PKW, + a256cbcHs512AuthEncrypterX25519WithXC20PKW, + a256gcmAnonDecrypterX25519WithXC20PKW, + a256gcmAnonEncrypterX25519WithXC20PKW, + a256gcmAuthDecrypterEcdh1PuV3x25519WithXC20PKW, + a256gcmAuthEncrypterEcdh1PuV3x25519WithXC20PKW, + xc20pAnonDecrypterX25519WithXC20PKW, + xc20pAnonEncrypterX25519WithXC20PKW, + xc20pAuthDecrypterEcdh1PuV3x25519WithXC20PKW, + xc20pAuthEncrypterEcdh1PuV3x25519WithXC20PKW, +} from './encryption/xc20pkw-encrypters.js' import schema from './plugin.schema.json' assert { type: 'json' } @@ -295,7 +302,7 @@ export class DIDComm implements IAgentPlugin { const defaults = { alg: args.packing === 'authcrypt' ? 'ECDH-1PU+A256KW' : 'ECDH-ES+A256KW', - enc: 'A256GCM', // 'XC20P' can also be specified; FIXME: 'A256CBC-HS512' is not yet supported + enc: 'A256GCM', // 'XC20P' or 'A256CBC-HS512' can also be specified } const options = { ...defaults, ...args.options } @@ -346,18 +353,58 @@ export class DIDComm implements IAgentPlugin { const encrypters: Encrypter[] = recipients .map((recipient) => { if (options.enc === 'A256GCM') { - if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { - // FIXME: the didcomm spec actually links to ECDH-1PU(v4) - return a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { - kid: recipient.kid, - }) - } else { - return a256gcmAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) + if (args.packing === 'authcrypt' && (!options.alg || options.alg?.startsWith('ECDH-1PU'))) { + if (options.alg?.endsWith('+XC20PKW')) { + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return a256gcmAuthEncrypterEcdh1PuV3x25519WithXC20PKW( + recipient.publicKeyBytes, + senderECDH, + { + kid: recipient.kid, + }, + ) + } else if (options?.alg?.endsWith('+A256KW')) { + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipient.publicKeyBytes, + senderECDH, + { + kid: recipient.kid, + }, + ) + } + } else if (args.packing === 'anoncrypt' && (!options.alg || options.alg?.startsWith('ECDH-ES'))) { + if (options.alg?.endsWith('+XC20PKW')) { + return a256gcmAnonEncrypterX25519WithXC20PKW(recipient.publicKeyBytes, recipient.kid) + } else if (options?.alg?.endsWith('+A256KW')) { + return a256gcmAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) + } + } + } else if (options.enc === 'A256CBC-HS512') { + if (args.packing === 'authcrypt' && (!options.alg || options.alg?.startsWith('ECDH-1PU'))) { + if (options.alg?.endsWith('+XC20PKW')) { + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return a256cbcHs512AuthEncrypterX25519WithXC20PKW(recipient.publicKeyBytes, senderECDH, { + kid: recipient.kid, + }) + } else if (options?.alg?.endsWith('+A256KW')) { + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return a256cbcHs512AuthEncrypterX25519WithA256KW(recipient.publicKeyBytes, senderECDH, { + kid: recipient.kid, + }) + } + } else if (args.packing === 'anoncrypt' && (!options.alg || options.alg?.startsWith('ECDH-ES'))) { + if (options.alg?.endsWith('+XC20PKW')) { + return a256cbcHs512AnonEncrypterX25519WithXC20PKW(recipient.publicKeyBytes, recipient.kid) + } else if (options?.alg?.endsWith('+A256KW')) { + return a256cbcHs512AnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) + } } } else if (options.enc === 'XC20P') { - if (args.packing === 'authcrypt' || options.alg?.startsWith('ECDH-1PU')) { + if (args.packing === 'authcrypt' && (!options.alg || options.alg?.startsWith('ECDH-1PU'))) { if (options.alg?.endsWith('+XC20PKW')) { - return xc20pAuthEncrypterEcdh1PuV3x25519WithXc20PkwV2( + // FIXME: the didcomm spec actually links to ECDH-1PU(v4) + return xc20pAuthEncrypterEcdh1PuV3x25519WithXC20PKW( recipient.publicKeyBytes, senderECDH, { kid: recipient.kid }, @@ -366,31 +413,25 @@ export class DIDComm implements IAgentPlugin { return xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW(recipient.publicKeyBytes, senderECDH, { kid: recipient.kid, }) - } else { - debug( - `not_supported: could not create suitable authcrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`, - ) - return null } - } else { + } else if (args.packing === 'anoncrypt' && (!options.alg || options.alg?.startsWith('ECDH-ES'))) { if (options.alg?.endsWith('+XC20PKW')) { - return x25519Encrypter(recipient.publicKeyBytes, recipient.kid) + return xc20pAnonEncrypterX25519WithXC20PKW(recipient.publicKeyBytes, recipient.kid) } else if (options?.alg?.endsWith('+A256KW')) { return xc20pAnonEncrypterX25519WithA256KW(recipient.publicKeyBytes, recipient.kid) - } else { - debug( - `not_supported: could not create suitable anoncrypt encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`, - ) - return null } } } + debug( + `not_supported: could not create suitable ${args.packing} encrypter for recipient ${recipient.kid} with alg=${options.alg}, enc=${options.enc}`, + ) + return null }) .filter(isDefined) if (encrypters.length === 0) { throw new Error( - `not_supported: could not create suitable encryption for recipient ${args?.message?.to}`, + `not_supported: could not create suitable ${args.packing} encrypter for recipient ${args?.message?.to} with alg=${options.alg}, enc=${options.enc}`, ) } @@ -503,12 +544,36 @@ export class DIDComm implements IAgentPlugin { // TODO: here's where more algorithms should be supported if (localKey.recipient?.header?.epk?.crv === 'X25519') { if (localKey.recipient?.header?.enc === 'A256GCM') { - if (senderKeyBytes && localKey.recipient?.header?.alg === 'ECDH-1PU+A256KW') { + if (senderKeyBytes && localKey.recipient?.header?.alg?.includes('ECDH-1PU')) { packing = 'authcrypt' - decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) + } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { + decrypter = a256gcmAuthDecrypterEcdh1PuV3x25519WithXC20PKW(recipientECDH, senderKeyBytes) + } } else { packing = 'anoncrypt' - decrypter = a256gcmAnonDecrypterX25519WithA256KW(recipientECDH) + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = a256gcmAnonDecrypterX25519WithA256KW(recipientECDH) + } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { + decrypter = a256gcmAnonDecrypterX25519WithXC20PKW(recipientECDH) + } + } + } else if (localKey.recipient?.header?.enc === 'A256CBC-HS512') { + if (senderKeyBytes && localKey.recipient?.header?.alg?.includes('ECDH-1PU')) { + packing = 'authcrypt' + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = a256cbcHs512AuthDecrypterX25519WithA256KW(recipientECDH, senderKeyBytes) + } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { + decrypter = a256cbcHs512AuthDecrypterX25519WithXC20PKW(recipientECDH, senderKeyBytes) + } + } else { + packing = 'anoncrypt' + if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { + decrypter = a256cbcHs512AnonDecrypterX25519WithA256KW(recipientECDH) + } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { + decrypter = a256cbcHs512AnonDecrypterX25519WithXC20PKW(recipientECDH) + } } } else if (localKey.recipient?.header?.enc === 'XC20P') { if (senderKeyBytes && localKey.recipient?.header?.alg?.includes('ECDH-1PU')) { @@ -516,14 +581,14 @@ export class DIDComm implements IAgentPlugin { if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW(recipientECDH, senderKeyBytes) } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { - decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithXc20PkwV2(recipientECDH, senderKeyBytes) + decrypter = xc20pAuthDecrypterEcdh1PuV3x25519WithXC20PKW(recipientECDH, senderKeyBytes) } } else { packing = 'anoncrypt' if (localKey.recipient?.header?.alg?.endsWith('+A256KW')) { decrypter = xc20pAnonDecrypterX25519WithA256KW(recipientECDH) } else if (localKey.recipient?.header?.alg?.endsWith('+XC20PKW')) { - decrypter = x25519Decrypter(recipientECDH) + decrypter = xc20pAnonDecrypterX25519WithXC20PKW(recipientECDH) } } } diff --git a/packages/did-comm/src/encryption/a256cbc-hs512-dir.ts b/packages/did-comm/src/encryption/a256cbc-hs512-dir.ts new file mode 100644 index 000000000..6cba20bf2 --- /dev/null +++ b/packages/did-comm/src/encryption/a256cbc-hs512-dir.ts @@ -0,0 +1,175 @@ +import crypto from 'isomorphic-webcrypto' +import { randomBytes } from '@noble/hashes/utils' +import { base64ToBytes, bytesToBase64url, concat, encodeBase64url } from '@veramo/utils' +import { Decrypter, Encrypter, EncryptionResult, ProtectedHeader } from 'did-jwt' +import { fromString } from 'uint8arrays/from-string' + +const MAX_INT32 = 2 ** 32 + +function writeUInt32BE(buf: Uint8Array, value: number, offset?: number) { + if (value < 0 || value >= MAX_INT32) { + throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${value}`) + } + buf.set([value >>> 24, value >>> 16, value >>> 8, value & 0xff], offset) +} + +function uint64be(value: number) { + const high = Math.floor(value / MAX_INT32) + const low = value % MAX_INT32 + const buf = new Uint8Array(8) + writeUInt32BE(buf, high, 0) + writeUInt32BE(buf, low, 4) + return buf +} + +/** + * Code copied and adapted from https://github.com/panva/jose + * @param enc - the JWE content encryption algorithm (e.g. A256CBC-HS512) + * @param plaintext - the content to encrypt + * @param cek - the raw content encryption key + * @param providedIV - optional provided Initialization Vector + * @param aad - optional additional authenticated data + */ +async function cbcEncrypt( + enc: string = 'A256CBC-HS512', + plaintext: Uint8Array, + cek: Uint8Array, + providedIV?: Uint8Array, + aad: Uint8Array = new Uint8Array(0), +) { + // A256CBC-HS512 CEK size should be 512 bits; first 256 bits are used for HMAC with SHA-512 and the rest for AES-CBC + const keySize = parseInt(enc.slice(1, 4), 10) + const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, [ + 'encrypt', + ]) + const macKey = await crypto.subtle.importKey( + 'raw', + cek.subarray(0, keySize >> 3), + { + hash: `SHA-${keySize << 1}`, + name: 'HMAC', + }, + false, + ['sign'], + ) + + if (providedIV && providedIV.length !== keySize >> 4) { + throw new Error(`illegal_argument: Invalid IV size, expected ${keySize >> 4}, got ${providedIV.length}`) + } + const iv = providedIV ?? randomBytes(keySize >> 4) + + const ciphertext = new Uint8Array( + await crypto.subtle.encrypt( + { + iv, + name: 'AES-CBC', + }, + encKey, + plaintext, + ), + ) + + const macData = concat([aad, iv, ciphertext, uint64be(aad.length << 3)]) + const tag = new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3)) + + return { enc: 'dir', ciphertext, tag, iv } +} + +export function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean { + if (a.length !== b.length) { + return false + } + let result = 0 + let len = a.length + for (let i = 0; i < len; i++) { + result |= a[i] ^ b[i] + } + return result === 0 +} + +async function cbcDecrypt( + enc: string = 'A256CBC-HS512', + cek: Uint8Array, + ciphertext: Uint8Array, + iv: Uint8Array, + tag: Uint8Array, + aad: Uint8Array, +) { + const keySize = parseInt(enc.slice(1, 4), 10) + const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, [ + 'decrypt', + ]) + const macKey = await crypto.subtle.importKey( + 'raw', + cek.subarray(0, keySize >> 3), + { + hash: `SHA-${keySize << 1}`, + name: 'HMAC', + }, + false, + ['sign'], + ) + + const macData = concat([aad, iv, ciphertext, uint64be(aad.length << 3)]) + const expectedTag = new Uint8Array( + (await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3), + ) + + let macCheckPassed!: boolean + try { + macCheckPassed = timingSafeEqual(tag, expectedTag) + } catch { + // + } + if (!macCheckPassed) { + // current JWE decryption pipeline tries to decrypt multiple times with different keys, so return null instead of + // throwing an error + return null + // throw new Error('jwe_decryption_failed: MAC check failed') + } + + let plaintext: Uint8Array | null = null + try { + plaintext = new Uint8Array(await crypto.subtle.decrypt({ iv, name: 'AES-CBC' }, encKey, ciphertext)) + } catch (e: any) { + // current JWE decryption pipeline tries to decrypt multiple times with different keys, so return null instead of + // throwing an error + } + + return plaintext +} + +export function a256cbcHs512DirDecrypter(key: Uint8Array): Decrypter { + // const cipher = new GCM(new AES(key)) + + async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise { + // did-jwt#decryptJWE combines the ciphertext and the tag into a single `sealed` array + const TAG_LENGTH = 32 + const ciphertext = sealed.subarray(0, sealed.length - TAG_LENGTH) + const tag = sealed.subarray(sealed.length - TAG_LENGTH) + return cbcDecrypt('A256CBC-HS512', key, ciphertext, iv, tag, aad ?? new Uint8Array(0)) + } + + return { alg: 'dir', enc: 'A256GCM', decrypt } +} + +export function a256cbcHs512DirEncrypter(cek: Uint8Array): Encrypter { + const enc = 'A256CBC-HS512' + const alg = 'dir' + + async function encrypt( + cleartext: Uint8Array, + protectedHeader: ProtectedHeader = {}, + aad?: Uint8Array, + ): Promise { + const protHeader = encodeBase64url(JSON.stringify(Object.assign({ alg }, protectedHeader, { enc }))) + const encodedAad = fromString(aad ? `${protHeader}.${bytesToBase64url(aad)}` : protHeader, 'utf-8') + const iv: Uint8Array | undefined = protectedHeader.iv ? base64ToBytes(protectedHeader.iv) : undefined + return { + ...(await cbcEncrypt('A256CBC-HS512', cleartext, cek, iv, encodedAad)), + protectedHeader: protHeader, + } + } + + return { alg, enc, encrypt } +} diff --git a/packages/did-comm/src/encryption/a256gcm-dir.ts b/packages/did-comm/src/encryption/a256gcm-dir.ts new file mode 100644 index 000000000..93cc1a21c --- /dev/null +++ b/packages/did-comm/src/encryption/a256gcm-dir.ts @@ -0,0 +1,52 @@ +import type { Decrypter, Encrypter, EncryptionResult, ProtectedHeader } from 'did-jwt' +import { AES } from '@stablelib/aes' +import { GCM } from '@stablelib/gcm' +import { randomBytes } from '@noble/hashes/utils' +import { bytesToBase64url, encodeBase64url } from '@veramo/utils' +import { fromString } from 'uint8arrays/from-string' + +function createA256GCMEncrypter( + key: Uint8Array, +): (cleartext: Uint8Array, aad?: Uint8Array) => EncryptionResult { + const blockcipher = new AES(key) + const cipher = new GCM(blockcipher) + return (cleartext: Uint8Array, aad?: Uint8Array) => { + const iv = randomBytes(cipher.nonceLength) + const sealed = cipher.seal(iv, cleartext, aad) + return { + ciphertext: sealed.subarray(0, sealed.length - cipher.tagLength), + tag: sealed.subarray(sealed.length - cipher.tagLength), + iv, + } + } +} + +export function a256gcmDirEncrypter(key: Uint8Array): Encrypter { + const enc = 'A256GCM' + const alg = 'dir' + + async function encrypt( + cleartext: Uint8Array, + protectedHeader: ProtectedHeader = {}, + aad?: Uint8Array, + ): Promise { + const protHeader = encodeBase64url(JSON.stringify(Object.assign({ alg }, protectedHeader, { enc }))) + const encodedAad = fromString(aad ? `${protHeader}.${bytesToBase64url(aad)}` : protHeader, 'utf-8') + return { + ...createA256GCMEncrypter(key)(cleartext, encodedAad), + protectedHeader: protHeader, + } + } + + return { alg, enc, encrypt } +} + +export function a256gcmDirDecrypter(key: Uint8Array): Decrypter { + const cipher = new GCM(new AES(key)) + + async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise { + return cipher.open(iv, sealed, aad) + } + + return { alg: 'dir', enc: 'A256GCM', decrypt } +} diff --git a/packages/did-comm/src/encryption/a256kw-encrypters.ts b/packages/did-comm/src/encryption/a256kw-encrypters.ts new file mode 100644 index 000000000..a12436e1c --- /dev/null +++ b/packages/did-comm/src/encryption/a256kw-encrypters.ts @@ -0,0 +1,270 @@ +import type { AuthEncryptParams, Decrypter, ECDH, Encrypter, Recipient } from 'did-jwt' +import { + computeX25519Ecdh1PUv3Kek, + computeX25519EcdhEsKek, + createX25519Ecdh1PUv3Kek, + createX25519EcdhEsKek, + xc20pDirDecrypter, + xc20pDirEncrypter, +} from 'did-jwt' +import { base64ToBytes } from '@veramo/utils' +import { createFullEncrypter } from './createEncrypter.js' +import { a256KeyUnwrapper, a256KeyWrapper } from './a256kw.js' +import { a256gcmDirDecrypter, a256gcmDirEncrypter } from './a256gcm-dir.js' +import { a256cbcHs512DirDecrypter, a256cbcHs512DirEncrypter } from './a256cbc-hs512-dir.js' + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// A256CBC-HS512 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export function a256cbcHs512AnonEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, + ) +} + +export function a256cbcHs512AnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+A256KW' + const enc = 'A256CBC-HS512' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function a256cbcHs512AuthEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {}, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, + ) +} + +export function a256cbcHs512AuthDecrypterX25519WithA256KW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array, +): Decrypter { + const alg = 'ECDH-1PU+A256KW' + const enc = 'A256CBC-HS512' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// A256GCM +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export function a256gcmAnonEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'XC20P' }, + ) +} + +export function a256gcmAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+A256KW' + const enc = 'A256GCM' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {}, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'A256GCM' }, + ) +} + +export function a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array, +): Decrypter { + const alg = 'ECDH-1PU+A256KW' + const enc = 'A256GCM' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (!kek) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// XC20P +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export function xc20pAnonEncrypterX25519WithA256KW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, + ) +} + +export function xc20pAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+A256KW' + const enc = 'XC20P' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + // FIXME: why is there no tag and IV check here? + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return xc20pDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {}, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + a256KeyWrapper, + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, + ) +} + +export function xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array, +): Decrypter { + const alg = 'ECDH-1PU+A256KW' + const enc = 'XC20P' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (!kek) return null + // Content Encryption Key + const unwrapper = a256KeyUnwrapper(kek) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) + if (cek === null) return null + + return xc20pDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} diff --git a/packages/did-comm/src/encryption/a256kw.ts b/packages/did-comm/src/encryption/a256kw.ts new file mode 100644 index 000000000..98396bbcb --- /dev/null +++ b/packages/did-comm/src/encryption/a256kw.ts @@ -0,0 +1,28 @@ +import { AESKW } from '@stablelib/aes-kw' +import type { EncryptionResult, KeyWrapper } from 'did-jwt' + +/** + * Creates a wrapper using AES-KW + * @param wrappingKey + */ +export const a256KeyWrapper: KeyWrapper = { + from: (wrappingKey: Uint8Array) => { + const wrap = async (cek: Uint8Array): Promise => { + return { ciphertext: new AESKW(wrappingKey).wrapKey(cek) } + } + return { wrap } + }, + + alg: 'A256KW', +} + +export function a256KeyUnwrapper(wrappingKey: Uint8Array) { + const unwrap = async (wrappedCek: Uint8Array): Promise => { + try { + return new AESKW(wrappingKey).unwrapKey(wrappedCek) + } catch (e) { + return null + } + } + return { unwrap, alg: 'A256KW' } +} diff --git a/packages/did-comm/src/encryption/aesEncryption.ts b/packages/did-comm/src/encryption/aesEncryption.ts deleted file mode 100644 index b69ff0506..000000000 --- a/packages/did-comm/src/encryption/aesEncryption.ts +++ /dev/null @@ -1,512 +0,0 @@ -import type { - AuthEncryptParams, - Decrypter, - ECDH, - Encrypter, - EncryptionResult, - KeyWrapper, - ProtectedHeader, - Recipient, -} from 'did-jwt' -import { - computeX25519Ecdh1PUv3Kek, - computeX25519EcdhEsKek, - createX25519Ecdh1PUv3Kek, - createX25519EcdhEsKek, - xc20pDirDecrypter, - xc20pDirEncrypter, -} from 'did-jwt' -import { randomBytes } from '@noble/hashes/utils' -import { AESKW } from '@stablelib/aes-kw' -import { AES } from '@stablelib/aes' -import { GCM } from '@stablelib/gcm' -import { fromString } from 'uint8arrays/from-string' -import { base64ToBytes, bytesToBase64url, concat, encodeBase64url } from '@veramo/utils' -import crypto from 'isomorphic-webcrypto' -import { createFullEncrypter } from './createEncrypter.js' - -/** - * Creates a wrapper using AES-KW - * @param wrappingKey - */ -export const a256KeyWrapper: KeyWrapper = { - from: (wrappingKey: Uint8Array) => { - const wrap = async (cek: Uint8Array): Promise => { - return { ciphertext: new AESKW(wrappingKey).wrapKey(cek) } - } - return { wrap } - }, - - alg: 'A256KW', -} - -export function a256KeyUnwrapper(wrappingKey: Uint8Array) { - const unwrap = async (wrappedCek: Uint8Array): Promise => { - try { - return new AESKW(wrappingKey).unwrapKey(wrappedCek) - } catch (e) { - return null - } - } - return { unwrap, alg: 'A256KW' } -} - -export function a256gcmEncrypter( - key: Uint8Array, -): (cleartext: Uint8Array, aad?: Uint8Array) => EncryptionResult { - const blockcipher = new AES(key) - const cipher = new GCM(blockcipher) - return (cleartext: Uint8Array, aad?: Uint8Array) => { - const iv = randomBytes(cipher.nonceLength) - const sealed = cipher.seal(iv, cleartext, aad) - return { - ciphertext: sealed.subarray(0, sealed.length - cipher.tagLength), - tag: sealed.subarray(sealed.length - cipher.tagLength), - iv, - } - } -} - -export function a256gcmDirEncrypter(key: Uint8Array): Encrypter { - const a256gcmEncrypt = a256gcmEncrypter(key) - const enc = 'A256GCM' - const alg = 'dir' - - async function encrypt( - cleartext: Uint8Array, - protectedHeader: ProtectedHeader = {}, - aad?: Uint8Array, - ): Promise { - const protHeader = encodeBase64url(JSON.stringify(Object.assign({ alg }, protectedHeader, { enc }))) - const encodedAad = fromString(aad ? `${protHeader}.${bytesToBase64url(aad)}` : protHeader, 'utf-8') - return { - ...a256gcmEncrypt(cleartext, encodedAad), - protectedHeader: protHeader, - } - } - - return { alg, enc, encrypt } -} - -export function a256gcmDirDecrypter(key: Uint8Array): Decrypter { - const cipher = new GCM(new AES(key)) - - async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise { - return cipher.open(iv, sealed, aad) - } - - return { alg: 'dir', enc: 'A256GCM', decrypt } -} - -const MAX_INT32 = 2 ** 32 - -function writeUInt32BE(buf: Uint8Array, value: number, offset?: number) { - if (value < 0 || value >= MAX_INT32) { - throw new RangeError(`value must be >= 0 and <= ${MAX_INT32 - 1}. Received ${value}`) - } - buf.set([value >>> 24, value >>> 16, value >>> 8, value & 0xff], offset) -} - -function uint64be(value: number) { - const high = Math.floor(value / MAX_INT32) - const low = value % MAX_INT32 - const buf = new Uint8Array(8) - writeUInt32BE(buf, high, 0) - writeUInt32BE(buf, low, 4) - return buf -} - -/** - * Code copied and adapted from https://github.com/panva/jose - * @param enc - the JWE content encryption algorithm (e.g. A256CBC-HS512) - * @param plaintext - the content to encrypt - * @param cek - the raw content encryption key - * @param providedIV - optional provided Initialization Vector - * @param aad - optional additional authenticated data - */ -async function cbcEncrypt( - enc: string = 'A256CBC-HS512', - plaintext: Uint8Array, - cek: Uint8Array, - providedIV?: Uint8Array, - aad: Uint8Array = new Uint8Array(0), -) { - // A256CBC-HS512 CEK size should be 512 bits; first 256 bits are used for HMAC with SHA-512 and the rest for AES-CBC - const keySize = parseInt(enc.slice(1, 4), 10) - const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, [ - 'encrypt', - ]) - const macKey = await crypto.subtle.importKey( - 'raw', - cek.subarray(0, keySize >> 3), - { - hash: `SHA-${keySize << 1}`, - name: 'HMAC', - }, - false, - ['sign'], - ) - - if (providedIV && providedIV.length !== keySize >> 4) { - throw new Error(`illegal_argument: Invalid IV size, expected ${keySize >> 4}, got ${providedIV.length}`) - } - const iv = providedIV ?? randomBytes(keySize >> 4) - - const ciphertext = new Uint8Array( - await crypto.subtle.encrypt( - { - iv, - name: 'AES-CBC', - }, - encKey, - plaintext, - ), - ) - - const macData = concat([aad, iv, ciphertext, uint64be(aad.length << 3)]) - const tag = new Uint8Array((await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3)) - - return { enc: 'dir', ciphertext, tag, iv } -} - -export function timingSafeEqual(a: Uint8Array, b: Uint8Array): boolean { - if (a.length !== b.length) { - return false - } - let result = 0 - let len = a.length - for (let i = 0; i < len; i++) { - result |= a[i] ^ b[i] - } - return result === 0 -} - -async function cbcDecrypt( - enc: string = 'A256CBC-HS512', - cek: Uint8Array, - ciphertext: Uint8Array, - iv: Uint8Array, - tag: Uint8Array, - aad: Uint8Array, -) { - const keySize = parseInt(enc.slice(1, 4), 10) - const encKey = await crypto.subtle.importKey('raw', cek.subarray(keySize >> 3), 'AES-CBC', false, [ - 'decrypt', - ]) - const macKey = await crypto.subtle.importKey( - 'raw', - cek.subarray(0, keySize >> 3), - { - hash: `SHA-${keySize << 1}`, - name: 'HMAC', - }, - false, - ['sign'], - ) - - const macData = concat([aad, iv, ciphertext, uint64be(aad.length << 3)]) - const expectedTag = new Uint8Array( - (await crypto.subtle.sign('HMAC', macKey, macData)).slice(0, keySize >> 3), - ) - - let macCheckPassed!: boolean - try { - macCheckPassed = timingSafeEqual(tag, expectedTag) - } catch { - // - } - if (!macCheckPassed) { - // current JWE decryption pipeline tries to decrypt multiple times with different keys, so return null instead of - // throwing an error - return null - // throw new Error('jwe_decryption_failed: MAC check failed') - } - - let plaintext: Uint8Array | null = null - try { - plaintext = new Uint8Array(await crypto.subtle.decrypt({ iv, name: 'AES-CBC' }, encKey, ciphertext)) - } catch (e: any) { - // current JWE decryption pipeline tries to decrypt multiple times with different keys, so return null instead of - // throwing an error - } - - return plaintext -} - -export function a256cbcHs512DirDecrypter(key: Uint8Array): Decrypter { - // const cipher = new GCM(new AES(key)) - - async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise { - // did-jwt#decryptJWE combines the ciphertext and the tag into a single `sealed` array - const TAG_LENGTH = 32 - const ciphertext = sealed.subarray(0, sealed.length - TAG_LENGTH) - const tag = sealed.subarray(sealed.length - TAG_LENGTH) - return cbcDecrypt('A256CBC-HS512', key, ciphertext, iv, tag, aad ?? new Uint8Array(0)) - } - - return { alg: 'dir', enc: 'A256GCM', decrypt } -} - -export function a256cbcHs512DirEncrypter(cek: Uint8Array): Encrypter { - const enc = 'A256CBC-HS512' - const alg = 'dir' - - async function encrypt( - cleartext: Uint8Array, - protectedHeader: ProtectedHeader = {}, - aad?: Uint8Array, - ): Promise { - const protHeader = encodeBase64url(JSON.stringify(Object.assign({ alg }, protectedHeader, { enc }))) - const encodedAad = fromString(aad ? `${protHeader}.${bytesToBase64url(aad)}` : protHeader, 'utf-8') - const iv: Uint8Array | undefined = protectedHeader.iv ? base64ToBytes(protectedHeader.iv) : undefined - return { - ...(await cbcEncrypt('A256CBC-HS512', cleartext, cek, iv, encodedAad)), - protectedHeader: protHeader, - } - } - - return { alg, enc, encrypt } -} - -export function a256cbcHs512AnonEncrypterX25519WithA256KW( - recipientPublicKey: Uint8Array, - kid?: string, - apv?: string, -): Encrypter { - return createFullEncrypter( - recipientPublicKey, - undefined, - { apv, kid }, - { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, - a256KeyWrapper, - { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, - ) -} - -export function a256cbcHs512AuthEncrypterX25519WithA256KW( - recipientPublicKey: Uint8Array, - senderSecret: Uint8Array | ECDH, - options: Partial = {}, -): Encrypter { - return createFullEncrypter( - recipientPublicKey, - senderSecret, - options, - { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, - a256KeyWrapper, - { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, - ) -} - -export function a256gcmAnonEncrypterX25519WithA256KW( - recipientPublicKey: Uint8Array, - kid?: string, - apv?: string, -): Encrypter { - return createFullEncrypter( - recipientPublicKey, - undefined, - { apv, kid }, - { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, - a256KeyWrapper, - { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'XC20P' }, - ) -} - -export function xc20pAnonEncrypterX25519WithA256KW( - recipientPublicKey: Uint8Array, - kid?: string, - apv?: string, -): Encrypter { - return createFullEncrypter( - recipientPublicKey, - undefined, - { apv, kid }, - { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, - a256KeyWrapper, - { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, - ) -} - -export function xc20pAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { - const alg = 'ECDH-ES+A256KW' - const enc = 'XC20P' - - async function decrypt( - sealed: Uint8Array, - iv: Uint8Array, - aad?: Uint8Array, - recipient?: Recipient, - ): Promise { - recipient = recipient - const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) - if (kek === null) return null - // Content Encryption Key - const unwrapper = a256KeyUnwrapper(kek) - const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) - if (cek === null) return null - - return xc20pDirDecrypter(cek).decrypt(sealed, iv, aad) - } - - return { alg, enc, decrypt } -} - -export function a256cbcHs512AnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { - const alg = 'ECDH-ES+A256KW' - const enc = 'A256CBC-HS512' - - async function decrypt( - sealed: Uint8Array, - iv: Uint8Array, - aad?: Uint8Array, - recipient?: Recipient, - ): Promise { - recipient = recipient - const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) - if (kek === null) return null - // Content Encryption Key - const unwrapper = a256KeyUnwrapper(kek) - const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) - if (cek === null) return null - - return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) - } - - return { alg, enc, decrypt } -} - -export function a256cbcHs512AuthDecrypterX25519WithA256KW( - recipientSecret: Uint8Array | ECDH, - senderPublicKey: Uint8Array, -): Decrypter { - const alg = 'ECDH-1PU+A256KW' - const enc = 'A256CBC-HS512' - - async function decrypt( - sealed: Uint8Array, - iv: Uint8Array, - aad?: Uint8Array, - recipient?: Recipient, - ): Promise { - recipient = recipient - const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) - if (kek === null) return null - // Content Encryption Key - const unwrapper = a256KeyUnwrapper(kek) - const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) - if (cek === null) return null - - return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) - } - - return { alg, enc, decrypt } -} - -export function a256gcmAnonDecrypterX25519WithA256KW(receiverSecret: Uint8Array | ECDH): Decrypter { - const alg = 'ECDH-ES+A256KW' - const enc = 'A256GCM' - - async function decrypt( - sealed: Uint8Array, - iv: Uint8Array, - aad?: Uint8Array, - recipient?: Recipient, - ): Promise { - recipient = recipient - const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) - if (kek === null) return null - // Content Encryption Key - const unwrapper = a256KeyUnwrapper(kek) - const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) - if (cek === null) return null - - return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) - } - - return { alg, enc, decrypt } -} - -export function xc20pAuthEncrypterEcdh1PuV3x25519WithA256KW( - recipientPublicKey: Uint8Array, - senderSecret: Uint8Array | ECDH, - options: Partial = {}, -): Encrypter { - return createFullEncrypter( - recipientPublicKey, - senderSecret, - options, - { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, - a256KeyWrapper, - { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, - ) -} - -export function xc20pAuthDecrypterEcdh1PuV3x25519WithA256KW( - recipientSecret: Uint8Array | ECDH, - senderPublicKey: Uint8Array, -): Decrypter { - const alg = 'ECDH-1PU+A256KW' - const enc = 'XC20P' - - async function decrypt( - sealed: Uint8Array, - iv: Uint8Array, - aad?: Uint8Array, - recipient?: Recipient, - ): Promise { - recipient = recipient - const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) - if (!kek) return null - // Content Encryption Key - const unwrapper = a256KeyUnwrapper(kek) - const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) - if (cek === null) return null - - return xc20pDirDecrypter(cek).decrypt(sealed, iv, aad) - } - - return { alg, enc, decrypt } -} - -export function a256gcmAuthEncrypterEcdh1PuV3x25519WithA256KW( - recipientPublicKey: Uint8Array, - senderSecret: Uint8Array | ECDH, - options: Partial = {}, -): Encrypter { - return createFullEncrypter( - recipientPublicKey, - senderSecret, - options, - { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, - a256KeyWrapper, - { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'A256GCM' }, - ) -} - -export function a256gcmAuthDecrypterEcdh1PuV3x25519WithA256KW( - recipientSecret: Uint8Array | ECDH, - senderPublicKey: Uint8Array, -): Decrypter { - const alg = 'ECDH-1PU+A256KW' - const enc = 'A256GCM' - - async function decrypt( - sealed: Uint8Array, - iv: Uint8Array, - aad?: Uint8Array, - recipient?: Recipient, - ): Promise { - recipient = recipient - const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) - if (!kek) return null - // Content Encryption Key - const unwrapper = a256KeyUnwrapper(kek) - const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key)) - if (cek === null) return null - - return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) - } - - return { alg, enc, decrypt } -} diff --git a/packages/did-comm/src/encryption/xc20pkw-encrypters.ts b/packages/did-comm/src/encryption/xc20pkw-encrypters.ts new file mode 100644 index 000000000..2fed3db8f --- /dev/null +++ b/packages/did-comm/src/encryption/xc20pkw-encrypters.ts @@ -0,0 +1,285 @@ +import { + AuthEncryptParams, + computeX25519Ecdh1PUv3Kek, + computeX25519EcdhEsKek, + createX25519Ecdh1PUv3Kek, + createX25519EcdhEsKek, + Decrypter, + ECDH, + Encrypter, + Recipient, + xc20pDirEncrypter, +} from 'did-jwt' +import { createFullEncrypter } from './createEncrypter.js' +import { base64ToBytes } from '@veramo/utils' +import { xc20pDecrypter, xc20pKeyUnwrapper, xc20pKeyWrapper } from './xc20pkw.js' +import { a256cbcHs512DirDecrypter, a256cbcHs512DirEncrypter } from './a256cbc-hs512-dir.js' +import { a256gcmDirDecrypter, a256gcmDirEncrypter } from './a256gcm-dir.js' +import { a256KeyWrapper } from './a256kw.js' + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// A256CBC-HS512 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export function a256cbcHs512AnonEncrypterX25519WithXC20PKW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + xc20pKeyWrapper, + { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, + ) +} + +export function a256cbcHs512AnonDecrypterX25519WithXC20PKW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+XC20PKW' + const enc = 'A256CBC-HS512' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = xc20pKeyUnwrapper(kek) + const recipientIV = recipient?.header?.iv ? base64ToBytes(recipient.header.iv) : new Uint8Array(0) + const recipientTag = recipient?.header?.tag ? base64ToBytes(recipient.header.tag) : new Uint8Array(0) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key), recipientIV, recipientTag) + if (cek === null) return null + + return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function a256cbcHs512AuthEncrypterX25519WithXC20PKW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {}, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + xc20pKeyWrapper, + { from: (cek: Uint8Array) => a256cbcHs512DirEncrypter(cek), enc: 'A256CBC-HS512' }, + ) +} + +export function a256cbcHs512AuthDecrypterX25519WithXC20PKW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array, +): Decrypter { + const alg = 'ECDH-1PU+XC20PKW' + const enc = 'A256CBC-HS512' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = xc20pKeyUnwrapper(kek) + const recipientIV = recipient?.header?.iv ? base64ToBytes(recipient.header.iv) : new Uint8Array(0) + const recipientTag = recipient?.header?.tag ? base64ToBytes(recipient.header.tag) : new Uint8Array(0) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key), recipientIV, recipientTag) + if (cek === null) return null + + return a256cbcHs512DirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// A256GCM +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export function a256gcmAnonEncrypterX25519WithXC20PKW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + xc20pKeyWrapper, + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'XC20P' }, + ) +} + +export function a256gcmAnonDecrypterX25519WithXC20PKW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+XC20PKW' + const enc = 'A256GCM' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = xc20pKeyUnwrapper(kek) + const recipientIV = recipient?.header?.iv ? base64ToBytes(recipient.header.iv) : new Uint8Array(0) + const recipientTag = recipient?.header?.tag ? base64ToBytes(recipient.header.tag) : new Uint8Array(0) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key), recipientIV, recipientTag) + if (cek === null) return null + + return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function a256gcmAuthEncrypterEcdh1PuV3x25519WithXC20PKW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {}, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + xc20pKeyWrapper, + { from: (cek: Uint8Array) => a256gcmDirEncrypter(cek), enc: 'A256GCM' }, + ) +} + +export function a256gcmAuthDecrypterEcdh1PuV3x25519WithXC20PKW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array, +): Decrypter { + const alg = 'ECDH-1PU+XC20PKW' + const enc = 'A256GCM' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (!kek) return null + // Content Encryption Key + const unwrapper = xc20pKeyUnwrapper(kek) + const recipientIV = recipient?.header?.iv ? base64ToBytes(recipient.header.iv) : new Uint8Array(0) + const recipientTag = recipient?.header?.tag ? base64ToBytes(recipient.header.tag) : new Uint8Array(0) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key), recipientIV, recipientTag) + if (cek === null) return null + + return a256gcmDirDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// XC20P +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +export function xc20pAnonEncrypterX25519WithXC20PKW( + recipientPublicKey: Uint8Array, + kid?: string, + apv?: string, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + undefined, + { apv, kid }, + { createKek: createX25519EcdhEsKek, alg: 'ECDH-ES' }, + xc20pKeyWrapper, + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, + ) +} + +export function xc20pAnonDecrypterX25519WithXC20PKW(receiverSecret: Uint8Array | ECDH): Decrypter { + const alg = 'ECDH-ES+XC20PKW' + const enc = 'XC20P' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519EcdhEsKek(recipient, receiverSecret, alg) + if (kek === null) return null + // Content Encryption Key + const unwrapper = xc20pKeyUnwrapper(kek) + const recipientIV = recipient?.header?.iv ? base64ToBytes(recipient.header.iv) : new Uint8Array(0) + const recipientTag = recipient?.header?.tag ? base64ToBytes(recipient.header.tag) : new Uint8Array(0) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key), recipientIV, recipientTag) + if (cek === null) return null + + return xc20pDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} + +export function xc20pAuthEncrypterEcdh1PuV3x25519WithXC20PKW( + recipientPublicKey: Uint8Array, + senderSecret: Uint8Array | ECDH, + options: Partial = {}, +): Encrypter { + return createFullEncrypter( + recipientPublicKey, + senderSecret, + options, + { createKek: createX25519Ecdh1PUv3Kek, alg: 'ECDH-1PU' }, + xc20pKeyWrapper, + { from: (cek: Uint8Array) => xc20pDirEncrypter(cek), enc: 'XC20P' }, + ) +} + +export function xc20pAuthDecrypterEcdh1PuV3x25519WithXC20PKW( + recipientSecret: Uint8Array | ECDH, + senderPublicKey: Uint8Array, +): Decrypter { + const alg = 'ECDH-1PU+XC20PKW' + const enc = 'XC20P' + + async function decrypt( + sealed: Uint8Array, + iv: Uint8Array, + aad?: Uint8Array, + recipient?: Recipient, + ): Promise { + recipient = recipient + const kek = await computeX25519Ecdh1PUv3Kek(recipient, recipientSecret, senderPublicKey, alg) + if (!kek) return null + // Content Encryption Key + const unwrapper = xc20pKeyUnwrapper(kek) + const recipientIV = recipient?.header?.iv ? base64ToBytes(recipient.header.iv) : new Uint8Array(0) + const recipientTag = recipient?.header?.tag ? base64ToBytes(recipient.header.tag) : new Uint8Array(0) + const cek = await unwrapper.unwrap(base64ToBytes(recipient.encrypted_key), recipientIV, recipientTag) + if (cek === null) return null + + return xc20pDecrypter(cek).decrypt(sealed, iv, aad) + } + + return { alg, enc, decrypt } +} diff --git a/packages/did-comm/src/encryption/xc20pkw.ts b/packages/did-comm/src/encryption/xc20pkw.ts new file mode 100644 index 000000000..f8ead83d0 --- /dev/null +++ b/packages/did-comm/src/encryption/xc20pkw.ts @@ -0,0 +1,48 @@ +import type { Decrypter, KeyWrapper, WrappingResult } from 'did-jwt' +import { randomBytes } from '@noble/hashes/utils' +import { concat } from '@veramo/utils' +import { XChaCha20Poly1305 } from '@stablelib/xchacha20poly1305' + +export const xc20pKeyWrapper: KeyWrapper = { + from: (wrappingKey: Uint8Array) => { + const cipher = new XChaCha20Poly1305(wrappingKey) + const wrap = async (cek: Uint8Array): Promise => { + const iv = randomBytes(cipher.nonceLength) + const sealed = cipher.seal(iv, cek) + return { + ciphertext: sealed.subarray(0, sealed.length - cipher.tagLength), + tag: sealed.subarray(sealed.length - cipher.tagLength), + iv, + } + } + return { wrap } + }, + + alg: 'XC20PKW', +} + +export function xc20pDecrypter(key: Uint8Array): Decrypter { + const cipher = new XChaCha20Poly1305(key) + + async function decrypt(sealed: Uint8Array, iv: Uint8Array, aad?: Uint8Array): Promise { + return cipher.open(iv, sealed, aad) + } + + return { alg: 'dir', enc: 'XC20P', decrypt } +} + +export function xc20pKeyUnwrapper(wrappingKey: Uint8Array) { + const unwrap = async ( + wrappedCek: Uint8Array, + iv: Uint8Array, + tag: Uint8Array, + ): Promise => { + try { + const sealed = concat([wrappedCek, tag]) + return xc20pDecrypter(wrappingKey).decrypt(sealed, iv) + } catch (e) { + return null + } + } + return { unwrap, alg: 'XC20PKW' } +} diff --git a/packages/did-comm/src/plugin.schema.json b/packages/did-comm/src/plugin.schema.json index bb5ca6d37..c74f08601 100644 --- a/packages/did-comm/src/plugin.schema.json +++ b/packages/did-comm/src/plugin.schema.json @@ -183,7 +183,8 @@ "type": "string", "enum": [ "XC20P", - "A256GCM" + "A256GCM", + "A256CBC-HS512" ], "description": "Optional content encryption algorithm to use. Defaults to 'A256GCM'" }, diff --git a/packages/did-comm/src/types/message-types.ts b/packages/did-comm/src/types/message-types.ts index 10c8d2f9d..44ec42755 100644 --- a/packages/did-comm/src/types/message-types.ts +++ b/packages/did-comm/src/types/message-types.ts @@ -39,7 +39,7 @@ export interface IDIDCommOptions { /** * Optional content encryption algorithm to use. Defaults to 'A256GCM' */ - enc?: 'XC20P' | 'A256GCM' + enc?: 'XC20P' | 'A256GCM' | 'A256CBC-HS512' /** * Optional key wrapping algorithm to use. Defaults to 'ECDH-ES+A256KW' From 777ec8f8ab84a7e5119bf2eb8d1247ba3998fae5 Mon Sep 17 00:00:00 2001 From: Mircea Nistor Date: Mon, 12 Jun 2023 17:28:11 +0200 Subject: [PATCH 11/11] chore(deps): bump transmute dependencies --- .github/workflows/build-and-test-on-pr.yml | 47 - __tests__/shared/verifiableDataJWT.ts | 4 +- __tests__/shared/verifiableDataLD.ts | 13 +- package.json | 9 +- packages/cli/package.json | 44 +- packages/core-types/package.json | 2 +- packages/core/package.json | 2 +- packages/credential-ld/package.json | 6 +- packages/credential-w3c/package.json | 4 +- packages/data-store-json/package.json | 6 +- packages/data-store/package.json | 4 +- packages/did-comm/package.json | 4 +- packages/did-comm/src/didcomm.ts | 20 +- packages/did-provider-ethr/package.json | 2 +- packages/did-provider-ion/package.json | 4 +- packages/did-provider-jwk/package.json | 2 +- packages/key-manager/package.json | 6 +- packages/kms-local/package.json | 2 +- packages/kv-store/package.json | 2 +- packages/remote-client/package.json | 2 +- packages/selective-disclosure/package.json | 2 +- packages/test-react-app/package.json | 10 +- packages/utils/package.json | 10 +- pnpm-lock.yaml | 2809 ++++++-------------- 24 files changed, 841 insertions(+), 2175 deletions(-) diff --git a/.github/workflows/build-and-test-on-pr.yml b/.github/workflows/build-and-test-on-pr.yml index 56d232826..0c7664df0 100644 --- a/.github/workflows/build-and-test-on-pr.yml +++ b/.github/workflows/build-and-test-on-pr.yml @@ -136,50 +136,3 @@ jobs: cache: 'pnpm' - run: pnpm run lint - run: pnpm run docs - - test-browser: - needs: build - runs-on: ubuntu-latest - steps: - - uses: pnpm/action-setup@v2 - with: - version: 8 - - run: pnpm add -g pnpm - - name: 'Restore build output' - uses: actions/cache/restore@v3 - with: - path: ${{ github.workspace }} - key: ${{ runner.os }}-build-${{ github.sha }}-${{ github.run_id }} - restore-keys: ${{ runner.os }}-build-${{ github.sha }} - fail-on-cache-miss: true - - name: 'Setup Node.js with pnpm cache' - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: 'pnpm' - - run: pnpm install --force - - name: 'Run browser tests' - run: pnpm test:browser - - lint-and-docs: - needs: build - runs-on: ubuntu-latest - steps: - - uses: pnpm/action-setup@v2 - with: - version: 8 - - run: pnpm add -g pnpm - - name: 'Restore build output' - uses: actions/cache/restore@v3 - with: - path: ${{ github.workspace }} - key: ${{ runner.os }}-build-${{ github.sha }}-${{ github.run_id }} - restore-keys: ${{ runner.os }}-build-${{ github.sha }} - fail-on-cache-miss: true - - name: 'Setup Node.js with pnpm cache' - uses: actions/setup-node@v3 - with: - node-version: 20 - cache: 'pnpm' - - run: pnpm run lint - - run: pnpm run docs diff --git a/__tests__/shared/verifiableDataJWT.ts b/__tests__/shared/verifiableDataJWT.ts index 3c900effb..b258fdd9c 100644 --- a/__tests__/shared/verifiableDataJWT.ts +++ b/__tests__/shared/verifiableDataJWT.ts @@ -100,7 +100,7 @@ export default (testContext: { }, proofFormat: 'jwt', }) - const verifyResult = await agent.verifyCredential({credential: verifiableCredential}) + const verifyResult = await agent.verifyCredential({ credential: verifiableCredential }) expect(verifyResult.verified).toBe(true) expect(verifiableCredential).toHaveProperty('proof.jwt') @@ -403,7 +403,7 @@ export default (testContext: { hello: 'world', }, credentialStatus: { - id: 'override me', + id: 'override:me', type: 'ThisMethodDoesNotExist2022', }, }, diff --git a/__tests__/shared/verifiableDataLD.ts b/__tests__/shared/verifiableDataLD.ts index f5be23f16..8f3d127d5 100644 --- a/__tests__/shared/verifiableDataLD.ts +++ b/__tests__/shared/verifiableDataLD.ts @@ -37,7 +37,11 @@ export default (testContext: { challenge = 'TEST_CHALLENGE_STRING' didEthrIdentifier = await agent.didManagerCreate({ kms: 'local', provider: 'did:ethr' }) didKeyIdentifier = await agent.didManagerCreate({ kms: 'local', provider: 'did:key' }) - pkhIdentifier = await agent.didManagerCreate({ kms: 'local', provider: "did:pkh", options: { chainId: "1"} }) + pkhIdentifier = await agent.didManagerCreate({ + kms: 'local', + provider: 'did:pkh', + options: { chainId: '1' }, + }) }) afterAll(testContext.tearDown) @@ -295,7 +299,7 @@ export default (testContext: { issuer: { id: pkhIdentifier.did }, '@context': [ 'https://www.w3.org/2018/credentials/v1', - 'https://veramo.io/contexts/discord-kudos/v1' + 'https://veramo.io/contexts/discord-kudos/v1', ], type: ['VerifiableCredential', 'DiscordKudos'], issuanceDate: new Date().toISOString(), @@ -315,10 +319,9 @@ export default (testContext: { const result = await agent.verifyCredential({ credential, - fetchRemoteContexts: true + fetchRemoteContexts: true, }) expect(result.verified).toBe(true) - }) describe('credential verification policies', () => { @@ -363,7 +366,7 @@ export default (testContext: { name: 'hello', }, credentialStatus: { - id: 'override me', + id: 'override:me', type: 'ThisMethodDoesNotExist2022', }, }, diff --git a/package.json b/package.json index bac9336ce..f870abc52 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "docs": "pnpm docs:copy && pnpm docs:build", "docs:copy": "ts-node ./scripts/docs-copy.ts", "docs:build": "ts-node ./scripts/docs-build.ts && pnpm docs:pretty", - "docs:pretty": "pretty-quick" + "docs:pretty": "prettier --write docs/**/*.md" }, "devDependencies": { "@ethersproject/contracts": "^5.7.0", @@ -37,14 +37,14 @@ "@microsoft/api-extractor": "7.35.2", "@microsoft/api-extractor-model": "7.27.2", "@microsoft/tsdoc": "0.14.2", - "@noble/hashes": "1.3.0", + "@noble/hashes": "1.3.1", "@stablelib/ed25519": "1.0.3", "@transmute/credentials-context": "0.7.0-unstable.81", "@types/express": "4.17.17", "@types/fs-extra": "11.0.1", "@types/jest": "29.5.2", "@types/node": "20.3.0", - "@types/uuid": "9.0.1", + "@types/uuid": "9.0.2", "caip": "1.1.0", "credential-status": "2.0.5", "cross-env": "7.0.3", @@ -64,7 +64,6 @@ "oas-resolver": "2.5.6", "openapi-types": "12.1.3", "prettier": "3.0.0", - "pretty-quick": "3.1.3", "rimraf": "5.0.1", "semantic-release": "21.0.5", "ts-jest": "29.1.0", @@ -72,7 +71,7 @@ "ts-node": "10.9.1", "typeorm": "0.3.16", "typescript": "5.1.3", - "uint8arrays": "4.0.3", + "uint8arrays": "4.0.4", "uuid": "9.0.0", "web-did-resolver": "2.0.27" }, diff --git a/packages/cli/package.json b/packages/cli/package.json index 5b701cc6c..37b77a1bb 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -33,10 +33,10 @@ "update-veramo-latest": "pnpm add @veramo/core@latest @veramo/discovery@latest @veramo/remote-client@latest @veramo/remote-server@latest @veramo/did-provider-key@latest @veramo/did-resolver@latest @veramo/did-jwt@latest @veramo/credential-w3c@latest @veramo/did-provider-ethr@latest @veramo/did-provider-web@latest @veramo/did-comm@latest @veramo/kms-local@latest @veramo/selective-disclosure@latest @veramo/data-store@latest @veramo/key-manager@latest @veramo/message-handler@latest @veramo/did-manager@latest @veramo/url-handler@latest @veramo/credential-eip712@latest @veramo/utils@latest" }, "dependencies": { - "@microsoft/api-extractor": "^7.35.1", - "@microsoft/api-extractor-model": "^7.27.1", - "@transmute/credentials-context": "^0.7.0-unstable.79", - "@types/blessed": "^0.1.19", + "@microsoft/api-extractor": "^7.35.2", + "@microsoft/api-extractor-model": "^7.27.2", + "@transmute/credentials-context": "^0.7.0-unstable.81", + "@types/blessed": "^0.1.22", "@types/swagger-ui-express": "^4.1.3", "@veramo/core": "workspace:^", "@veramo/core-types": "workspace:^", @@ -64,37 +64,37 @@ "@veramo/utils": "workspace:^", "blessed": "^0.1.81", "commander": "^11.0.0", - "console-table-printer": "^2.10.0", + "console-table-printer": "^2.11.1", "cors": "^2.8.5", "cross-fetch": "^3.1.6", - "date-fns": "^2.28.0", - "debug": "^4.3.3", + "date-fns": "^2.30.0", + "debug": "^4.3.4", "did-resolver": "^4.1.0", - "dotenv": "^16.0.0", + "dotenv": "^16.1.4", "ethr-did-resolver": "^8.0.0", "express": "^4.18.2", - "express-handlebars": "^7.0.0", + "express-handlebars": "^7.0.7", "fuzzy": "^0.1.3", - "handlebars": "^4.7.6", - "inquirer": "^9.1.4", + "handlebars": "^4.7.7", + "inquirer": "^9.2.7", "inquirer-autocomplete-prompt": "^3.0.0", "json-schema": "^0.4.0", - "json5": "^2.2.0", - "jsonpointer": "^5.0.0", - "oas-resolver": "^2.5.3", - "openapi-types": "^12.0.2", + "json5": "^2.2.3", + "jsonpointer": "^5.0.1", + "oas-resolver": "^2.5.6", + "openapi-types": "^12.1.3", "passport": "^0.6.0", "passport-http-bearer": "^1.0.1", - "pg": "^8.7.1", + "pg": "^8.11.0", "qrcode-terminal": "^0.12.0", - "sqlite3": "^5.0.8", - "swagger-ui-express": "^4.6.0", + "sqlite3": "^5.1.6", + "swagger-ui-express": "^4.6.3", "ts-json-schema-generator": "^1.2.0", "typeorm": "^0.3.10", - "url-parse": "^1.5.4", + "url-parse": "^1.5.10", "web-did-resolver": "^2.0.24", - "ws": "^8.11.0", - "yaml": "^2.1.3" + "ws": "^8.13.0", + "yaml": "^2.3.1" }, "devDependencies": { "@types/debug": "4.1.8", @@ -105,7 +105,7 @@ "@types/passport-http-bearer": "1.0.37", "@types/qrcode-terminal": "0.12.0", "@types/url-parse": "1.4.8", - "@types/ws": "8.5.4", + "@types/ws": "8.5.5", "typescript": "5.1.3" }, "files": [ diff --git a/packages/core-types/package.json b/packages/core-types/package.json index 4f2b2a9ca..9c480187a 100644 --- a/packages/core-types/package.json +++ b/packages/core-types/package.json @@ -35,7 +35,7 @@ "dependencies": { "credential-status": "^2.0.5", "debug": "^4.3.3", - "did-jwt-vc": "^3.2.1", + "did-jwt-vc": "^3.2.3", "did-resolver": "^4.1.0" }, "devDependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index b7ef88f79..c4496df48 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -16,7 +16,7 @@ "@veramo/core-types": "workspace:^", "debug": "^4.3.4", "events": "^3.2.0", - "z-schema": "^6.0.0" + "z-schema": "^6.0.1" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/credential-ld/package.json b/packages/credential-ld/package.json index ab5309d80..2571c572d 100644 --- a/packages/credential-ld/package.json +++ b/packages/credential-ld/package.json @@ -23,9 +23,9 @@ "@digitalcredentials/jsonld": "^5.2.1", "@digitalcredentials/jsonld-signatures": "^9.3.1", "@digitalcredentials/vc": "^5.0.0", - "@transmute/credentials-context": "^0.7.0-unstable.79", - "@transmute/ed25519-signature-2018": "^0.7.0-unstable.79", - "@transmute/json-web-signature": "^0.7.0-unstable.79", + "@transmute/credentials-context": "^0.7.0-unstable.81", + "@transmute/ed25519-signature-2018": "^0.7.0-unstable.81", + "@transmute/json-web-signature": "^0.7.0-unstable.81", "@veramo-community/lds-ecdsa-secp256k1-recovery2020": "uport-project/EcdsaSecp256k1RecoverySignature2020", "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", diff --git a/packages/credential-w3c/package.json b/packages/credential-w3c/package.json index da63a5001..ceff2d4e3 100644 --- a/packages/credential-w3c/package.json +++ b/packages/credential-w3c/package.json @@ -19,7 +19,7 @@ "canonicalize": "^2.0.0", "debug": "^4.3.3", "did-jwt": "^7.2.0", - "did-jwt-vc": "^3.2.1", + "did-jwt-vc": "^3.2.3", "did-resolver": "^4.1.0", "uuid": "^9.0.0" }, @@ -28,7 +28,7 @@ }, "devDependencies": { "@types/debug": "4.1.8", - "@types/uuid": "9.0.1", + "@types/uuid": "9.0.2", "typescript": "5.1.3" }, "files": [ diff --git a/packages/data-store-json/package.json b/packages/data-store-json/package.json index 2b75beed5..7c60b9b1c 100644 --- a/packages/data-store-json/package.json +++ b/packages/data-store-json/package.json @@ -10,19 +10,19 @@ "extract-api": "node ../cli/bin/veramo.js dev extract-api" }, "dependencies": { - "@ungap/structured-clone": "^1.0.0", + "@ungap/structured-clone": "^1.2.0", "@veramo/core-types": "workspace:^", "@veramo/did-manager": "workspace:^", "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt-vc": "^3.2.1", + "did-jwt-vc": "^3.2.3", "uuid": "^9.0.0" }, "devDependencies": { "@types/debug": "4.1.8", "@types/ungap__structured-clone": "0.3.0", - "@types/uuid": "9.0.1", + "@types/uuid": "9.0.2", "typescript": "5.1.3" }, "files": [ diff --git a/packages/data-store/package.json b/packages/data-store/package.json index 32ee9087f..48c2bc939 100644 --- a/packages/data-store/package.json +++ b/packages/data-store/package.json @@ -15,13 +15,13 @@ "@veramo/key-manager": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.3", - "did-jwt-vc": "^3.2.1", + "did-jwt-vc": "^3.2.3", "typeorm": "^0.3.10", "uuid": "^9.0.0" }, "devDependencies": { "@types/debug": "4.1.8", - "@types/uuid": "9.0.1", + "@types/uuid": "9.0.2", "sqlite3": "5.1.6", "typescript": "5.1.3" }, diff --git a/packages/did-comm/package.json b/packages/did-comm/package.json index 290044dd1..16f86d14e 100644 --- a/packages/did-comm/package.json +++ b/packages/did-comm/package.json @@ -19,7 +19,7 @@ }, "dependencies": { "@ethersproject/signing-key": "^5.7.0", - "@noble/curves": "^1.0.0", + "@noble/curves": "^1.1.0", "@stablelib/aes": "^1.0.1", "@stablelib/aes-kw": "^1.0.1", "@stablelib/gcm": "^1.0.2", @@ -36,7 +36,7 @@ }, "devDependencies": { "@types/debug": "4.1.8", - "@types/uuid": "9.0.1", + "@types/uuid": "9.0.2", "typescript": "5.1.3" }, "files": [ diff --git a/packages/did-comm/src/didcomm.ts b/packages/did-comm/src/didcomm.ts index 8e753599c..f286bf347 100644 --- a/packages/did-comm/src/didcomm.ts +++ b/packages/did-comm/src/didcomm.ts @@ -1,4 +1,4 @@ -import { +import type { IAgentContext, IAgentPlugin, IDIDManager, @@ -8,8 +8,22 @@ import { IMessageHandler, IResolver, } from '@veramo/core-types' -import { createJWE, Decrypter, decryptJWE, ECDH, Encrypter, JWE, verifyJWS } from 'did-jwt' -import { DIDDocument, parse as parseDidUrl, Service, VerificationMethod } from 'did-resolver' +import { + createJWE, + type Decrypter, + decryptJWE, + type ECDH, + type Encrypter, + type JWE, + verifyJWS, +} from 'did-jwt' +import { + type DIDDocument, + parse as parseDidUrl, + type Service, + type ServiceEndpoint, + type VerificationMethod, +} from 'did-resolver' import { a256cbcHs512AnonDecrypterX25519WithA256KW, a256cbcHs512AnonEncrypterX25519WithA256KW, diff --git a/packages/did-provider-ethr/package.json b/packages/did-provider-ethr/package.json index 2e8d496cf..ff49d3c2b 100644 --- a/packages/did-provider-ethr/package.json +++ b/packages/did-provider-ethr/package.json @@ -22,7 +22,7 @@ "@veramo/core-types": "workspace:^", "@veramo/did-manager": "workspace:^", "debug": "^4.3.3", - "ethr-did": "^2.3.12" + "ethr-did": "^2.3.14" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/did-provider-ion/package.json b/packages/did-provider-ion/package.json index 1d4b32d59..349577a6c 100644 --- a/packages/did-provider-ion/package.json +++ b/packages/did-provider-ion/package.json @@ -13,8 +13,8 @@ "@decentralized-identity/ion-sdk": "^1.0.0", "@ethersproject/random": "^5.7.0", "@ethersproject/signing-key": "^5.7.0", - "@noble/curves": "^1.0.0", - "@noble/hashes": "^1.3.0", + "@noble/curves": "^1.1.0", + "@noble/hashes": "^1.3.1", "@sphereon/ion-pow": "^0.2.0", "@sphereon/isomorphic-argon2": "^1.0.1", "@trust/keyto": "^1.0.1", diff --git a/packages/did-provider-jwk/package.json b/packages/did-provider-jwk/package.json index 5ce4462dc..7cdd30a05 100644 --- a/packages/did-provider-jwk/package.json +++ b/packages/did-provider-jwk/package.json @@ -10,7 +10,7 @@ "extract-api": "node ../cli/bin/veramo.js dev extract-api" }, "dependencies": { - "@noble/curves": "^1.0.0", + "@noble/curves": "^1.1.0", "@veramo/core-types": "workspace:^", "@veramo/did-manager": "workspace:^", "@veramo/utils": "workspace:^", diff --git a/packages/key-manager/package.json b/packages/key-manager/package.json index 55be388a0..8756d3a2f 100644 --- a/packages/key-manager/package.json +++ b/packages/key-manager/package.json @@ -13,18 +13,18 @@ "@ethersproject/bytes": "^5.7.0", "@ethersproject/strings": "^5.7.0", "@ethersproject/transactions": "^5.7.0", - "@noble/curves": "^1.0.0", + "@noble/curves": "^1.1.0", "@veramo/core-types": "workspace:^", "@veramo/utils": "workspace:^", "debug": "^4.3.4", "did-jwt": "^7.2.2", - "uint8arrays": "^4.0.3", + "uint8arrays": "^4.0.4", "uuid": "^9.0.0" }, "devDependencies": { "@ethersproject/abstract-signer": "5.7.0", "@types/debug": "4.1.8", - "@types/uuid": "9.0.1", + "@types/uuid": "9.0.2", "typescript": "5.1.3" }, "files": [ diff --git a/packages/kms-local/package.json b/packages/kms-local/package.json index 9f8c87ea0..b8b0e1ea0 100644 --- a/packages/kms-local/package.json +++ b/packages/kms-local/package.json @@ -17,7 +17,7 @@ "@ethersproject/strings": "^5.7.0", "@ethersproject/transactions": "^5.7.0", "@ethersproject/wallet": "^5.7.0", - "@noble/curves": "^1.0.0", + "@noble/curves": "^1.1.0", "@stablelib/nacl": "^1.0.4", "@stablelib/random": "^1.0.2", "@veramo/core-types": "workspace:^", diff --git a/packages/kv-store/package.json b/packages/kv-store/package.json index 8b42e1245..7d53e1d4e 100644 --- a/packages/kv-store/package.json +++ b/packages/kv-store/package.json @@ -18,7 +18,7 @@ "events": "^3.2.0", "json-buffer": "^3.0.1", "typeorm": "^0.3.10", - "uint8arrays": "^3.1.1" + "uint8arrays": "^4.0.4" }, "devDependencies": { "@keyv/compress-brotli": "1.1.3", diff --git a/packages/remote-client/package.json b/packages/remote-client/package.json index 84fbe5ef1..c99c2ae3c 100644 --- a/packages/remote-client/package.json +++ b/packages/remote-client/package.json @@ -13,7 +13,7 @@ "@veramo/core-types": "workspace:^", "cross-fetch": "^3.1.6", "debug": "^4.3.3", - "openapi-types": "12.1.0" + "openapi-types": "12.1.3" }, "devDependencies": { "@types/debug": "4.1.8", diff --git a/packages/selective-disclosure/package.json b/packages/selective-disclosure/package.json index 8a017f6d3..addb50961 100644 --- a/packages/selective-disclosure/package.json +++ b/packages/selective-disclosure/package.json @@ -27,7 +27,7 @@ }, "devDependencies": { "@types/debug": "4.1.8", - "@types/uuid": "9.0.1", + "@types/uuid": "9.0.2", "typescript": "5.1.3" }, "files": [ diff --git a/packages/test-react-app/package.json b/packages/test-react-app/package.json index 03bcb3e3c..996620340 100644 --- a/packages/test-react-app/package.json +++ b/packages/test-react-app/package.json @@ -39,7 +39,7 @@ "typeorm": "^0.3.10", "util": "npm:util", "web-did-resolver": "^2.0.24", - "web-vitals": "^3.3.1" + "web-vitals": "^3.3.2" }, "scripts": { "start": "craco start", @@ -66,16 +66,16 @@ ] }, "devDependencies": { - "@babel/plugin-syntax-import-assertions": "7.20.0", - "@babel/preset-typescript": "7.21.5", + "@babel/plugin-syntax-import-assertions": "7.22.5", + "@babel/preset-typescript": "7.22.5", "@craco/craco": "7.1.0", - "@types/eslint": "8.40.0", + "@types/eslint": "8.40.1", "@types/eslint-scope": "3.7.4", "@types/expect-puppeteer": "5.0.3", "@types/jest": "29.5.2", "@types/jest-environment-puppeteer": "5.0.3", "@types/node": "20.3.0", - "@types/react": "18.2.8", + "@types/react": "18.2.11", "@types/react-dom": "18.2.4", "babel-jest": "29.5.0", "babel-preset-react-app": "10.0.1", diff --git a/packages/utils/package.json b/packages/utils/package.json index b32564b6a..35899cedc 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -12,21 +12,21 @@ "dependencies": { "@ethersproject/signing-key": "^5.7.0", "@ethersproject/transactions": "^5.7.0", - "@noble/curves": "^1.0.0", - "@noble/hashes": "^1.3.0", + "@noble/curves": "^1.1.0", + "@noble/hashes": "^1.3.1", "@veramo/core-types": "workspace:^", "credential-status": "^2.0.5", "cross-fetch": "^3.1.6", "debug": "^4.3.3", "did-jwt": "^7.2.0", - "did-jwt-vc": "^3.2.1", + "did-jwt-vc": "^3.2.3", "did-resolver": "^4.1.0", "multiformats": "^12.0.0", - "uint8arrays": "^4.0.3" + "uint8arrays": "^4.0.4" }, "devDependencies": { "@types/debug": "4.1.8", - "@types/uuid": "9.0.1" + "@types/uuid": "9.0.2" }, "files": [ "build/**/*", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1259a4741..40f3291ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,7 +25,7 @@ importers: specifier: ^5.7.0 version: 5.7.0 '@jest/globals': - specifier: ^29.5.0 + specifier: 29.5.0 version: 29.5.0 '@metamask/eth-sig-util': specifier: 6.0.0 @@ -42,6 +42,12 @@ importers: '@microsoft/tsdoc': specifier: 0.14.2 version: 0.14.2 + '@noble/hashes': + specifier: 1.3.1 + version: 1.3.1 + '@stablelib/ed25519': + specifier: 1.0.3 + version: 1.0.3 '@transmute/credentials-context': specifier: 0.7.0-unstable.81 version: 0.7.0-unstable.81 @@ -58,11 +64,8 @@ importers: specifier: 20.3.0 version: 20.3.0 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 - blakejs: - specifier: 1.2.1 - version: 1.2.1 + specifier: 9.0.2 + version: 9.0.2 caip: specifier: 1.1.0 version: 1.1.0 @@ -120,9 +123,6 @@ importers: prettier: specifier: 3.0.0 version: 3.0.0 - pretty-quick: - specifier: 3.1.3 - version: 3.1.3(prettier@3.0.0) rimraf: specifier: 5.0.1 version: 5.0.1 @@ -140,13 +140,13 @@ importers: version: 10.9.1(@types/node@20.3.0)(typescript@5.1.3) typeorm: specifier: 0.3.16 - version: 0.3.16(pg@8.8.0)(sqlite3@5.1.4)(ts-node@10.9.1) + version: 0.3.16(ts-node@10.9.1) typescript: specifier: 5.1.3 version: 5.1.3 uint8arrays: - specifier: 4.0.3 - version: 4.0.3 + specifier: 4.0.4 + version: 4.0.4 uuid: specifier: 9.0.0 version: 9.0.0 @@ -157,17 +157,17 @@ importers: packages/cli: dependencies: '@microsoft/api-extractor': - specifier: ^7.35.1 - version: 7.35.1(@types/node@20.3.0) + specifier: ^7.35.2 + version: 7.35.2(@types/node@20.3.0) '@microsoft/api-extractor-model': - specifier: ^7.27.1 - version: 7.27.1(@types/node@20.3.0) + specifier: ^7.27.2 + version: 7.27.2(@types/node@20.3.0) '@transmute/credentials-context': - specifier: ^0.7.0-unstable.79 - version: 0.7.0-unstable.80 + specifier: ^0.7.0-unstable.81 + version: 0.7.0-unstable.81 '@types/blessed': - specifier: ^0.1.19 - version: 0.1.19 + specifier: ^0.1.22 + version: 0.1.22 '@types/swagger-ui-express': specifier: ^4.1.3 version: 4.1.3 @@ -250,7 +250,7 @@ importers: specifier: ^11.0.0 version: 11.0.0 console-table-printer: - specifier: ^2.10.0 + specifier: ^2.11.1 version: 2.11.1 cors: specifier: ^2.8.5 @@ -259,17 +259,17 @@ importers: specifier: ^3.1.6 version: 3.1.6 date-fns: - specifier: ^2.28.0 - version: 2.29.3 + specifier: ^2.30.0 + version: 2.30.0 debug: - specifier: ^4.3.3 + specifier: ^4.3.4 version: 4.3.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 dotenv: - specifier: ^16.0.0 - version: 16.0.3 + specifier: ^16.1.4 + version: 16.1.4 ethr-did-resolver: specifier: ^8.0.0 version: 8.0.0 @@ -277,35 +277,35 @@ importers: specifier: ^4.18.2 version: 4.18.2 express-handlebars: - specifier: ^7.0.0 - version: 7.0.0 + specifier: ^7.0.7 + version: 7.0.7 fuzzy: specifier: ^0.1.3 version: 0.1.3 handlebars: - specifier: ^4.7.6 + specifier: ^4.7.7 version: 4.7.7 inquirer: - specifier: ^9.1.4 - version: 9.1.4 + specifier: ^9.2.7 + version: 9.2.7 inquirer-autocomplete-prompt: specifier: ^3.0.0 - version: 3.0.0(inquirer@9.1.4) + version: 3.0.0(inquirer@9.2.7) json-schema: specifier: ^0.4.0 version: 0.4.0 json5: - specifier: ^2.2.0 + specifier: ^2.2.3 version: 2.2.3 jsonpointer: - specifier: ^5.0.0 + specifier: ^5.0.1 version: 5.0.1 oas-resolver: - specifier: ^2.5.3 + specifier: ^2.5.6 version: 2.5.6 openapi-types: - specifier: ^12.0.2 - version: 12.1.0 + specifier: ^12.1.3 + version: 12.1.3 passport: specifier: ^0.6.0 version: 0.6.0 @@ -313,35 +313,35 @@ importers: specifier: ^1.0.1 version: 1.0.1 pg: - specifier: ^8.7.1 - version: 8.8.0 + specifier: ^8.11.0 + version: 8.11.0 qrcode-terminal: specifier: ^0.12.0 version: 0.12.0 sqlite3: - specifier: ^5.0.8 - version: 5.1.4 + specifier: ^5.1.6 + version: 5.1.6 swagger-ui-express: - specifier: ^4.6.0 - version: 4.6.0(express@4.18.2) + specifier: ^4.6.3 + version: 4.6.3(express@4.18.2) ts-json-schema-generator: specifier: ^1.2.0 version: 1.2.0 typeorm: specifier: ^0.3.10 - version: 0.3.16(pg@8.8.0)(sqlite3@5.1.4)(ts-node@10.9.1) + version: 0.3.16(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) url-parse: - specifier: ^1.5.4 + specifier: ^1.5.10 version: 1.5.10 web-did-resolver: - specifier: ^2.0.21 + specifier: ^2.0.24 version: 2.0.24 ws: - specifier: ^8.11.0 - version: 8.12.0 + specifier: ^8.13.0 + version: 8.13.0 yaml: - specifier: ^2.1.3 - version: 2.2.1 + specifier: ^2.3.1 + version: 2.3.1 devDependencies: '@types/debug': specifier: 4.1.8 @@ -368,8 +368,8 @@ importers: specifier: 1.4.8 version: 1.4.8 '@types/ws': - specifier: 8.5.4 - version: 8.5.4 + specifier: 8.5.5 + version: 8.5.5 typescript: specifier: 5.1.3 version: 5.1.3 @@ -386,8 +386,8 @@ importers: specifier: ^3.2.0 version: 3.3.0 z-schema: - specifier: ^6.0.0 - version: 6.0.0 + specifier: ^6.0.1 + version: 6.0.1 devDependencies: '@types/debug': specifier: 4.1.8 @@ -408,10 +408,10 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt-vc: - specifier: ^3.1.0 - version: 3.2.2 + specifier: ^3.2.3 + version: 3.2.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 devDependencies: '@types/debug': @@ -464,14 +464,14 @@ importers: specifier: ^5.0.0 version: 5.0.0(expo@48.0.19)(react-native@0.71.8) '@transmute/credentials-context': - specifier: ^0.7.0-unstable.79 - version: 0.7.0-unstable.80 + specifier: ^0.7.0-unstable.81 + version: 0.7.0-unstable.81 '@transmute/ed25519-signature-2018': - specifier: ^0.7.0-unstable.79 - version: 0.7.0-unstable.79(expo@48.0.19)(react-native@0.71.8) + specifier: ^0.7.0-unstable.81 + version: 0.7.0-unstable.81(expo@48.0.19)(react-native@0.71.8) '@transmute/json-web-signature': - specifier: ^0.7.0-unstable.79 - version: 0.7.0-unstable.79(expo@48.0.19)(react-native@0.71.8) + specifier: ^0.7.0-unstable.81 + version: 0.7.0-unstable.81(expo@48.0.19)(react-native@0.71.8) '@veramo-community/lds-ecdsa-secp256k1-recovery2020': specifier: uport-project/EcdsaSecp256k1RecoverySignature2020 version: github.com/uport-project/EcdsaSecp256k1RecoverySignature2020/ab0db52de6f4e6663ef271a48009ba26e688ef9b(expo@48.0.19)(react-native@0.71.8) @@ -488,11 +488,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 - uint8arrays: - specifier: ^4.0.3 - version: 4.0.3 devDependencies: '@types/debug': specifier: 4.1.8 @@ -516,10 +513,10 @@ importers: specifier: ^2.0.5 version: 2.0.5 did-jwt: - specifier: ^6.9.0 - version: 6.11.6 + specifier: ^7.2.0 + version: 7.2.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 devDependencies: '@types/debug': @@ -547,17 +544,14 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^6.11.0 - version: 6.11.6 + specifier: ^7.2.0 + version: 7.2.4 did-jwt-vc: - specifier: ^3.1.0 - version: 3.2.2 + specifier: ^3.2.3 + version: 3.2.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 - uint8arrays: - specifier: ^4.0.3 - version: 4.0.3 uuid: specifier: ^9.0.0 version: 9.0.0 @@ -570,8 +564,8 @@ importers: specifier: 4.1.8 version: 4.1.8 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 + specifier: 9.0.2 + version: 9.0.2 typescript: specifier: 5.1.3 version: 5.1.3 @@ -597,11 +591,11 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt-vc: - specifier: ^3.1.0 - version: 3.2.2 + specifier: ^3.2.3 + version: 3.2.4 typeorm: specifier: ^0.3.10 - version: 0.3.16(sqlite3@5.1.6)(ts-node@10.9.1) + version: 0.3.16(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) uuid: specifier: ^9.0.0 version: 9.0.0 @@ -610,8 +604,8 @@ importers: specifier: 4.1.8 version: 4.1.8 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 + specifier: 9.0.2 + version: 9.0.2 sqlite3: specifier: 5.1.6 version: 5.1.6 @@ -622,8 +616,8 @@ importers: packages/data-store-json: dependencies: '@ungap/structured-clone': - specifier: ^1.0.0 - version: 1.0.1 + specifier: ^1.2.0 + version: 1.2.0 '@veramo/core-types': specifier: workspace:^ version: link:../core-types @@ -640,8 +634,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt-vc: - specifier: ^3.1.0 - version: 3.2.2 + specifier: ^3.2.3 + version: 3.2.4 uuid: specifier: ^9.0.0 version: 9.0.0 @@ -653,8 +647,8 @@ importers: specifier: 0.3.0 version: 0.3.0 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 + specifier: 9.0.2 + version: 9.0.2 typescript: specifier: 5.1.3 version: 5.1.3 @@ -664,9 +658,21 @@ importers: '@ethersproject/signing-key': specifier: ^5.7.0 version: 5.7.0 - '@stablelib/ed25519': - specifier: ^1.0.3 - version: 1.0.3 + '@noble/curves': + specifier: ^1.1.0 + version: 1.1.0 + '@stablelib/aes': + specifier: ^1.0.1 + version: 1.0.1 + '@stablelib/aes-kw': + specifier: ^1.0.1 + version: 1.0.1 + '@stablelib/gcm': + specifier: ^1.0.2 + version: 1.0.2 + '@stablelib/xchacha20poly1305': + specifier: ^1.0.1 + version: 1.0.1 '@veramo/core-types': specifier: workspace:^ version: link:../core-types @@ -683,14 +689,14 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^6.9.0 - version: 6.11.6 + specifier: ^7.2.2 + version: 7.2.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 - uint8arrays: - specifier: ^4.0.3 - version: 4.0.3 + isomorphic-webcrypto: + specifier: ^2.3.8 + version: 2.3.8(expo@48.0.19)(react-native@0.71.8) uuid: specifier: ^9.0.0 version: 9.0.0 @@ -699,8 +705,8 @@ importers: specifier: 4.1.8 version: 4.1.8 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 + specifier: 9.0.2 + version: 9.0.2 typescript: specifier: 5.1.3 version: 5.1.3 @@ -733,10 +739,10 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^6.9.0 - version: 6.11.6 + specifier: ^7.2.0 + version: 7.2.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 devDependencies: '@types/debug': @@ -798,8 +804,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 ethr-did: - specifier: ^2.3.6 - version: 2.3.6 + specifier: ^2.3.14 + version: 2.3.14 devDependencies: '@types/debug': specifier: 4.1.8 @@ -819,6 +825,12 @@ importers: '@ethersproject/signing-key': specifier: ^5.7.0 version: 5.7.0 + '@noble/curves': + specifier: ^1.1.0 + version: 1.1.0 + '@noble/hashes': + specifier: ^1.3.1 + version: 1.3.1 '@sphereon/ion-pow': specifier: ^0.2.0 version: 0.2.0(@sphereon/react-native-argon2@2.0.9)(react-native@0.71.8) @@ -828,12 +840,6 @@ importers: '@sphereon/react-native-argon2': specifier: ^2.0.7 version: 2.0.9(react-native@0.71.8) - '@stablelib/ed25519': - specifier: ^1.0.3 - version: 1.0.3 - '@stablelib/sha256': - specifier: ^1.0.1 - version: 1.0.1 '@trust/keyto': specifier: ^1.0.1 version: 1.0.1 @@ -862,14 +868,11 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 multihashes: specifier: ^4.0.3 version: 4.0.3 - uint8arrays: - specifier: ^4.0.3 - version: 4.0.3 devDependencies: '@types/debug': specifier: 4.1.8 @@ -880,6 +883,9 @@ importers: packages/did-provider-jwk: dependencies: + '@noble/curves': + specifier: ^1.1.0 + version: 1.1.0 '@veramo/core-types': specifier: workspace:^ version: link:../core-types @@ -893,18 +899,12 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 - elliptic: - specifier: ^6.5.4 - version: 6.5.4 devDependencies: '@types/debug': specifier: 4.1.8 version: 4.1.8 - '@types/elliptic': - specifier: 6.4.14 - version: 6.4.14 '@veramo/core': specifier: workspace:* version: link:../core @@ -1019,7 +1019,7 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 devDependencies: '@types/debug': @@ -1063,20 +1063,20 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 devDependencies: '@types/debug': specifier: 4.1.8 version: 4.1.8 ethr-did-resolver: - specifier: ^8.0.0 + specifier: 8.0.0 version: 8.0.0 typescript: specifier: 5.1.3 version: 5.1.3 web-did-resolver: - specifier: ^2.0.24 + specifier: 2.0.24 version: 2.0.24 packages/key-manager: @@ -1090,9 +1090,9 @@ importers: '@ethersproject/transactions': specifier: ^5.7.0 version: 5.7.0 - '@stablelib/ed25519': - specifier: ^1.0.3 - version: 1.0.3 + '@noble/curves': + specifier: ^1.1.0 + version: 1.1.0 '@veramo/core-types': specifier: workspace:^ version: link:../core-types @@ -1103,11 +1103,11 @@ importers: specifier: ^4.3.4 version: 4.3.4 did-jwt: - specifier: ^7.2.1 - version: 7.2.1 + specifier: ^7.2.2 + version: 7.2.4 uint8arrays: - specifier: ^4.0.3 - version: 4.0.3 + specifier: ^4.0.4 + version: 4.0.4 uuid: specifier: ^9.0.0 version: 9.0.0 @@ -1119,8 +1119,8 @@ importers: specifier: 4.1.8 version: 4.1.8 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 + specifier: 9.0.2 + version: 9.0.2 typescript: specifier: 5.1.3 version: 5.1.3 @@ -1148,18 +1148,15 @@ importers: '@ethersproject/wallet': specifier: ^5.7.0 version: 5.7.0 - '@stablelib/ed25519': - specifier: ^1.0.3 - version: 1.0.3 + '@noble/curves': + specifier: ^1.1.0 + version: 1.1.0 '@stablelib/nacl': specifier: ^1.0.4 version: 1.0.4 '@stablelib/random': specifier: ^1.0.2 version: 1.0.2 - '@stablelib/x25519': - specifier: ^1.0.3 - version: 1.0.3 '@veramo/core-types': specifier: workspace:^ version: link:../core-types @@ -1169,28 +1166,16 @@ importers: '@veramo/utils': specifier: workspace:^ version: link:../utils - base-58: - specifier: ^0.0.1 - version: 0.0.1 debug: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^6.9.0 - version: 6.11.6 - elliptic: - specifier: ^6.5.4 - version: 6.5.4 - uint8arrays: - specifier: ^4.0.3 - version: 4.0.3 + specifier: ^7.2.0 + version: 7.2.4 devDependencies: '@types/debug': specifier: 4.1.8 version: 4.1.8 - '@types/elliptic': - specifier: 6.4.14 - version: 6.4.14 typescript: specifier: 5.1.3 version: 5.1.3 @@ -1242,10 +1227,10 @@ importers: version: 3.0.1 typeorm: specifier: ^0.3.10 - version: 0.3.16(pg@8.8.0)(sqlite3@5.1.4)(ts-node@10.9.1) + version: 0.3.16(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) uint8arrays: - specifier: ^3.1.1 - version: 3.1.1 + specifier: ^4.0.4 + version: 4.0.4 devDependencies: '@keyv/compress-brotli': specifier: 1.1.3 @@ -1315,8 +1300,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 openapi-types: - specifier: 12.1.0 - version: 12.1.0 + specifier: 12.1.3 + version: 12.1.3 devDependencies: '@types/debug': specifier: 4.1.8 @@ -1340,7 +1325,7 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 express: specifier: ^4.18.2 @@ -1389,8 +1374,8 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^6.9.0 - version: 6.11.6 + specifier: ^7.2.0 + version: 7.2.4 uuid: specifier: ^9.0.0 version: 9.0.0 @@ -1399,8 +1384,8 @@ importers: specifier: 4.1.8 version: 4.1.8 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 + specifier: 9.0.2 + version: 9.0.2 typescript: specifier: 5.1.3 version: 5.1.3 @@ -1505,7 +1490,7 @@ importers: version: /stream-browserify@3.0.0 typeorm: specifier: ^0.3.10 - version: 0.3.16(pg@8.8.0)(sqlite3@5.1.4)(ts-node@10.9.1) + version: 0.3.16(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1) util: specifier: npm:util version: 0.12.5 @@ -1513,15 +1498,15 @@ importers: specifier: ^2.0.24 version: 2.0.24 web-vitals: - specifier: ^3.3.1 - version: 3.3.1 + specifier: ^3.3.2 + version: 3.3.2 devDependencies: '@babel/plugin-syntax-import-assertions': - specifier: 7.20.0 - version: 7.20.0(@babel/core@7.22.5) + specifier: 7.22.5 + version: 7.22.5(@babel/core@7.22.5) '@babel/preset-typescript': - specifier: 7.21.5 - version: 7.21.5(@babel/core@7.22.5) + specifier: 7.22.5 + version: 7.22.5(@babel/core@7.22.5) '@craco/craco': specifier: 7.1.0 version: 7.1.0(@types/node@20.3.0)(postcss@8.4.24)(react-scripts@5.0.1)(typescript@5.1.3) @@ -1544,16 +1529,16 @@ importers: specifier: 20.3.0 version: 20.3.0 '@types/react': - specifier: 18.2.8 - version: 18.2.8 + specifier: 18.2.11 + version: 18.2.11 '@types/react-dom': specifier: 18.2.4 version: 18.2.4 babel-jest: - specifier: ^29.5.0 + specifier: 29.5.0 version: 29.5.0(@babel/core@7.22.5) babel-preset-react-app: - specifier: ^10.0.1 + specifier: 10.0.1 version: 10.0.1 cross-env: specifier: 7.0.3 @@ -1604,7 +1589,7 @@ importers: specifier: workspace:* version: link:../utils did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 devDependencies: typescript: @@ -1650,15 +1635,15 @@ importers: '@ethersproject/transactions': specifier: ^5.7.0 version: 5.7.0 - '@stablelib/ed25519': - specifier: ^1.0.3 - version: 1.0.3 + '@noble/curves': + specifier: ^1.1.0 + version: 1.1.0 + '@noble/hashes': + specifier: ^1.3.1 + version: 1.3.1 '@veramo/core-types': specifier: workspace:^ version: link:../core-types - blakejs: - specifier: ^1.1.1 - version: 1.2.1 credential-status: specifier: ^2.0.5 version: 2.0.5 @@ -1669,33 +1654,27 @@ importers: specifier: ^4.3.3 version: 4.3.4 did-jwt: - specifier: ^6.9.0 - version: 6.11.6 + specifier: ^7.2.0 + version: 7.2.4 did-jwt-vc: - specifier: ^3.1.0 - version: 3.2.2 + specifier: ^3.2.3 + version: 3.2.4 did-resolver: - specifier: ^4.0.1 + specifier: ^4.1.0 version: 4.1.0 - elliptic: - specifier: ^6.5.4 - version: 6.5.4 multiformats: specifier: ^12.0.0 version: 12.0.0 uint8arrays: - specifier: ^4.0.3 - version: 4.0.3 + specifier: ^4.0.4 + version: 4.0.4 devDependencies: '@types/debug': specifier: 4.1.8 version: 4.1.8 - '@types/elliptic': - specifier: 6.4.14 - version: 6.4.14 '@types/uuid': - specifier: 9.0.1 - version: 9.0.1 + specifier: 9.0.2 + version: 9.0.2 packages: @@ -1750,6 +1729,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.18.6 + dev: true /@babel/code-frame@7.22.5: resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} @@ -1760,6 +1740,7 @@ packages: /@babel/compat-data@7.20.10: resolution: {integrity: sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg==} engines: {node: '>=6.9.0'} + dev: true /@babel/compat-data@7.22.5: resolution: {integrity: sha512-4Jc/YuIaYqKnDDz892kPIledykKg12Aw1PYX5i/TY28anJtacvM1Rrr8wbieB9GfEJwlzqT0hUEao0CxEebiDA==} @@ -1810,14 +1791,14 @@ packages: transitivePeerDependencies: - supports-color - /@babel/eslint-parser@7.19.1(@babel/core@7.20.12)(eslint@8.42.0): + /@babel/eslint-parser@7.19.1(@babel/core@7.22.5)(eslint@8.42.0): resolution: {integrity: sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/core': '>=7.11.0' eslint: ^7.5.0 || ^8.0.0 dependencies: - '@babel/core': 7.20.12 + '@babel/core': 7.22.5 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 eslint: 8.42.0 eslint-visitor-keys: 2.1.0 @@ -1837,10 +1818,11 @@ packages: resolution: {integrity: sha512-C17MW4wlk//ES/CJDL51kPNwl+qiBQyN7b9SKyVp11BLGFeSPoVaHrv+MNt8jwQFhQWowW88z1eeBx3pFz9v8A==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.17 jsesc: 2.5.2 + dev: true /@babel/generator@7.22.5: resolution: {integrity: sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==} @@ -1851,12 +1833,6 @@ packages: '@jridgewell/trace-mapping': 0.3.18 jsesc: 2.5.2 - /@babel/helper-annotate-as-pure@7.18.6: - resolution: {integrity: sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.4 - /@babel/helper-annotate-as-pure@7.22.5: resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} @@ -1868,7 +1844,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-explode-assignable-expression': 7.18.6 - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 /@babel/helper-compilation-targets@7.20.7(@babel/core@7.20.12): resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} @@ -1878,26 +1854,12 @@ packages: dependencies: '@babel/compat-data': 7.20.10 '@babel/core': 7.20.12 - '@babel/helper-validator-option': 7.21.0 + '@babel/helper-validator-option': 7.22.5 browserslist: 4.21.4 lru-cache: 5.1.1 semver: 6.3.0 dev: true - /@babel/helper-compilation-targets@7.20.7(@babel/core@7.22.5): - resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/compat-data': 7.20.10 - '@babel/core': 7.22.5 - '@babel/helper-validator-option': 7.21.0 - browserslist: 4.21.4 - lru-cache: 5.1.1 - semver: 6.3.0 - dev: false - /@babel/helper-compilation-targets@7.22.5(@babel/core@7.22.5): resolution: {integrity: sha512-Ji+ywpHeuqxB8WDxraCiqR0xfhYjiDE/e6k7FuIaANnoOFxAHskHChz4vA1mJC9Lbm01s1PVAGhQY4FUKSkGZw==} engines: {node: '>=6.9.0'} @@ -1911,64 +1873,6 @@ packages: lru-cache: 5.1.1 semver: 6.3.0 - /@babel/helper-create-class-features-plugin@7.20.12(@babel/core@7.20.12): - resolution: {integrity: sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.19.0 - '@babel/helper-member-expression-to-functions': 7.20.7 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.20.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/helper-split-export-declaration': 7.18.6 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/helper-create-class-features-plugin@7.20.12(@babel/core@7.22.5): - resolution: {integrity: sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.22.5 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.19.0 - '@babel/helper-member-expression-to-functions': 7.20.7 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.20.7 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/helper-split-export-declaration': 7.18.6 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/helper-create-class-features-plugin@7.22.1(@babel/core@7.20.12): - resolution: {integrity: sha512-SowrZ9BWzYFgzUMwUmowbPSGu6CXL5MSuuCkG3bejahSpSymioPmuLdhPxNOc9MjuNGjy7M/HaXvJ8G82Lywlw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-function-name': 7.21.0 - '@babel/helper-member-expression-to-functions': 7.22.3 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-replace-supers': 7.22.1 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/helper-split-export-declaration': 7.18.6 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/helper-create-class-features-plugin@7.22.1(@babel/core@7.22.5): resolution: {integrity: sha512-SowrZ9BWzYFgzUMwUmowbPSGu6CXL5MSuuCkG3bejahSpSymioPmuLdhPxNOc9MjuNGjy7M/HaXvJ8G82Lywlw==} engines: {node: '>=6.9.0'} @@ -1976,39 +1880,34 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-function-name': 7.21.0 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-function-name': 7.22.5 '@babel/helper-member-expression-to-functions': 7.22.3 '@babel/helper-optimise-call-expression': 7.18.6 '@babel/helper-replace-supers': 7.22.1 '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-split-export-declaration': 7.22.5 semver: 6.3.0 transitivePeerDependencies: - supports-color - /@babel/helper-create-regexp-features-plugin@7.20.5(@babel/core@7.20.12): - resolution: {integrity: sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - regexpu-core: 5.2.2 - dev: true - - /@babel/helper-create-regexp-features-plugin@7.20.5(@babel/core@7.22.5): - resolution: {integrity: sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w==} + /@babel/helper-create-class-features-plugin@7.22.9(@babel/core@7.22.5): + resolution: {integrity: sha512-Pwyi89uO4YrGKxL/eNJ8lfEH55DnRloGPOseaA8NFNL6jAUnn+KccaISiFazCj5IolPPDjGSdzQzXVzODVRqUQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-annotate-as-pure': 7.18.6 - regexpu-core: 5.2.2 - dev: false + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-function-name': 7.22.5 + '@babel/helper-member-expression-to-functions': 7.22.5 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.22.9(@babel/core@7.22.5) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 /@babel/helper-create-regexp-features-plugin@7.22.1(@babel/core@7.22.5): resolution: {integrity: sha512-WWjdnfR3LPIe+0EY8td7WmjhytxXtjKAEpnAxun/hkNiyOaPlvGK+NZaBFIdi9ndYV3Gav7BpFvtUwnaJlwi1w==} @@ -2020,23 +1919,6 @@ packages: '@babel/helper-annotate-as-pure': 7.22.5 regexpu-core: 5.3.2 semver: 6.3.0 - dev: false - - /@babel/helper-define-polyfill-provider@0.3.3(@babel/core@7.20.12): - resolution: {integrity: sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww==} - peerDependencies: - '@babel/core': ^7.4.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - debug: 4.3.4 - lodash.debounce: 4.0.8 - resolve: 1.22.2 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true /@babel/helper-define-polyfill-provider@0.4.0(@babel/core@7.22.5): resolution: {integrity: sha512-RnanLx5ETe6aybRi1cO/edaRH+bNYWaryCEmjDDYyNr4wnSzyOp8T0dWipmqVHKEY3AbVKUom50AKSlj1zmKbg==} @@ -2052,15 +1934,16 @@ packages: semver: 6.3.0 transitivePeerDependencies: - supports-color - dev: false /@babel/helper-environment-visitor@7.18.9: resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} engines: {node: '>=6.9.0'} + dev: true /@babel/helper-environment-visitor@7.22.1: resolution: {integrity: sha512-Z2tgopurB/kTbidvzeBrc2To3PUP/9i5MUe+fU6QJCQDyPwSH2oRapkLw3KGECDYSjhQZCNxEvNvZlLw8JjGwA==} engines: {node: '>=6.9.0'} + dev: true /@babel/helper-environment-visitor@7.22.5: resolution: {integrity: sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==} @@ -2070,21 +1953,23 @@ packages: resolution: {integrity: sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 /@babel/helper-function-name@7.19.0: resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.21.9 - '@babel/types': 7.22.4 + '@babel/template': 7.22.5 + '@babel/types': 7.22.5 + dev: true /@babel/helper-function-name@7.21.0: resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.21.9 - '@babel/types': 7.22.4 + '@babel/template': 7.22.5 + '@babel/types': 7.22.5 + dev: true /@babel/helper-function-name@7.22.5: resolution: {integrity: sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==} @@ -2097,7 +1982,8 @@ packages: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 + dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} @@ -2105,29 +1991,17 @@ packages: dependencies: '@babel/types': 7.22.5 - /@babel/helper-member-expression-to-functions@7.20.7: - resolution: {integrity: sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.4 - /@babel/helper-member-expression-to-functions@7.22.3: resolution: {integrity: sha512-Gl7sK04b/2WOb6OPVeNy9eFKeD3L6++CzL3ykPOWqTn08xgYYK0wz4TUh2feIImDXxcVW3/9WQ1NMKY66/jfZA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 - - /@babel/helper-module-imports@7.18.6: - resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 - /@babel/helper-module-imports@7.21.4: - resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} + /@babel/helper-member-expression-to-functions@7.22.5: + resolution: {integrity: sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 /@babel/helper-module-imports@7.22.5: resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==} @@ -2140,34 +2014,19 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-simple-access': 7.21.5 - '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-module-imports': 7.22.5 + '@babel/helper-simple-access': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.5 '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.20.7 - '@babel/traverse': 7.20.12 - '@babel/types': 7.20.7 + '@babel/template': 7.22.5 + '@babel/traverse': 7.22.5 + '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color dev: true - /@babel/helper-module-transforms@7.22.1: - resolution: {integrity: sha512-dxAe9E7ySDGbQdCVOY/4+UcD8M9ZFqZcZhSPsPacvCG4M+9lwtDDQfI2EoaSvmf7W/8yCBkGU0m7Pvt1ru3UZw==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-module-imports': 7.21.4 - '@babel/helper-simple-access': 7.21.5 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.4 - '@babel/types': 7.22.4 - transitivePeerDependencies: - - supports-color - - /@babel/helper-module-transforms@7.22.5: - resolution: {integrity: sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==} + /@babel/helper-module-transforms@7.22.5: + resolution: {integrity: sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.22.5 @@ -2185,35 +2044,18 @@ packages: resolution: {integrity: sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 - - /@babel/helper-plugin-utils@7.20.2: - resolution: {integrity: sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==} - engines: {node: '>=6.9.0'} + '@babel/types': 7.22.5 - /@babel/helper-plugin-utils@7.21.5: - resolution: {integrity: sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==} + /@babel/helper-optimise-call-expression@7.22.5: + resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 /@babel/helper-plugin-utils@7.22.5: resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} - /@babel/helper-remap-async-to-generator@7.18.9(@babel/core@7.20.12): - resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.22.1 - '@babel/helper-wrap-function': 7.20.5 - '@babel/types': 7.22.4 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/helper-remap-async-to-generator@7.18.9(@babel/core@7.22.5): resolution: {integrity: sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA==} engines: {node: '>=6.9.0'} @@ -2221,24 +2063,10 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-environment-visitor': 7.22.1 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-wrap-function': 7.20.5 - '@babel/types': 7.22.4 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/helper-replace-supers@7.20.7: - resolution: {integrity: sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-member-expression-to-functions': 7.20.7 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.4 - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color @@ -2246,20 +2074,25 @@ packages: resolution: {integrity: sha512-ut4qrkE4AuSfrwHSps51ekR1ZY/ygrP1tp0WFm8oVq6nzc/hvfV/22JylndIbsf2U2M9LOMwiSddr6y+78j+OQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-environment-visitor': 7.22.1 + '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-member-expression-to-functions': 7.22.3 '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.4 - '@babel/types': 7.22.4 + '@babel/template': 7.22.5 + '@babel/traverse': 7.22.5 + '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color - /@babel/helper-simple-access@7.21.5: - resolution: {integrity: sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==} + /@babel/helper-replace-supers@7.22.9(@babel/core@7.22.5): + resolution: {integrity: sha512-LJIKvvpgPOPUThdYqcX6IXRuIcTkcAub0IaDRGCZH0p5GPUp7PhRU9QVgFcDDd51BaPkk77ZjqFwh6DZTAEmGg==} engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 dependencies: - '@babel/types': 7.22.4 + '@babel/core': 7.22.5 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-member-expression-to-functions': 7.22.5 + '@babel/helper-optimise-call-expression': 7.22.5 /@babel/helper-simple-access@7.22.5: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} @@ -2271,13 +2104,20 @@ packages: resolution: {integrity: sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 + + /@babel/helper-skip-transparent-expression-wrappers@7.22.5: + resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 /@babel/helper-split-export-declaration@7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.22.4 + dev: true /@babel/helper-split-export-declaration@7.22.5: resolution: {integrity: sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==} @@ -2285,6 +2125,12 @@ packages: dependencies: '@babel/types': 7.22.5 + /@babel/helper-split-export-declaration@7.22.6: + resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.22.5 + /@babel/helper-string-parser@7.19.4: resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} engines: {node: '>=6.9.0'} @@ -2293,6 +2139,7 @@ packages: /@babel/helper-string-parser@7.21.5: resolution: {integrity: sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==} engines: {node: '>=6.9.0'} + dev: true /@babel/helper-string-parser@7.22.5: resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} @@ -2306,10 +2153,6 @@ packages: resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} engines: {node: '>=6.9.0'} - /@babel/helper-validator-option@7.21.0: - resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} - engines: {node: '>=6.9.0'} - /@babel/helper-validator-option@7.22.5: resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} @@ -2318,10 +2161,10 @@ packages: resolution: {integrity: sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-function-name': 7.21.0 - '@babel/template': 7.21.9 - '@babel/traverse': 7.22.4 - '@babel/types': 7.22.4 + '@babel/helper-function-name': 7.22.5 + '@babel/template': 7.22.5 + '@babel/traverse': 7.22.5 + '@babel/types': 7.22.5 transitivePeerDependencies: - supports-color @@ -2376,6 +2219,7 @@ packages: hasBin: true dependencies: '@babel/types': 7.22.4 + dev: true /@babel/parser@7.22.5: resolution: {integrity: sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==} @@ -2384,16 +2228,6 @@ packages: dependencies: '@babel/types': 7.22.5 - /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true - /@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==} engines: {node: '>=6.9.0'} @@ -2401,20 +2235,7 @@ packages: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.13.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/plugin-proposal-optional-chaining': 7.20.7(@babel/core@7.20.12) - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-6r4yRwEnorYByILoDRnEqxtojYKuiIv9FojW2E8GUKo9eWBwbKcd9IiZOZpdyXc64RmyGGyPu3/uAcrz/dq2kQ==} @@ -2426,22 +2247,6 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 '@babel/plugin-transform-optional-chaining': 7.22.3(@babel/core@7.22.5) - dev: false - - /@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-remap-async-to-generator': 7.18.9(@babel/core@7.20.12) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.20.12) - transitivePeerDependencies: - - supports-color - dev: true /@babel/plugin-proposal-async-generator-functions@7.20.7(@babel/core@7.22.5): resolution: {integrity: sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA==} @@ -2450,27 +2255,14 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-environment-visitor': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-remap-async-to-generator': 7.18.9(@babel/core@7.22.5) '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.5) transitivePeerDependencies: - supports-color dev: false - /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-class-features-plugin': 7.20.12(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color - dev: true - /@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} @@ -2478,41 +2270,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.20.12(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/plugin-proposal-class-static-block@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.12.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.20.12) - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/plugin-proposal-decorators@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-JB45hbUweYpwAGjkiM7uCyXMENH2lG+9r3G2E+ttc2PRXAoEkpfd/KW5jDg4j8RS6tLtTG1jZi9LbHZVSfs1/A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-class-features-plugin': 7.20.12(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-replace-supers': 7.20.7 - '@babel/helper-split-export-declaration': 7.18.6 - '@babel/plugin-syntax-decorators': 7.19.0(@babel/core@7.20.12) + '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 transitivePeerDependencies: - supports-color - dev: true /@babel/plugin-proposal-decorators@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-XjTKH3sHr6pPqG+hR1NCdVupwiosfdKM2oSMyKQVQ5Bym9l/p7BuLAqT5U32zZzRCfPq/TPRPzMiiTE9bOXU4w==} @@ -2528,19 +2289,6 @@ packages: '@babel/plugin-syntax-decorators': 7.22.3(@babel/core@7.22.5) transitivePeerDependencies: - supports-color - dev: false - optional: true - - /@babel/plugin-proposal-dynamic-import@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.20.12) - dev: true /@babel/plugin-proposal-export-default-from@7.18.10(@babel/core@7.22.5): resolution: {integrity: sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow==} @@ -2553,50 +2301,6 @@ packages: '@babel/plugin-syntax-export-default-from': 7.18.6(@babel/core@7.22.5) dev: false - /@babel/plugin-proposal-export-namespace-from@7.18.9(@babel/core@7.20.12): - resolution: {integrity: sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.20.12) - dev: true - - /@babel/plugin-proposal-json-strings@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.20.12) - dev: true - - /@babel/plugin-proposal-logical-assignment-operators@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.20.12) - dev: true - - /@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.20.12) - dev: true - /@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} engines: {node: '>=6.9.0'} @@ -2604,33 +2308,18 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.5) - dev: false - /@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.20.12): + /@babel/plugin-proposal-numeric-separator@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.20.12) - dev: true - - /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/compat-data': 7.20.10 - '@babel/core': 7.20.12 - '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-transform-parameters': 7.20.7(@babel/core@7.20.12) + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.5) dev: true /@babel/plugin-proposal-object-rest-spread@7.20.7(@babel/core@7.22.5): @@ -2639,25 +2328,14 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/compat-data': 7.20.10 + '@babel/compat-data': 7.22.5 '@babel/core': 7.22.5 - '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-transform-parameters': 7.20.7(@babel/core@7.22.5) + '@babel/plugin-transform-parameters': 7.22.3(@babel/core@7.22.5) dev: false - /@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.20.12) - dev: true - /@babel/plugin-proposal-optional-catch-binding@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw==} engines: {node: '>=6.9.0'} @@ -2665,22 +2343,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.5) dev: false - /@babel/plugin-proposal-optional-chaining@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.20.12) - dev: true - /@babel/plugin-proposal-optional-chaining@7.21.0(@babel/core@7.22.5): resolution: {integrity: sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==} engines: {node: '>=6.9.0'} @@ -2691,32 +2357,16 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.5) - dev: false - /@babel/plugin-proposal-private-methods@7.18.6(@babel/core@7.20.12): + /@babel/plugin-proposal-private-methods@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-class-features-plugin': 7.20.12(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color - dev: true - - /@babel/plugin-proposal-private-property-in-object@7.20.5(@babel/core@7.20.12): - resolution: {integrity: sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-create-class-features-plugin': 7.20.12(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.20.12) + '@babel/core': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 transitivePeerDependencies: - supports-color dev: true @@ -2734,18 +2384,6 @@ packages: '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.5) transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-proposal-unicode-property-regex@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} - engines: {node: '>=4'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-regexp-features-plugin': 7.20.5(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-proposal-unicode-property-regex@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w==} @@ -2754,9 +2392,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-regexp-features-plugin': 7.20.5(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.20.12): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} @@ -2764,7 +2401,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.5): @@ -2773,7 +2410,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.20.12): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} @@ -2781,7 +2418,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.5): @@ -2790,7 +2427,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.20.12): @@ -2799,7 +2436,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.5): @@ -2808,17 +2445,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - - /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.20.12): - resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.22.5): resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} @@ -2827,18 +2454,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-syntax-decorators@7.19.0(@babel/core@7.20.12): - resolution: {integrity: sha512-xaBZUEDntt4faL1yN8oIFlhfXeQAWJW7CLKYsHTUqriCUbj8xOra8bfxxKGi/UwExPFBuPdH4XfHc9rGQhrVkQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-decorators@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-R16Zuge73+8/nLcDjkIpyhi5wIbN7i7fiuLJR8yQX7vPAa/ltUKtd3iLbb4AgP5nrLi91HnNUNosELIGUGH1bg==} @@ -2848,17 +2464,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false - optional: true - - /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.20.12): - resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.22.5): resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} @@ -2866,8 +2471,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-export-default-from@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-Kr//z3ujSVNx6E9z9ih5xXXMqK07VVTuqPmqGe6Mss/zW5XPeLZeSDZoP9ab/hT4wPKqAgjl2PnhPrcpk8Seew==} @@ -2879,33 +2483,13 @@ packages: '@babel/helper-plugin-utils': 7.22.5 dev: false - /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.20.12): - resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true - /@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.22.5): resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-syntax-flow@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-flow@7.22.5(@babel/core@7.22.5): resolution: {integrity: sha512-9RdCl0i+q0QExayk2nOS7853w08yLucnnPML6EN9S8fgMPVtdLDCdx/cOQ/i44Lb9UeQX9A35yaqBBOMMZxPxQ==} @@ -2916,24 +2500,14 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-syntax-import-assertions@7.20.0(@babel/core@7.20.12): - resolution: {integrity: sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.20.2 - dev: true - - /@babel/plugin-syntax-import-assertions@7.20.0(@babel/core@7.22.5): - resolution: {integrity: sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==} + /@babel/plugin-syntax-import-assertions@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-import-attributes@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-i35jZJv6aO7hxEbIWQ41adVfOzjm9dcYDNeWlBMd8p0ZQRtNUCBrmGwZt+H5lb+oOC9a3svp956KP0oWGA1YsA==} @@ -2943,7 +2517,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.20.12): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} @@ -2951,7 +2524,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.5): @@ -2960,7 +2533,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.20.12): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} @@ -2968,7 +2541,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.5): @@ -2977,7 +2550,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-jsx@7.18.6(@babel/core@7.20.12): resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} @@ -2986,28 +2559,9 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true - - /@babel/plugin-syntax-jsx@7.21.4(@babel/core@7.20.12): - resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-jsx@7.21.4(@babel/core@7.22.5): - resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.5): resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} engines: {node: '>=6.9.0'} @@ -3023,7 +2577,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.5): @@ -3032,7 +2586,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.20.12): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} @@ -3040,7 +2594,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.5): @@ -3049,7 +2603,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.20.12): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} @@ -3057,7 +2611,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.5): @@ -3066,7 +2620,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.20.12): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} @@ -3074,7 +2628,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.5): @@ -3083,7 +2637,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.20.12): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} @@ -3091,7 +2645,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.5): @@ -3100,7 +2654,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.20.12): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} @@ -3108,7 +2662,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.5): @@ -3117,17 +2671,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - - /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.20.12): - resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.22.5): resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} @@ -3136,8 +2680,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.20.12): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} @@ -3146,7 +2689,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.5): @@ -3156,7 +2699,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-typescript@7.20.0(@babel/core@7.20.12): resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==} @@ -3165,27 +2708,26 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.20.12): + /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.22.5): resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.22.5): - resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} @@ -3196,17 +2738,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-transform-arrow-functions@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-arrow-functions@7.21.5(@babel/core@7.22.5): resolution: {integrity: sha512-wb1mhwGOCaXHDTcsRYMKF9e5bbMgqwxtqa2Y1ifH96dXJPwbuLX9qHy3clhrxVqgMz7nyNXs8VkxdH8UBcjKqA==} @@ -3216,7 +2747,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false /@babel/plugin-transform-async-generator-functions@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-36A4Aq48t66btydbZd5Fk0/xJqbpg/v4QWI4AH4cYHBXy9Mu42UOupZpebKFiCFNT9S9rJFcsld0gsv0ayLjtA==} @@ -3231,21 +2761,6 @@ packages: '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.5) transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-transform-async-to-generator@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-remap-async-to-generator': 7.18.9(@babel/core@7.20.12) - transitivePeerDependencies: - - supports-color - dev: true /@babel/plugin-transform-async-to-generator@7.20.7(@babel/core@7.22.5): resolution: {integrity: sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q==} @@ -3254,22 +2769,11 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-module-imports': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-remap-async-to-generator': 7.18.9(@babel/core@7.22.5) transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-transform-block-scoped-functions@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-block-scoped-functions@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ==} @@ -3278,18 +2782,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-block-scoping@7.20.11(@babel/core@7.20.12): - resolution: {integrity: sha512-tA4N427a7fjf1P0/2I4ScsHGc5jcHPbb30xMbaTke2gxDuWpUfXDuX1FEymJwKk4tuGUvGcejAR6HdZVqmmPyw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-block-scoping@7.21.0(@babel/core@7.22.5): resolution: {integrity: sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ==} @@ -3299,7 +2792,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false /@babel/plugin-transform-class-properties@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-mASLsd6rhOrLZ5F3WbCxkzl67mmOnqik0zrg5W6D/X0QMW7HtvnoL1dRARLKIbMP3vXwkwziuLesPqWVGIl6Bw==} @@ -3312,41 +2804,19 @@ packages: '@babel/helper-plugin-utils': 7.22.5 transitivePeerDependencies: - supports-color - dev: false /@babel/plugin-transform-class-static-block@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-5BirgNWNOx7cwbTJCOmKFJ1pZjwk5MUfMIwiBBvsirCJMZeQgs5pk6i1OlkVg+1Vef5LfBahFOrdCnAWvkVKMw==} engines: {node: '>=6.9.0'} peerDependencies: - '@babel/core': ^7.12.0 - dependencies: - '@babel/core': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.22.5 - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.5) - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/plugin-transform-classes@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 + '@babel/core': ^7.12.0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.20.12) - '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.19.0 - '@babel/helper-optimise-call-expression': 7.18.6 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-replace-supers': 7.20.7 - '@babel/helper-split-export-declaration': 7.18.6 - globals: 11.12.0 + '@babel/core': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.5) transitivePeerDependencies: - supports-color - dev: true /@babel/plugin-transform-classes@7.21.0(@babel/core@7.22.5): resolution: {integrity: sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ==} @@ -3366,18 +2836,6 @@ packages: globals: 11.12.0 transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-transform-computed-properties@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/template': 7.21.9 - dev: true /@babel/plugin-transform-computed-properties@7.21.5(@babel/core@7.22.5): resolution: {integrity: sha512-TR653Ki3pAwxBxUe8srfF3e4Pe3FTA46uaNHYyQwIoM4oWKSoOZiDNyHJ0oIoDIUPSRQbQG7jzgVBX3FPVne1Q==} @@ -3388,17 +2846,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/template': 7.22.5 - dev: false - - /@babel/plugin-transform-destructuring@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-destructuring@7.21.3(@babel/core@7.22.5): resolution: {integrity: sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA==} @@ -3408,18 +2855,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-transform-dotall-regex@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-regexp-features-plugin': 7.20.5(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-dotall-regex@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg==} @@ -3428,19 +2863,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-regexp-features-plugin': 7.20.5(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-duplicate-keys@7.18.9(@babel/core@7.20.12): - resolution: {integrity: sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-duplicate-keys@7.18.9(@babel/core@7.22.5): resolution: {integrity: sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw==} @@ -3449,8 +2873,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-dynamic-import@7.22.1(@babel/core@7.22.5): resolution: {integrity: sha512-rlhWtONnVBPdmt+jeewS0qSnMz/3yLFrqAP8hHC6EDcrYRSyuz9f9yQhHvVn2Ad6+yO9fHXac5piudeYrInxwQ==} @@ -3461,18 +2884,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.22.5) - dev: false - - /@babel/plugin-transform-exponentiation-operator@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-builder-binary-assignment-operator-visitor': 7.18.9 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-exponentiation-operator@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw==} @@ -3482,8 +2893,7 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-builder-binary-assignment-operator-visitor': 7.18.9 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-export-namespace-from@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-5Ti1cHLTDnt3vX61P9KZ5IG09bFXp4cDVFJIAeCZuxu9OXXJJZp5iP0n/rzM2+iAutJY+KWEyyHcRaHlpQ/P5g==} @@ -3494,18 +2904,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.22.5) - dev: false - - /@babel/plugin-transform-flow-strip-types@7.19.0(@babel/core@7.20.12): - resolution: {integrity: sha512-sgeMlNaQVbCSpgLSKP4ZZKfsJVnFnNQlUSk6gPYzR/q7tzCgQF2t8RBKAP6cKJeZdveei7Q7Jm527xepI8lNLg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-flow': 7.18.6(@babel/core@7.20.12) - dev: true /@babel/plugin-transform-flow-strip-types@7.21.0(@babel/core@7.22.5): resolution: {integrity: sha512-FlFA2Mj87a6sDkW4gfGrQQqwY/dLlBAyJa2dJEZ+FHXUVHBflO2wyKvg+OOEzXfrKYIa4HWl0mgmbCzt0cMb7w==} @@ -3516,17 +2914,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-flow': 7.22.5(@babel/core@7.22.5) - dev: false - - /@babel/plugin-transform-for-of@7.18.8(@babel/core@7.20.12): - resolution: {integrity: sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-for-of@7.21.5(@babel/core@7.22.5): resolution: {integrity: sha512-nYWpjKW/7j/I/mZkGVgHJXh4bA1sfdFnJoOXwJuj4m3Q2EraO/8ZyrkCau9P5tbHQk01RMSt6KYLCsW7730SXQ==} @@ -3536,19 +2923,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-transform-function-name@7.18.9(@babel/core@7.20.12): - resolution: {integrity: sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.20.12) - '@babel/helper-function-name': 7.19.0 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-function-name@7.18.9(@babel/core@7.22.5): resolution: {integrity: sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ==} @@ -3557,10 +2931,9 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.22.5) - '@babel/helper-function-name': 7.19.0 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-compilation-targets': 7.22.5(@babel/core@7.22.5) + '@babel/helper-function-name': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-json-strings@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-IuvOMdeOOY2X4hRNAT6kwbePtK21BUyrAEgLKviL8pL6AEEVUVcqtRdN/HJXBLGIbt9T3ETmXRnFedRRmQNTYw==} @@ -3571,17 +2944,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.5) - dev: false - - /@babel/plugin-transform-literals@7.18.9(@babel/core@7.20.12): - resolution: {integrity: sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-literals@7.18.9(@babel/core@7.22.5): resolution: {integrity: sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg==} @@ -3590,8 +2952,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-logical-assignment-operators@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-CbayIfOw4av2v/HYZEsH+Klks3NC2/MFIR3QR8gnpGNNPEaq2fdlVCRYG/paKs7/5hvBLQ+H70pGWOHtlNEWNA==} @@ -3602,17 +2963,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.5) - dev: false - - /@babel/plugin-transform-member-expression-literals@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-member-expression-literals@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA==} @@ -3621,21 +2971,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-modules-amd@7.20.11(@babel/core@7.20.12): - resolution: {integrity: sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-modules-amd@7.20.11(@babel/core@7.22.5): resolution: {integrity: sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g==} @@ -3644,25 +2980,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color - dev: false - - /@babel/plugin-transform-modules-commonjs@7.21.5(@babel/core@7.20.12): - resolution: {integrity: sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-simple-access': 7.21.5 + '@babel/helper-module-transforms': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 transitivePeerDependencies: - supports-color - dev: true /@babel/plugin-transform-modules-commonjs@7.21.5(@babel/core@7.22.5): resolution: {integrity: sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==} @@ -3671,26 +2992,24 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-simple-access': 7.21.5 + '@babel/helper-module-transforms': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 transitivePeerDependencies: - supports-color - /@babel/plugin-transform-modules-systemjs@7.20.11(@babel/core@7.20.12): - resolution: {integrity: sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw==} + /@babel/plugin-transform-modules-commonjs@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-hoist-variables': 7.18.6 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-identifier': 7.19.1 + '@babel/core': 7.22.5 + '@babel/helper-module-transforms': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-simple-access': 7.22.5 transitivePeerDependencies: - supports-color - dev: true /@babel/plugin-transform-modules-systemjs@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-V21W3bKLxO3ZjcBJZ8biSvo5gQ85uIXW2vJfh7JSWf/4SLUSr1tOoHX3ruN4+Oqa2m+BKfsxTR1I+PsvkIWvNw==} @@ -3705,20 +3024,6 @@ packages: '@babel/helper-validator-identifier': 7.22.5 transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-transform-modules-umd@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 - transitivePeerDependencies: - - supports-color - dev: true /@babel/plugin-transform-modules-umd@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ==} @@ -3727,22 +3032,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-module-transforms': 7.22.1 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-module-transforms': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-transform-named-capturing-groups-regex@7.20.5(@babel/core@7.20.12): - resolution: {integrity: sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-regexp-features-plugin': 7.20.5(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-named-capturing-groups-regex@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-c6HrD/LpUdNNJsISQZpds3TXvfYIAbo+efE9aWmY/PmSRD0agrJ9cPMt4BmArwUQ7ZymEWTFjTyp+yReLJZh0Q==} @@ -3753,17 +3046,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-transform-new-target@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-new-target@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-5RuJdSo89wKdkRTqtM9RVVJzHum9c2s0te9rB7vZC1zKKxcioWIy+xcu4OoIAjyFZhb/bp5KkunuLin1q7Ct+w==} @@ -3773,7 +3055,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false /@babel/plugin-transform-nullish-coalescing-operator@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-CpaoNp16nX7ROtLONNuCyenYdY/l7ZsR6aoVa7rW7nMWisoNoQNIH5Iay/4LDyRjKMuElMqXiBoOQCDLTMGZiw==} @@ -3784,7 +3065,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.5) - dev: false /@babel/plugin-transform-numeric-separator@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-+AF88fPDJrnseMh5vD9+SH6wq4ZMvpiTMHh58uLs+giMEyASFVhcT3NkoyO+NebFCNnpHJEq5AXO2txV4AGPDQ==} @@ -3795,7 +3075,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.5) - dev: false /@babel/plugin-transform-object-rest-spread@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-38bzTsqMMCI46/TQnJwPPpy33EjLCc1Gsm2hRTF6zTMWnKsN61vdrpuzIEGQyKEhDSYDKyZHrrd5FMj4gcUHhw==} @@ -3809,20 +3088,6 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.5) '@babel/plugin-transform-parameters': 7.22.3(@babel/core@7.22.5) - dev: false - - /@babel/plugin-transform-object-super@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-replace-supers': 7.20.7 - transitivePeerDependencies: - - supports-color - dev: true /@babel/plugin-transform-object-super@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA==} @@ -3831,11 +3096,10 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-replace-supers': 7.20.7 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-replace-supers': 7.22.1 transitivePeerDependencies: - supports-color - dev: false /@babel/plugin-transform-optional-catch-binding@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-bnDFWXFzWY0BsOyqaoSXvMQ2F35zutQipugog/rqotL2S4ciFOKlRYUu9djt4iq09oh2/34hqfRR2k1dIvuu4g==} @@ -3846,7 +3110,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.5) - dev: false /@babel/plugin-transform-optional-chaining@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-63v3/UFFxhPKT8j8u1jTTGVyITxl7/7AfOqK8C5gz1rHURPUGe3y5mvIf68eYKGoBNahtJnTxBKug4BQOnzeJg==} @@ -3858,27 +3121,6 @@ packages: '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.5) - dev: false - - /@babel/plugin-transform-parameters@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true - - /@babel/plugin-transform-parameters@7.20.7(@babel/core@7.22.5): - resolution: {integrity: sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false /@babel/plugin-transform-parameters@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-x7QHQJHPuD9VmfpzboyGJ5aHEr9r7DsAsdxdhJiTB3J3j8dyl+NFZ+rX5Q2RWFDCs61c06qBfS4ys2QYn8UkMw==} @@ -3888,7 +3130,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false /@babel/plugin-transform-private-methods@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-fC7jtjBPFqhqpPAE+O4LKwnLq7gGkD3ZmC2E3i4qWH34mH3gOg2Xrq5YMHUq6DM30xhqM1DNftiRaSqVjEG+ug==} @@ -3901,7 +3142,6 @@ packages: '@babel/helper-plugin-utils': 7.22.5 transitivePeerDependencies: - supports-color - dev: false /@babel/plugin-transform-private-property-in-object@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-C7MMl4qWLpgVCbXfj3UW8rR1xeCnisQ0cU7YJHV//8oNBS0aCIVg1vFnZXxOckHhEpQyqNNkWmvSEWnMLlc+Vw==} @@ -3916,17 +3156,6 @@ packages: '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.22.5) transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-transform-property-literals@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-property-literals@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg==} @@ -3935,27 +3164,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-transform-react-constant-elements@7.20.2(@babel/core@7.20.12): + /@babel/plugin-transform-react-constant-elements@7.20.2(@babel/core@7.22.5): resolution: {integrity: sha512-KS/G8YI8uwMGKErLFOHS/ekhqdHhpEloxs43NecQHVgo2QuQSyJhGIY1fL8UGl9wy5ItVwwoUL4YxVqsplGq2g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true - - /@babel/plugin-transform-react-display-name@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-transform-react-display-name@7.18.6(@babel/core@7.22.5): @@ -3965,17 +3183,16 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-plugin-utils': 7.22.5 - /@babel/plugin-transform-react-jsx-development@7.18.6(@babel/core@7.20.12): + /@babel/plugin-transform-react-jsx-development@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/plugin-transform-react-jsx': 7.20.7(@babel/core@7.20.12) + '@babel/core': 7.22.5 + '@babel/plugin-transform-react-jsx': 7.22.5(@babel/core@7.22.5) dev: true /@babel/plugin-transform-react-jsx-self@7.21.0(@babel/core@7.22.5): @@ -3992,25 +3209,11 @@ packages: resolution: {integrity: sha512-RpAi004QyMNisst/pvSanoRdJ4q+jMCWyk9zdw/CyLB9j8RXEahodR6l2GyttDRyEVWZtbN+TpLiHJ3t34LbsQ==} engines: {node: '>=6.9.0'} peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-transform-react-jsx@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-Tfq7qqD+tRj3EoDhY00nn2uP2hsRxgYGi5mLQ5TimKav0a9Lrpd4deE+fcLXU8zFYRjlKPHZhpCvfEA6qnBxqQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.20.12) - '@babel/types': 7.22.4 - dev: true + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + dev: false /@babel/plugin-transform-react-jsx@7.22.5(@babel/core@7.22.5): resolution: {integrity: sha512-rog5gZaVbUip5iWDMTYbVM15XQq+RkUKhET/IHR6oizR+JEoN6CAfTTuHcK4vwUyzca30qqHqEpzBOnaRMWYMA==} @@ -4025,26 +3228,15 @@ packages: '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.5) '@babel/types': 7.22.5 - /@babel/plugin-transform-react-pure-annotations@7.18.6(@babel/core@7.20.12): + /@babel/plugin-transform-react-pure-annotations@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-plugin-utils': 7.21.5 - dev: true - - /@babel/plugin-transform-regenerator@7.20.5(@babel/core@7.20.12): - resolution: {integrity: sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - regenerator-transform: 0.15.1 + '@babel/core': 7.22.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 dev: true /@babel/plugin-transform-regenerator@7.21.5(@babel/core@7.22.5): @@ -4056,17 +3248,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 regenerator-transform: 0.15.1 - dev: false - - /@babel/plugin-transform-reserved-words@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-reserved-words@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA==} @@ -4075,25 +3256,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-runtime@7.19.6(@babel/core@7.20.12): - resolution: {integrity: sha512-PRH37lz4JU156lYFW1p8OxE5i7d6Sl/zV58ooyr+q1J1lnQPyg5tIiXlIwNVhJaY4W3TmOtdc8jqdXQcB1v5Yw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-module-imports': 7.18.6 - '@babel/helper-plugin-utils': 7.21.5 - babel-plugin-polyfill-corejs2: 0.3.3(@babel/core@7.20.12) - babel-plugin-polyfill-corejs3: 0.6.0(@babel/core@7.20.12) - babel-plugin-polyfill-regenerator: 0.4.1(@babel/core@7.20.12) - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-runtime@7.22.4(@babel/core@7.22.5): resolution: {integrity: sha512-Urkiz1m4zqiRo17klj+l3nXgiRTFQng91Bc1eiLF7BMQu1e7wE5Gcq9xSv062IF068NHjcutSbIMev60gXxAvA==} @@ -4110,17 +3273,6 @@ packages: semver: 6.3.0 transitivePeerDependencies: - supports-color - dev: false - - /@babel/plugin-transform-shorthand-properties@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-shorthand-properties@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw==} @@ -4129,19 +3281,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-spread@7.20.7(@babel/core@7.20.12): - resolution: {integrity: sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-spread@7.20.7(@babel/core@7.22.5): resolution: {integrity: sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw==} @@ -4150,19 +3290,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 '@babel/helper-skip-transparent-expression-wrappers': 7.20.0 - dev: false - - /@babel/plugin-transform-sticky-regex@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-sticky-regex@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q==} @@ -4171,18 +3300,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-template-literals@7.18.9(@babel/core@7.20.12): - resolution: {integrity: sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-template-literals@7.18.9(@babel/core@7.22.5): resolution: {integrity: sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA==} @@ -4191,18 +3309,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-typeof-symbol@7.18.9(@babel/core@7.20.12): - resolution: {integrity: sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-typeof-symbol@7.18.9(@babel/core@7.22.5): resolution: {integrity: sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw==} @@ -4211,23 +3318,7 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - dev: false - - /@babel/plugin-transform-typescript@7.22.3(@babel/core@7.20.12): - resolution: {integrity: sha512-pyjnCIniO5PNaEuGxT28h0HbMru3qCVrMqVgVOz/krComdIrY9W6FCLBq9NWHY8HDGaUlan+UhmZElDENIfCcw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-annotate-as-pure': 7.18.6 - '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.20.12) - transitivePeerDependencies: - - supports-color - dev: true + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-typescript@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-pyjnCIniO5PNaEuGxT28h0HbMru3qCVrMqVgVOz/krComdIrY9W6FCLBq9NWHY8HDGaUlan+UhmZElDENIfCcw==} @@ -4236,22 +3327,25 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-annotate-as-pure': 7.18.6 + '@babel/helper-annotate-as-pure': 7.22.5 '@babel/helper-create-class-features-plugin': 7.22.1(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.22.5) transitivePeerDependencies: - supports-color + dev: false - /@babel/plugin-transform-unicode-escapes@7.18.10(@babel/core@7.20.12): - resolution: {integrity: sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ==} + /@babel/plugin-transform-typescript@7.22.9(@babel/core@7.22.5): + resolution: {integrity: sha512-BnVR1CpKiuD0iobHPaM1iLvcwPYN2uVFAqoLVSpEDKWuOikoCv5HbKLxclhKYUXlWkX86DoZGtqI4XhbOsyrMg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - dev: true + '@babel/core': 7.22.5 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-create-class-features-plugin': 7.22.9(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.5) /@babel/plugin-transform-unicode-escapes@7.21.5(@babel/core@7.22.5): resolution: {integrity: sha512-LYm/gTOwZqsYohlvFUe/8Tujz75LqqVC2w+2qPHLR+WyWHGCZPN1KBpJCJn+4Bk4gOkQy/IXKIge6az5MqwlOg==} @@ -4261,7 +3355,6 @@ packages: dependencies: '@babel/core': 7.22.5 '@babel/helper-plugin-utils': 7.22.5 - dev: false /@babel/plugin-transform-unicode-property-regex@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-5ScJ+OmdX+O6HRuMGW4kv7RL9vIKdtdAj9wuWUKy1wbHY3jaM/UlyIiC1G7J6UJiiyMukjjK0QwL3P0vBd0yYg==} @@ -4272,18 +3365,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/plugin-transform-unicode-regex@7.18.6(@babel/core@7.20.12): - resolution: {integrity: sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-create-regexp-features-plugin': 7.20.5(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - dev: true /@babel/plugin-transform-unicode-regex@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA==} @@ -4292,9 +3373,8 @@ packages: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-create-regexp-features-plugin': 7.20.5(@babel/core@7.22.5) - '@babel/helper-plugin-utils': 7.21.5 - dev: false + '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 /@babel/plugin-transform-unicode-sets-regex@7.22.3(@babel/core@7.22.5): resolution: {integrity: sha512-hNufLdkF8vqywRp+P55j4FHXqAX2LRUccoZHH7AFn1pq5ZOO2ISKW9w13bFZVjBoTqeve2HOgoJCcaziJVhGNw==} @@ -4305,93 +3385,6 @@ packages: '@babel/core': 7.22.5 '@babel/helper-create-regexp-features-plugin': 7.22.1(@babel/core@7.22.5) '@babel/helper-plugin-utils': 7.22.5 - dev: false - - /@babel/preset-env@7.20.2(@babel/core@7.20.12): - resolution: {integrity: sha512-1G0efQEWR1EHkKvKHqbG+IN/QdgwfByUpM5V5QroDzGV2t3S/WXNQd693cHiHTlCFMpr9B6FkPFXDA2lQcKoDg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/compat-data': 7.20.10 - '@babel/core': 7.20.12 - '@babel/helper-compilation-targets': 7.20.7(@babel/core@7.20.12) - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-option': 7.21.0 - '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-async-generator-functions': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-class-static-block': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-dynamic-import': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-export-namespace-from': 7.18.9(@babel/core@7.20.12) - '@babel/plugin-proposal-json-strings': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-logical-assignment-operators': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-object-rest-spread': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-optional-catch-binding': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-optional-chaining': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-private-property-in-object': 7.20.5(@babel/core@7.20.12) - '@babel/plugin-proposal-unicode-property-regex': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.20.12) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.20.12) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.20.12) - '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-syntax-import-assertions': 7.20.0(@babel/core@7.20.12) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.20.12) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.20.12) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.20.12) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.20.12) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.20.12) - '@babel/plugin-transform-arrow-functions': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-async-to-generator': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-block-scoped-functions': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-block-scoping': 7.20.11(@babel/core@7.20.12) - '@babel/plugin-transform-classes': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-computed-properties': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-destructuring': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-dotall-regex': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-duplicate-keys': 7.18.9(@babel/core@7.20.12) - '@babel/plugin-transform-exponentiation-operator': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-for-of': 7.18.8(@babel/core@7.20.12) - '@babel/plugin-transform-function-name': 7.18.9(@babel/core@7.20.12) - '@babel/plugin-transform-literals': 7.18.9(@babel/core@7.20.12) - '@babel/plugin-transform-member-expression-literals': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-modules-amd': 7.20.11(@babel/core@7.20.12) - '@babel/plugin-transform-modules-commonjs': 7.21.5(@babel/core@7.20.12) - '@babel/plugin-transform-modules-systemjs': 7.20.11(@babel/core@7.20.12) - '@babel/plugin-transform-modules-umd': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-named-capturing-groups-regex': 7.20.5(@babel/core@7.20.12) - '@babel/plugin-transform-new-target': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-object-super': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-parameters': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-property-literals': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-regenerator': 7.20.5(@babel/core@7.20.12) - '@babel/plugin-transform-reserved-words': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-shorthand-properties': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-spread': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-sticky-regex': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-template-literals': 7.18.9(@babel/core@7.20.12) - '@babel/plugin-transform-typeof-symbol': 7.18.9(@babel/core@7.20.12) - '@babel/plugin-transform-unicode-escapes': 7.18.10(@babel/core@7.20.12) - '@babel/plugin-transform-unicode-regex': 7.18.6(@babel/core@7.20.12) - '@babel/preset-modules': 0.1.5(@babel/core@7.20.12) - '@babel/types': 7.20.7 - babel-plugin-polyfill-corejs2: 0.3.3(@babel/core@7.20.12) - babel-plugin-polyfill-corejs3: 0.6.0(@babel/core@7.20.12) - babel-plugin-polyfill-regenerator: 0.4.1(@babel/core@7.20.12) - core-js-compat: 3.27.1 - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true /@babel/preset-env@7.22.4(@babel/core@7.22.5): resolution: {integrity: sha512-c3lHOjbwBv0TkhYCr+XCR6wKcSZ1QbQTVdSkZUaVpLv8CVWotBMArWUi5UAJrcrQaEnleVkkvaV8F/pmc/STZQ==} @@ -4412,7 +3405,7 @@ packages: '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.22.5) '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.22.5) '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.22.5) - '@babel/plugin-syntax-import-assertions': 7.20.0(@babel/core@7.22.5) + '@babel/plugin-syntax-import-assertions': 7.22.5(@babel/core@7.22.5) '@babel/plugin-syntax-import-attributes': 7.22.3(@babel/core@7.22.5) '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.5) '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.5) @@ -4482,7 +3475,6 @@ packages: semver: 6.3.0 transitivePeerDependencies: - supports-color - dev: false /@babel/preset-flow@7.21.4(@babel/core@7.22.5): resolution: {integrity: sha512-F24cSq4DIBmhq4OzK3dE63NHagb27OPE3eWR+HLekt4Z3Y5MzIIUGF3LlLgV0gN8vzbDViSY7HnrReNVCJXTeA==} @@ -4496,75 +3488,45 @@ packages: '@babel/plugin-transform-flow-strip-types': 7.21.0(@babel/core@7.22.5) dev: false - /@babel/preset-modules@0.1.5(@babel/core@7.20.12): - resolution: {integrity: sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/plugin-proposal-unicode-property-regex': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-dotall-regex': 7.18.6(@babel/core@7.20.12) - '@babel/types': 7.22.4 - esutils: 2.0.3 - dev: true - /@babel/preset-modules@0.1.5(@babel/core@7.22.5): resolution: {integrity: sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 + '@babel/helper-plugin-utils': 7.22.5 '@babel/plugin-proposal-unicode-property-regex': 7.18.6(@babel/core@7.22.5) '@babel/plugin-transform-dotall-regex': 7.18.6(@babel/core@7.22.5) - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 esutils: 2.0.3 - dev: false - /@babel/preset-react@7.18.6(@babel/core@7.20.12): + /@babel/preset-react@7.18.6(@babel/core@7.22.5): resolution: {integrity: sha512-zXr6atUmyYdiWRVLOZahakYmOBHtWc2WGCkP8PYTgZi0iJXDY2CN180TdrIW4OGOAdLc7TifzDIvtx6izaRIzg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-option': 7.21.0 - '@babel/plugin-transform-react-display-name': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-react-jsx': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-transform-react-jsx-development': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-react-pure-annotations': 7.18.6(@babel/core@7.20.12) - dev: true - - /@babel/preset-typescript@7.21.5(@babel/core@7.20.12): - resolution: {integrity: sha512-iqe3sETat5EOrORXiQ6rWfoOg2y68Cs75B9wNxdPW4kixJxh7aXQE1KPdWLDniC24T/6dSnguF33W9j/ZZQcmA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-option': 7.21.0 - '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.20.12) - '@babel/plugin-transform-modules-commonjs': 7.21.5(@babel/core@7.20.12) - '@babel/plugin-transform-typescript': 7.22.3(@babel/core@7.20.12) - transitivePeerDependencies: - - supports-color + '@babel/core': 7.22.5 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.5 + '@babel/plugin-transform-react-display-name': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-transform-react-jsx': 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-react-jsx-development': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-transform-react-pure-annotations': 7.18.6(@babel/core@7.22.5) dev: true - /@babel/preset-typescript@7.21.5(@babel/core@7.22.5): - resolution: {integrity: sha512-iqe3sETat5EOrORXiQ6rWfoOg2y68Cs75B9wNxdPW4kixJxh7aXQE1KPdWLDniC24T/6dSnguF33W9j/ZZQcmA==} + /@babel/preset-typescript@7.22.5(@babel/core@7.22.5): + resolution: {integrity: sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: '@babel/core': 7.22.5 - '@babel/helper-plugin-utils': 7.21.5 - '@babel/helper-validator-option': 7.21.0 - '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.22.5) - '@babel/plugin-transform-modules-commonjs': 7.21.5(@babel/core@7.22.5) - '@babel/plugin-transform-typescript': 7.22.3(@babel/core@7.22.5) + '@babel/helper-plugin-utils': 7.22.5 + '@babel/helper-validator-option': 7.22.5 + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-modules-commonjs': 7.22.5(@babel/core@7.22.5) + '@babel/plugin-transform-typescript': 7.22.9(@babel/core@7.22.5) transitivePeerDependencies: - supports-color @@ -4584,28 +3546,20 @@ packages: /@babel/regjsgen@0.8.0: resolution: {integrity: sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==} - dev: false - - /@babel/runtime@7.20.7: - resolution: {integrity: sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ==} - engines: {node: '>=6.9.0'} - dependencies: - regenerator-runtime: 0.13.11 /@babel/runtime@7.22.3: resolution: {integrity: sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.13.11 - dev: false /@babel/template@7.20.7: resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.18.6 - '@babel/parser': 7.20.7 - '@babel/types': 7.22.4 + '@babel/code-frame': 7.22.5 + '@babel/parser': 7.22.5 + '@babel/types': 7.22.5 dev: true /@babel/template@7.21.9: @@ -4615,6 +3569,7 @@ packages: '@babel/code-frame': 7.21.4 '@babel/parser': 7.22.4 '@babel/types': 7.22.4 + dev: true /@babel/template@7.22.5: resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} @@ -4658,6 +3613,7 @@ packages: globals: 11.12.0 transitivePeerDependencies: - supports-color + dev: true /@babel/traverse@7.22.5: resolution: {integrity: sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==} @@ -4692,6 +3648,7 @@ packages: '@babel/helper-string-parser': 7.21.5 '@babel/helper-validator-identifier': 7.19.1 to-fast-properties: 2.0.0 + dev: true /@babel/types@7.22.5: resolution: {integrity: sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==} @@ -5774,7 +4731,6 @@ packages: strip-ansi-cjs: /strip-ansi@6.0.1 wrap-ansi: 8.1.0 wrap-ansi-cjs: /wrap-ansi@7.0.0 - dev: true /@istanbuljs/load-nyc-config@1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} @@ -6164,7 +5120,7 @@ packages: resolution: {integrity: sha512-ipON6WtYgl/1329g5AIJVbUuEh0wZVbdpGwC99Jw4LwuoBNS95MVphU6zOeD9pDkon+LLbFL7lOQRapbB8SCHw==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@babel/core': 7.20.12 + '@babel/core': 7.22.5 '@jest/types': 27.5.1 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -6194,7 +5150,7 @@ packages: chalk: 4.1.2 convert-source-map: 2.0.0 fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jest-haste-map: 29.5.0 jest-regex-util: 29.4.3 jest-util: 29.5.0 @@ -6265,6 +5221,7 @@ packages: '@jridgewell/set-array': 1.1.2 '@jridgewell/sourcemap-codec': 1.4.14 '@jridgewell/trace-mapping': 0.3.17 + dev: true /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} @@ -6307,6 +5264,7 @@ packages: dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 + dev: true /@jridgewell/trace-mapping@0.3.18: resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} @@ -6404,12 +5362,12 @@ packages: detect-libc: 2.0.1 https-proxy-agent: 5.0.1 make-dir: 3.1.0 - node-fetch: 2.6.11 + node-fetch: 2.6.12 nopt: 5.0.0 npmlog: 5.0.1 rimraf: 3.0.2 semver: 7.5.1 - tar: 6.1.13 + tar: 6.1.15 transitivePeerDependencies: - encoding - supports-color @@ -6453,16 +5411,6 @@ packages: - '@types/node' dev: true - /@microsoft/api-extractor-model@7.27.1(@types/node@20.3.0): - resolution: {integrity: sha512-WgmuQwElTuRLATQxCx+pqk5FtUeRX3FW8WDo7tSDmrN/7+XAggeVg5t8ItiJt688jEdbiPvagZlvjAcJMpXspg==} - dependencies: - '@microsoft/tsdoc': 0.14.2 - '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.2(@types/node@20.3.0) - transitivePeerDependencies: - - '@types/node' - dev: false - /@microsoft/api-extractor-model@7.27.2(@types/node@20.3.0): resolution: {integrity: sha512-JWhSfEb4UMYZgI4JsJOws1DjQrb7BaoXoWQV5XW23MWRn1krHVmRHky82Dby5rQPHdr/BBKvEjZV6joFmaGU4Q==} dependencies: @@ -6471,27 +5419,6 @@ packages: '@rushstack/node-core-library': 3.59.3(@types/node@20.3.0) transitivePeerDependencies: - '@types/node' - dev: true - - /@microsoft/api-extractor@7.35.1(@types/node@20.3.0): - resolution: {integrity: sha512-xGVf1lKCYKEyJsspLzQjo4Oo6PGDPH95Z5/te75xQWpcRHcfemb6zTSPtiFeVDHkg9Tan5HW2QXGLwQRkW199w==} - hasBin: true - dependencies: - '@microsoft/api-extractor-model': 7.27.1(@types/node@20.3.0) - '@microsoft/tsdoc': 0.14.2 - '@microsoft/tsdoc-config': 0.16.2 - '@rushstack/node-core-library': 3.59.2(@types/node@20.3.0) - '@rushstack/rig-package': 0.3.19 - '@rushstack/ts-command-line': 4.13.3 - colors: 1.2.5 - lodash: 4.17.21 - resolve: 1.22.2 - semver: 7.3.8 - source-map: 0.6.1 - typescript: 5.0.4 - transitivePeerDependencies: - - '@types/node' - dev: false /@microsoft/api-extractor@7.35.2(@types/node@20.3.0): resolution: {integrity: sha512-f3aM4hJkv5W04eLh6wdJ9fzscAmb+GgnT6j+pMlGVyz+0p2yQDndymvgUseFO6a+HqFDSH4yZXmkqT8bP7lVWQ==} @@ -6511,7 +5438,6 @@ packages: typescript: 5.0.4 transitivePeerDependencies: - '@types/node' - dev: true /@microsoft/tsdoc-config@0.16.2: resolution: {integrity: sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==} @@ -6987,7 +5913,6 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} requiresBuild: true - dev: true optional: true /@pmmmwh/react-refresh-webpack-plugin@0.5.10(react-refresh@0.11.0)(webpack-dev-server@4.11.1)(webpack@5.75.0): @@ -7270,7 +6195,7 @@ packages: resolution: {integrity: sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==} dev: false - /@rollup/plugin-babel@5.3.1(@babel/core@7.20.12)(rollup@2.79.1): + /@rollup/plugin-babel@5.3.1(@babel/core@7.22.5)(rollup@2.79.1): resolution: {integrity: sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q==} engines: {node: '>= 10.0.0'} peerDependencies: @@ -7281,8 +6206,8 @@ packages: '@types/babel__core': optional: true dependencies: - '@babel/core': 7.20.12 - '@babel/helper-module-imports': 7.18.6 + '@babel/core': 7.22.5 + '@babel/helper-module-imports': 7.22.5 '@rollup/pluginutils': 3.1.0(rollup@2.79.1) rollup: 2.79.1 dev: true @@ -7318,33 +6243,15 @@ packages: peerDependencies: rollup: ^1.20.0||^2.0.0 dependencies: - '@types/estree': 0.0.39 - estree-walker: 1.0.1 - picomatch: 2.3.1 - rollup: 2.79.1 - dev: true - - /@rushstack/eslint-patch@1.2.0: - resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} - dev: true - - /@rushstack/node-core-library@3.59.2(@types/node@20.3.0): - resolution: {integrity: sha512-Od8i9ZXiRPHrnkuNOZ9IjEYRQ9JsBLNHlkWJr1wSQZrD2TVIc8APpIB/FnzEcjfpbJMT4XhtcCZaa0pVx+hTXw==} - peerDependencies: - '@types/node': '*' - peerDependenciesMeta: - '@types/node': - optional: true - dependencies: - '@types/node': 20.3.0 - colors: 1.2.5 - fs-extra: 7.0.1 - import-lazy: 4.0.0 - jju: 1.4.0 - resolve: 1.22.2 - semver: 7.3.8 - z-schema: 5.0.5 - dev: false + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.3.1 + rollup: 2.79.1 + dev: true + + /@rushstack/eslint-patch@1.2.0: + resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} + dev: true /@rushstack/node-core-library@3.59.3(@types/node@20.3.0): resolution: {integrity: sha512-OGk0nQc+SvDkn+IQN16co691A/96gPoRIoWdIlpUds+sYPAGWdTcNVjKMwFOAsCSASqOeF2lh1GdPtWoWJCkPQ==} @@ -7362,30 +6269,12 @@ packages: resolve: 1.22.2 semver: 7.3.8 z-schema: 5.0.5 - dev: true - - /@rushstack/rig-package@0.3.19: - resolution: {integrity: sha512-2d0/Gn+qjOYneZbiHjn4SjyDwq9I0WagV37z0F1V71G+yONgH7wlt3K/UoNiDkhA8gTHYPRo2jz3CvttybwSag==} - dependencies: - resolve: 1.22.2 - strip-json-comments: 3.1.1 - dev: false /@rushstack/rig-package@0.3.20: resolution: {integrity: sha512-XemFRFbH9FOk1Es1kTjrYydenf3hXtrV3xxMCEWPuOSn2Lcll/dsLzEULbhCL0Nf5nGMe52ewEiVtX3odd5Ukg==} dependencies: resolve: 1.22.2 strip-json-comments: 3.1.1 - dev: true - - /@rushstack/ts-command-line@4.13.3: - resolution: {integrity: sha512-6aQIv/o1EgsC/+SpgUyRmzg2QIAL6sudEzw3sWzJKwWuQTc5XRsyZpyldfE7WAmIqMXDao9QG35/NYORjHm5Zw==} - dependencies: - '@types/argparse': 1.0.38 - argparse: 1.0.10 - colors: 1.2.5 - string-argv: 0.3.2 - dev: false /@rushstack/ts-command-line@4.14.0: resolution: {integrity: sha512-DWozCsKg+ALgrsul+6vJhyB7ZogqSycRlnqULjGsJ9dLRv+Pc0Wj6J7pX0xarmgX2kH3tTf0rXgBcl8QjJULIQ==} @@ -7394,7 +6283,6 @@ packages: argparse: 1.0.10 colors: 1.2.5 string-argv: 0.3.2 - dev: true /@scure/base@1.1.1: resolution: {integrity: sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==} @@ -7666,6 +6554,13 @@ packages: /@stablelib/constant-time@1.0.1: resolution: {integrity: sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==} + /@stablelib/ctr@1.0.2: + resolution: {integrity: sha512-Wq/Zr5QWNiXUu1UMhbeSIWhUm4YOhl01owaZOehxKFOKp6PPuUi9kAUAHv9cE5yQm9PLvIxzhwFco36sRpcOTQ==} + dependencies: + '@stablelib/blockcipher': 1.0.1 + '@stablelib/wipe': 1.0.1 + dev: false + /@stablelib/ed25519@1.0.3: resolution: {integrity: sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==} dependencies: @@ -7673,6 +6568,17 @@ packages: '@stablelib/sha512': 1.0.1 '@stablelib/wipe': 1.0.1 + /@stablelib/gcm@1.0.2: + resolution: {integrity: sha512-sQIRPGti1UXm740RTI38Apbl3t0oEEQMsdKN6VbC8a2lFHff6Stg90IqbF1xSrMLmm52gDGwtODhub3rKOMkfQ==} + dependencies: + '@stablelib/aead': 1.0.1 + '@stablelib/binary': 1.0.1 + '@stablelib/blockcipher': 1.0.1 + '@stablelib/constant-time': 1.0.1 + '@stablelib/ctr': 1.0.2 + '@stablelib/wipe': 1.0.1 + dev: false + /@stablelib/hash@1.0.1: resolution: {integrity: sha512-eTPJc/stDkdtOcrNMZ6mcMK1e6yBbqRBaNW55XA1jU8w/7QdnCF0CmMmOD1m7VSkBR44PWrMHU2l6r8YEQHMgg==} @@ -7840,14 +6746,14 @@ packages: resolution: {integrity: sha512-cAaR/CAiZRB8GP32N+1jocovUtvlj0+e65TB50/6Lcime+EA49m/8l+P2ko+XPJ4dw3xaPS3jOL4F2X4KWxoeQ==} engines: {node: '>=10'} dependencies: - '@babel/types': 7.22.4 + '@babel/types': 7.22.5 dev: true /@svgr/plugin-jsx@5.5.0: resolution: {integrity: sha512-V/wVh33j12hGh05IDg8GpIUXbjAPnTdPTKuP4VNLggnwaHMPNQNae2pRnyTAILWCQdz5GyMqtO488g7CKM8CBA==} engines: {node: '>=10'} dependencies: - '@babel/core': 7.20.12 + '@babel/core': 7.22.5 '@svgr/babel-preset': 5.5.0 '@svgr/hast-util-to-babel-ast': 5.5.0 svg-parser: 2.0.4 @@ -7868,10 +6774,10 @@ packages: resolution: {integrity: sha512-DOBOK255wfQxguUta2INKkzPj6AIS6iafZYiYmHn6W3pHlycSRRlvWKCfLDG10fXfLWqE3DJHgRUOyJYmARa7g==} engines: {node: '>=10'} dependencies: - '@babel/core': 7.20.12 - '@babel/plugin-transform-react-constant-elements': 7.20.2(@babel/core@7.20.12) - '@babel/preset-env': 7.20.2(@babel/core@7.20.12) - '@babel/preset-react': 7.18.6(@babel/core@7.20.12) + '@babel/core': 7.22.5 + '@babel/plugin-transform-react-constant-elements': 7.20.2(@babel/core@7.22.5) + '@babel/preset-env': 7.22.4(@babel/core@7.22.5) + '@babel/preset-react': 7.18.6(@babel/core@7.22.5) '@svgr/core': 5.5.0 '@svgr/plugin-jsx': 5.5.0 '@svgr/plugin-svgo': 5.5.0 @@ -7889,13 +6795,8 @@ packages: engines: {node: '>= 10'} dev: true - /@transmute/credentials-context@0.7.0-unstable.80: - resolution: {integrity: sha512-WhTrnSsIFcWGr3nAVUr1CBBzKKGWs8TJnXPAK+I3QzshennkMNbXpLNpU/sK3cum7eTRPyxFVbH37AxrHStQOw==} - dev: false - /@transmute/credentials-context@0.7.0-unstable.81: resolution: {integrity: sha512-TLXJkXwu+jscCVnAOuEmJYYbdaSaM6b2yk4R1g4T8gtTcTKts2G+KR5gE8A6W6QA5AuTZggwOWTxkISjErnYbw==} - dev: true /@transmute/did-context@0.6.1-unstable.37: resolution: {integrity: sha512-p/QnG3QKS4218hjIDgdvJOFATCXsAnZKgy4egqRrJLlo3Y6OaDBg7cA73dixOwUPoEKob0K6rLIGcsCI/L1acw==} @@ -7974,28 +6875,28 @@ packages: engines: {node: '>=10'} dependencies: '@stablelib/ed25519': 1.0.3 - '@transmute/ld-key-pair': 0.7.0-unstable.77 - '@transmute/x25519-key-pair': 0.7.0-unstable.77 + '@transmute/ld-key-pair': 0.7.0-unstable.79 + '@transmute/x25519-key-pair': 0.7.0-unstable.79 dev: false - /@transmute/ed25519-key-pair@0.7.0-unstable.79: - resolution: {integrity: sha512-i8DYpIQSZuT0qN69Vht/xpvRt8qLJ3gDqYOSn1QWlq72jkyi77gbBLNRUL8nb/SIYmDQ6YbILahXoiQ3NawhwQ==} + /@transmute/ed25519-key-pair@0.7.0-unstable.81: + resolution: {integrity: sha512-Jz3PhNe/2pMxfz5/6q7MizaWLSMUEzgI2Lc1UFEMIW59TjTkgbE9LZ5e+QK+fh59KWwYpUG4AFk6VGHBZgUCDA==} engines: {node: '>=16'} dependencies: '@stablelib/ed25519': 1.0.3 - '@transmute/ld-key-pair': 0.7.0-unstable.79 - '@transmute/x25519-key-pair': 0.7.0-unstable.79 + '@transmute/ld-key-pair': 0.7.0-unstable.81 + '@transmute/x25519-key-pair': 0.7.0-unstable.81 dev: false - /@transmute/ed25519-signature-2018@0.7.0-unstable.79(expo@48.0.19)(react-native@0.71.8): - resolution: {integrity: sha512-8X7SafiGmnVjx5ClL1rZ0x74neIuEcEqBcC/nghiewOjuWPf6zwHSYXqMogPotphIll6istThVa3CUDVLHYmWg==} + /@transmute/ed25519-signature-2018@0.7.0-unstable.81(expo@48.0.19)(react-native@0.71.8): + resolution: {integrity: sha512-qgDKvBuIFPRWmxydnQVNzdc0MttlN1s0NAgeEFpDGbL7SX9/9nnx/dC+5RGnrpu/EiShNKFhF4TBRq8HBmorsw==} engines: {node: '>=16'} dependencies: - '@transmute/credentials-context': 0.7.0-unstable.80 + '@transmute/credentials-context': 0.7.0-unstable.81 '@transmute/ed25519-key-pair': 0.7.0-unstable.2 - '@transmute/jose-ld': 0.7.0-unstable.79 - '@transmute/security-context': 0.7.0-unstable.79 - jsonld: /@digitalcredentials/jsonld@5.2.1(expo@48.0.19)(react-native@0.71.8) + '@transmute/jose-ld': 0.7.0-unstable.81 + '@transmute/jsonld': 0.0.4(expo@48.0.19)(react-native@0.71.8) + '@transmute/security-context': 0.7.0-unstable.81 transitivePeerDependencies: - domexception - expo @@ -8003,8 +6904,8 @@ packages: - web-streams-polyfill dev: false - /@transmute/jose-ld@0.7.0-unstable.79: - resolution: {integrity: sha512-kKq8g36QIiN6hhYPZtHSAlwKfdNF2h0TxHrbbyEXrNoWPZSk8IUH5F971Us/KodbLVVRjL0Pdh5qr3n53hg0Eg==} + /@transmute/jose-ld@0.7.0-unstable.81: + resolution: {integrity: sha512-xLwqoweaBjeuK9qvl8WZBPkwn0ubSgiaE0Vf6QuZgUZqwB7LhBI0wopUNFmINnbfuTfUbGuC4kdH1W+1HM445g==} engines: {node: '>=16'} dependencies: '@peculiar/webcrypto': 1.4.1 @@ -8015,15 +6916,28 @@ packages: web-streams-polyfill: 3.2.1 dev: false - /@transmute/json-web-signature@0.7.0-unstable.79(expo@48.0.19)(react-native@0.71.8): - resolution: {integrity: sha512-dJhJQpAhwxCsk575Pa14bftxbo/i8TuRU+B6NYNuUu/v+mbhw+B9JCkxk3cTEfF2J865+dAihYp0ET0886753A==} + /@transmute/json-web-signature@0.7.0-unstable.81(expo@48.0.19)(react-native@0.71.8): + resolution: {integrity: sha512-RFC34CnF571dK/K8uRr8dLLZySgrAr5vhhMB2YgGEy51cWzgYeLuhJw6Pzmm67E/r4CAa+r7/+hqVUfgihkNXw==} engines: {node: '>=16'} dependencies: - '@transmute/ed25519-key-pair': 0.7.0-unstable.79 - '@transmute/jose-ld': 0.7.0-unstable.79 - '@transmute/secp256k1-key-pair': 0.7.0-unstable.79 - '@transmute/security-context': 0.7.0-unstable.79 - '@transmute/web-crypto-key-pair': 0.7.0-unstable.79 + '@transmute/ed25519-key-pair': 0.7.0-unstable.81 + '@transmute/jose-ld': 0.7.0-unstable.81 + '@transmute/jsonld': 0.0.4(expo@48.0.19)(react-native@0.71.8) + '@transmute/secp256k1-key-pair': 0.7.0-unstable.81 + '@transmute/security-context': 0.7.0-unstable.81 + '@transmute/web-crypto-key-pair': 0.7.0-unstable.81 + transitivePeerDependencies: + - domexception + - expo + - react-native + - web-streams-polyfill + dev: false + + /@transmute/jsonld@0.0.4(expo@48.0.19)(react-native@0.71.8): + resolution: {integrity: sha512-6G++8imMYW9dtTvATPHNfrV3lLeX5E57DOmlgIDfO0A0yjkBCss1usB80NfONS26ynyveb8vTbp4nQDW9Ki4Rw==} + engines: {node: '>=16'} + dependencies: + json-pointer: 0.6.2 jsonld: /@digitalcredentials/jsonld@5.2.1(expo@48.0.19)(react-native@0.71.8) transitivePeerDependencies: - domexception @@ -8036,13 +6950,13 @@ packages: resolution: {integrity: sha512-DcTpEruAQBfOd2laZkg3uCQ+67Y7dw2hsvo42NAQ5tItCIx5AClP7zccri7T2JUcfDUFaE32z/BLTMEKYt3XZQ==} dev: false - /@transmute/ld-key-pair@0.7.0-unstable.77: - resolution: {integrity: sha512-TdYx6vcztXJ1qmmpad3NHfSge5MVAH6Ruvg139cJOGM9SEAQLXamNo28iTmB+trf1M4dWtGviok/jtJ6JGgjOA==} + /@transmute/ld-key-pair@0.7.0-unstable.79: + resolution: {integrity: sha512-QWpzTQStsoD1Bpif1rMWDGlYq0zzsHExw3As8piy3U+MtJpOYIOUJ60L6NSyFBB8Zq+XNeFJq0/puwzMV2lKog==} engines: {node: '>=16'} dev: false - /@transmute/ld-key-pair@0.7.0-unstable.79: - resolution: {integrity: sha512-QWpzTQStsoD1Bpif1rMWDGlYq0zzsHExw3As8piy3U+MtJpOYIOUJ60L6NSyFBB8Zq+XNeFJq0/puwzMV2lKog==} + /@transmute/ld-key-pair@0.7.0-unstable.81: + resolution: {integrity: sha512-GNfUEkWWCUUikxvLUgQssVSDRCw8x8ktYZD27ssoDtB9gp0oqQ5a9DxAWv8onH126F3Z4KGSSegmGWjkvgdL9g==} engines: {node: '>=16'} dev: false @@ -8055,20 +6969,29 @@ packages: secp256k1: 4.0.3 dev: false + /@transmute/secp256k1-key-pair@0.7.0-unstable.81: + resolution: {integrity: sha512-kofomMOOLkdTOAV2bQAEZAC0REuiI/RDqxYJJg/qpXnguyGTtv5DVHD8UXmUDKJLJkAql1lbksfs/roYYVBN7g==} + engines: {node: '>=16'} + dependencies: + '@bitauth/libauth': 1.19.1 + '@transmute/ld-key-pair': 0.7.0-unstable.81 + secp256k1: 4.0.3 + dev: false + /@transmute/security-context@0.6.1-unstable.37: resolution: {integrity: sha512-GtLmG65qlORrz/2S4I74DT+vA4+qXsFxrMr0cNOXjUqZBd/AW1PTrFnryLF9907BfoiD58HC9qb1WVGWjSlBYw==} dev: false - /@transmute/security-context@0.7.0-unstable.79: - resolution: {integrity: sha512-6lxUh7RKIcwVQSqPbb4IpZhgPYDc9Jxl9/Conk3QElD4GYuxNGZzBD5UwNcdUgcBBgk7N4jNK3fL9hwoxKCCZQ==} + /@transmute/security-context@0.7.0-unstable.81: + resolution: {integrity: sha512-5y7N/LIGPl1LtSCWyAlkIK/nDofsxM+AV0GoXuIIXFfgN8jnP9vuCRaMxsUCnoNQ+Aihe0fVNH7PkEm5y9HlKg==} dev: false - /@transmute/web-crypto-key-pair@0.7.0-unstable.79: - resolution: {integrity: sha512-F1/jNKmwD5u68pYfn86oTHbaElEDaej+DttsBgpwogCmbNai9UaGpWGxZwkugQM3d2BVBX3UHpc9PgXNGqJRNw==} + /@transmute/web-crypto-key-pair@0.7.0-unstable.81: + resolution: {integrity: sha512-oTHub0iFdwJdugQxohcuG1CZaxfuSUPisDkPsxaEHGEOU9+hBBym2Ugr3ZX9H+nT29UNXPlTKNKsSxV4UCtc5w==} engines: {node: '>=16'} dependencies: '@peculiar/webcrypto': 1.4.1 - '@transmute/ld-key-pair': 0.7.0-unstable.79 + '@transmute/ld-key-pair': 0.7.0-unstable.81 big-integer: 1.6.51 dev: false @@ -8080,20 +7003,20 @@ packages: '@transmute/ld-key-pair': 0.6.1-unstable.37 dev: false - /@transmute/x25519-key-pair@0.7.0-unstable.77: - resolution: {integrity: sha512-FYvbtScRUyx0zdac/az2R7Z3XSfvor04lEbEZsIuJIJAW/5KfATmbSmcWdbMyncAHz0V50fxN7N5knCjnAUuTQ==} + /@transmute/x25519-key-pair@0.7.0-unstable.79: + resolution: {integrity: sha512-dcWvq9DgbWpAprS0gosHvifYnmhEotqx9MyYzXLe/EntZFjJcsHffl+KSrRPBupVE82B5NxQnGZKCQeW5E20gA==} engines: {node: '>=16'} dependencies: '@stablelib/x25519': 1.0.3 - '@transmute/ld-key-pair': 0.7.0-unstable.77 + '@transmute/ld-key-pair': 0.7.0-unstable.79 dev: false - /@transmute/x25519-key-pair@0.7.0-unstable.79: - resolution: {integrity: sha512-dcWvq9DgbWpAprS0gosHvifYnmhEotqx9MyYzXLe/EntZFjJcsHffl+KSrRPBupVE82B5NxQnGZKCQeW5E20gA==} + /@transmute/x25519-key-pair@0.7.0-unstable.81: + resolution: {integrity: sha512-cr/yjSP4ErZMKwoU/scqkfKL63AJupE27xakCHZVEfGzQChQH2RDXsNDGCXxsf2+DGfayGBhxayCXRdOcvvzng==} engines: {node: '>=16'} dependencies: '@stablelib/x25519': 1.0.3 - '@transmute/ld-key-pair': 0.7.0-unstable.79 + '@transmute/ld-key-pair': 0.7.0-unstable.81 dev: false /@trufflesuite/bigint-buffer@1.1.10: @@ -8154,7 +7077,7 @@ packages: /@types/accepts@1.3.5: resolution: {integrity: sha512-jOdnI/3qTpHABjM5cx1Hc0sKsPoYCp+DP/GJRGtDlPd7fiV9oXGGIcjW/ZOxLIvjGz8MA+uMZI9metHlgqbgwQ==} dependencies: - '@types/node': 20.2.5 + '@types/node': 20.3.0 dev: true /@types/argparse@1.0.38: @@ -8163,8 +7086,8 @@ packages: /@types/babel__core@7.1.20: resolution: {integrity: sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ==} dependencies: - '@babel/parser': 7.20.7 - '@babel/types': 7.20.7 + '@babel/parser': 7.22.5 + '@babel/types': 7.22.5 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.18.3 @@ -8186,13 +7109,13 @@ packages: /@types/babel__traverse@7.18.3: resolution: {integrity: sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==} dependencies: - '@babel/types': 7.20.7 + '@babel/types': 7.22.5 dev: true - /@types/blessed@0.1.19: - resolution: {integrity: sha512-r4qnseYWBsi/kxo5AAlCS22EnTXFbGpnvuXUubJikVeRnYB3e5HwV3NtcwJ0Sk5KOGaLvo9Rtwb8hzxfbqbQPg==} + /@types/blessed@0.1.22: + resolution: {integrity: sha512-BsCmBwdn2ELV94FvMXGX1L1UIF/KO7kZvd1PKRbNG9lgiVYoyzcg8Y77S8VeWxX3zS8PUMIdZy1cWpSdvaOx9Q==} dependencies: - '@types/node': 20.2.5 + '@types/node': 20.3.0 dev: false /@types/bn.js@5.1.1: @@ -8235,7 +7158,7 @@ packages: '@types/connect': 3.4.35 '@types/express': 4.17.17 '@types/keygrip': 1.0.2 - '@types/node': 20.2.5 + '@types/node': 20.3.0 dev: true /@types/debug@4.1.8: @@ -8244,12 +7167,6 @@ packages: '@types/ms': 0.7.31 dev: true - /@types/elliptic@6.4.14: - resolution: {integrity: sha512-z4OBcDAU0GVwDTuwJzQCiL6188QvZMkvoERgcVjq0/mPM8jCfdwZ3x5zQEVoL9WCAru3aG5wl3Z5Ww5wBWn7ZQ==} - dependencies: - '@types/bn.js': 5.1.1 - dev: true - /@types/eslint-scope@3.7.4: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: @@ -8420,7 +7337,7 @@ packages: '@types/http-errors': 2.0.1 '@types/keygrip': 1.0.2 '@types/koa-compose': 3.2.5 - '@types/node': 20.2.5 + '@types/node': 20.3.0 dev: true /@types/lru-cache@5.1.1: @@ -8452,9 +7369,6 @@ packages: node-fetch: 3.3.0 dev: true - /@types/node@20.2.5: - resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==} - /@types/node@20.3.0: resolution: {integrity: sha512-cumHmIAf6On83X7yP+LrsEyUOf/YlociZelmpRYaGFydoaPdxdt80MAbu6vWerQT2COCp2nPvHdsbD7tHn/YlQ==} @@ -8521,11 +7435,11 @@ packages: /@types/react-dom@18.2.4: resolution: {integrity: sha512-G2mHoTMTL4yoydITgOGwWdWMVd8sNgyEP85xVmMKAPUBwQWm9wBPQUmvbeF4V3WBY1P7mmL4BkjQ0SqUpf1snw==} dependencies: - '@types/react': 18.2.8 + '@types/react': 18.2.11 dev: true - /@types/react@18.2.8: - resolution: {integrity: sha512-lTyWUNrd8ntVkqycEEplasWy2OxNlShj3zqS0LuB1ENUGis5HodmhM7DtCoUGbxj3VW/WsGA0DUhpG6XrM7gPA==} + /@types/react@18.2.11: + resolution: {integrity: sha512-+hsJr9hmwyDecSMQAmX7drgbDpyE+EgSF6t7+5QEBAn1tQK7kl1vWZ4iRf6SjQ8lk7dyEULxUmZOIpN0W5baZA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.3 @@ -8570,7 +7484,7 @@ packages: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: '@types/mime': 3.0.1 - '@types/node': 20.2.5 + '@types/node': 20.3.0 dev: false /@types/serve-static@1.15.1: @@ -8598,7 +7512,7 @@ packages: /@types/through@0.0.30: resolution: {integrity: sha512-FvnCJljyxhPM3gkRgWmxmDZyAQSiBQQWLI0A0VFL0K7W1oRUrPJSqNO0NvTnLkBcotdlp3lKvaT0JrnyRDkzOg==} dependencies: - '@types/node': 20.2.5 + '@types/node': 20.3.0 dev: true /@types/tough-cookie@4.0.2: @@ -8617,12 +7531,12 @@ packages: resolution: {integrity: sha512-zqqcGKyNWgTLFBxmaexGUKQyWqeG7HjXj20EuQJSJWwXe54BjX0ihIo5cJB9yAQzH8dNugJ9GvkBYMjPXs/PJw==} dev: true - /@types/uuid@9.0.1: - resolution: {integrity: sha512-rFT3ak0/2trgvp4yYZo5iKFEPsET7vKydKF+VRCxlQ9bpheehyAJH89dAkaLEq/j/RZXJIqcgsmPJKUP1Z28HA==} + /@types/uuid@9.0.2: + resolution: {integrity: sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ==} dev: true - /@types/ws@8.5.4: - resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==} + /@types/ws@8.5.5: + resolution: {integrity: sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==} dependencies: '@types/node': 20.3.0 dev: true @@ -8796,8 +7710,8 @@ packages: eslint-visitor-keys: 3.4.1 dev: true - /@ungap/structured-clone@1.0.1: - resolution: {integrity: sha512-zKVyTt6rELvPXYwcVPTJcPFtY0AckN5A7xWuc7owBqR0FdtuDYhE9MZZUi6IY1kZUQFSXV1B3UOOIyLkVHYd2w==} + /@ungap/structured-clone@1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: false /@unimodules/core@7.1.2: @@ -9678,6 +8592,25 @@ packages: - supports-color dev: true + /babel-jest@27.5.1(@babel/core@7.22.5): + resolution: {integrity: sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + dependencies: + '@babel/core': 7.22.5 + '@jest/transform': 27.5.1 + '@jest/types': 27.5.1 + '@types/babel__core': 7.1.20 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 27.5.1(@babel/core@7.22.5) + chalk: 4.1.2 + graceful-fs: 4.2.11 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /babel-jest@29.5.0(@babel/core@7.20.12): resolution: {integrity: sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -9708,7 +8641,7 @@ packages: babel-plugin-istanbul: 6.1.1 babel-preset-jest: 29.5.0(@babel/core@7.22.5) chalk: 4.1.2 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 slash: 3.0.0 transitivePeerDependencies: - supports-color @@ -9733,7 +8666,7 @@ packages: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} dependencies: - '@babel/helper-plugin-utils': 7.20.2 + '@babel/helper-plugin-utils': 7.22.5 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -9746,8 +8679,8 @@ packages: resolution: {integrity: sha512-50wCwD5EMNW4aRpOwtqzyZHIewTYNxLA4nhB+09d8BIssfNfzBRhkBIHiaPv1Si226TQSvp8gxAJm2iY2qs2hQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@babel/template': 7.21.9 - '@babel/types': 7.22.4 + '@babel/template': 7.22.5 + '@babel/types': 7.22.5 '@types/babel__core': 7.1.20 '@types/babel__traverse': 7.18.3 dev: true @@ -9766,7 +8699,7 @@ packages: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} engines: {node: '>=10', npm: '>=6'} dependencies: - '@babel/runtime': 7.20.7 + '@babel/runtime': 7.22.3 cosmiconfig: 7.1.0 resolve: 1.22.2 dev: true @@ -9791,19 +8724,6 @@ packages: '@babel/core': 7.20.12 dev: true - /babel-plugin-polyfill-corejs2@0.3.3(@babel/core@7.20.12): - resolution: {integrity: sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/compat-data': 7.20.10 - '@babel/core': 7.20.12 - '@babel/helper-define-polyfill-provider': 0.3.3(@babel/core@7.20.12) - semver: 6.3.0 - transitivePeerDependencies: - - supports-color - dev: true - /babel-plugin-polyfill-corejs2@0.4.3(@babel/core@7.22.5): resolution: {integrity: sha512-bM3gHc337Dta490gg+/AseNB9L4YLHxq1nGKZZSHbhXv4aTYU2MD2cjza1Ru4S6975YLTaL1K8uJf6ukJhhmtw==} peerDependencies: @@ -9815,19 +8735,6 @@ packages: semver: 6.3.0 transitivePeerDependencies: - supports-color - dev: false - - /babel-plugin-polyfill-corejs3@0.6.0(@babel/core@7.20.12): - resolution: {integrity: sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-define-polyfill-provider': 0.3.3(@babel/core@7.20.12) - core-js-compat: 3.27.1 - transitivePeerDependencies: - - supports-color - dev: true /babel-plugin-polyfill-corejs3@0.8.1(@babel/core@7.22.5): resolution: {integrity: sha512-ikFrZITKg1xH6pLND8zT14UPgjKHiGLqex7rGEZCH2EvhsneJaJPemmpQaIZV5AL03II+lXylw3UmddDK8RU5Q==} @@ -9839,18 +8746,6 @@ packages: core-js-compat: 3.30.2 transitivePeerDependencies: - supports-color - dev: false - - /babel-plugin-polyfill-regenerator@0.4.1(@babel/core@7.20.12): - resolution: {integrity: sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw==} - peerDependencies: - '@babel/core': ^7.0.0-0 - dependencies: - '@babel/core': 7.20.12 - '@babel/helper-define-polyfill-provider': 0.3.3(@babel/core@7.20.12) - transitivePeerDependencies: - - supports-color - dev: true /babel-plugin-polyfill-regenerator@0.5.0(@babel/core@7.22.5): resolution: {integrity: sha512-hDJtKjMLVa7Z+LwnTCxoDLQj6wdc+B8dun7ayF2fYieI6OzfuvcLMB32ihJZ4UhCBwNYGl5bg/x/P9cMdnkc2g==} @@ -9861,7 +8756,6 @@ packages: '@babel/helper-define-polyfill-provider': 0.4.0(@babel/core@7.22.5) transitivePeerDependencies: - supports-color - dev: false /babel-plugin-react-native-web@0.18.12: resolution: {integrity: sha512-4djr9G6fMdwQoD6LQ7hOKAm39+y12flWgovAqS1k5O8f42YQ3A1FFMyV5kKfetZuGhZO5BmNmOdRRZQ1TixtDw==} @@ -9980,6 +8874,17 @@ packages: babel-preset-current-node-syntax: 1.0.1(@babel/core@7.20.12) dev: true + /babel-preset-jest@27.5.1(@babel/core@7.22.5): + resolution: {integrity: sha512-Nptf2FzlPCWYuJg41HBqXVT8ym6bXOevuCTbhxlUpjwtysGaIWFvDEjp4y+G7fl13FgOdjs7P/DmErqH7da0Ag==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.22.5 + babel-plugin-jest-hoist: 27.5.1 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.5) + dev: true + /babel-preset-jest@29.5.0(@babel/core@7.20.12): resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -10005,21 +8910,21 @@ packages: /babel-preset-react-app@10.0.1: resolution: {integrity: sha512-b0D9IZ1WhhCWkrTXyFuIIgqGzSkRIH5D5AmB0bXbzYAB1OBAwHcUeyWW2LorutLWF5btNo/N7r/cIdmvvKJlYg==} dependencies: - '@babel/core': 7.20.12 - '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-decorators': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-optional-chaining': 7.20.7(@babel/core@7.20.12) - '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-proposal-private-property-in-object': 7.20.5(@babel/core@7.20.12) - '@babel/plugin-transform-flow-strip-types': 7.19.0(@babel/core@7.20.12) - '@babel/plugin-transform-react-display-name': 7.18.6(@babel/core@7.20.12) - '@babel/plugin-transform-runtime': 7.19.6(@babel/core@7.20.12) - '@babel/preset-env': 7.20.2(@babel/core@7.20.12) - '@babel/preset-react': 7.18.6(@babel/core@7.20.12) - '@babel/preset-typescript': 7.21.5(@babel/core@7.20.12) - '@babel/runtime': 7.20.7 + '@babel/core': 7.22.5 + '@babel/plugin-proposal-class-properties': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-proposal-decorators': 7.22.3(@babel/core@7.22.5) + '@babel/plugin-proposal-nullish-coalescing-operator': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-proposal-numeric-separator': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-proposal-optional-chaining': 7.21.0(@babel/core@7.22.5) + '@babel/plugin-proposal-private-methods': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-proposal-private-property-in-object': 7.21.11(@babel/core@7.22.5) + '@babel/plugin-transform-flow-strip-types': 7.21.0(@babel/core@7.22.5) + '@babel/plugin-transform-react-display-name': 7.18.6(@babel/core@7.22.5) + '@babel/plugin-transform-runtime': 7.22.4(@babel/core@7.22.5) + '@babel/preset-env': 7.22.4(@babel/core@7.22.5) + '@babel/preset-react': 7.18.6(@babel/core@7.22.5) + '@babel/preset-typescript': 7.22.5(@babel/core@7.22.5) + '@babel/runtime': 7.22.3 babel-plugin-macros: 3.1.0 babel-plugin-transform-react-remove-prop-types: 0.4.24 transitivePeerDependencies: @@ -10029,10 +8934,6 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - /base-58@0.0.1: - resolution: {integrity: sha512-denlKTnozZTVWuh1QkbXf10kkFNc+0/eno29RR+6g5al0yGI+iAOFt/cIA2tvnKoADlUFLZHs50ZdWF+c9WBnw==} - dev: false - /base-64@0.1.0: resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==} dev: false @@ -10131,17 +9032,6 @@ packages: inherits: 2.0.4 readable-stream: 3.6.2 - /bl@5.1.0: - resolution: {integrity: sha512-tv1ZJHLfTDnXE6tMHv73YgSJaWR2AFuPwMntBe7XL/GBFHnT0CLnsHMogfk5+GzCDC5ZWarSCYaIGATZt9dNsQ==} - dependencies: - buffer: 6.0.3 - inherits: 2.0.4 - readable-stream: 3.6.2 - dev: false - - /blakejs@1.2.1: - resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} - /blessed@0.1.81: resolution: {integrity: sha512-LoF5gae+hlmfORcG1M5+5XZi4LBmvlXTzwJWzUlPryN/SJdSflZvROM2TwkT0GMpq7oqT48NRd4GS7BiVBc5OQ==} engines: {node: '>= 0.8.0'} @@ -10357,6 +9247,7 @@ packages: electron-to-chromium: 1.4.284 node-releases: 2.0.8 update-browserslist-db: 1.0.10(browserslist@4.21.4) + dev: true /browserslist@4.21.7: resolution: {integrity: sha512-BauCXrQ7I2ftSqd2mvKHGo85XR0u7Ru3C/Hxsy/0TkfCtjrmAbPdzLGasmoiBxplpDXlPvdjX9u7srIMfgasNA==} @@ -10408,6 +9299,7 @@ packages: /buffer-writer@2.0.0: resolution: {integrity: sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==} engines: {node: '>=4'} + dev: false /buffer-xor@1.0.3: resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==} @@ -10609,7 +9501,7 @@ packages: /caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 caniuse-lite: 1.0.30001442 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 @@ -10617,6 +9509,7 @@ packages: /caniuse-lite@1.0.30001442: resolution: {integrity: sha512-239m03Pqy0hwxYPYR5JwOIxRJfLTWtle9FV8zosfV5pHg+/51uD4nxcUlM8+mWWGfwKtt8lJNHnD3cWw9VZ6ow==} + dev: true /caniuse-lite@1.0.30001502: resolution: {integrity: sha512-AZ+9tFXw1sS0o0jcpJQIXvFTOB/xGiQ4OQ2t98QX3NDn2EZTSRBC801gxrsGgViuq2ak/NLkNgSNEPtCr5lfKg==} @@ -10654,14 +9547,6 @@ packages: escape-string-regexp: 1.0.5 supports-color: 5.5.0 - /chalk@3.0.0: - resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} - engines: {node: '>=8'} - dependencies: - ansi-styles: 4.3.0 - supports-color: 7.2.0 - dev: true - /chalk@4.1.0: resolution: {integrity: sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==} engines: {node: '>=10'} @@ -10805,13 +9690,6 @@ packages: dependencies: restore-cursor: 3.1.0 - /cli-cursor@4.0.0: - resolution: {integrity: sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - restore-cursor: 4.0.0 - dev: false - /cli-highlight@2.1.11: resolution: {integrity: sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==} engines: {node: '>=8.0.0', npm: '>=5.0.0'} @@ -11249,17 +10127,10 @@ packages: engines: {node: '>=0.10.0'} dev: false - /core-js-compat@3.27.1: - resolution: {integrity: sha512-Dg91JFeCDA17FKnneN7oCMz4BkQ4TcffkgHP4OWwp9yx3pi7ubqMDXXSacfNak1PQqjc95skyt+YBLHQJnkJwA==} - dependencies: - browserslist: 4.21.4 - dev: true - /core-js-compat@3.30.2: resolution: {integrity: sha512-nriW1nuJjUgvkEjIot1Spwakz52V9YkYHZAQG6A1eCgC8AA1p0zngrQEP9R0+V6hji5XilWKG1Bd0YRppmGimA==} dependencies: browserslist: 4.21.7 - dev: false /core-js-pure@3.27.1: resolution: {integrity: sha512-BS2NHgwwUppfeoqOXqi08mUqS5FiZpuRuJJpKsaME7kJz0xxuk0xkhDdfMIlP/zLa80krBqss1LtD7f889heAw==} @@ -11423,7 +10294,6 @@ packages: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 - dev: true /crypt@0.0.2: resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} @@ -11762,9 +10632,11 @@ packages: whatwg-url: 11.0.0 dev: true - /date-fns@2.29.3: - resolution: {integrity: sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA==} + /date-fns@2.30.0: + resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} + dependencies: + '@babel/runtime': 7.22.3 /dateformat@3.0.3: resolution: {integrity: sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==} @@ -12049,21 +10921,12 @@ packages: resolution: {integrity: sha512-jEcNGrh6lOXNRJvZb9RjeevtZGrgugPKSMJZxfyxWQnhlKawMPhMtk/dfC+Z/6xNXExlzTKlY5LzIAK/fRpQIw==} dev: true - /did-jwt-vc@3.2.2: - resolution: {integrity: sha512-8ENQ0gR94MzBAwlKzwEi077CmQk+UXJ/iVHLEytqyo9OxdFx4/Te7JMuTWvB4EAowu7Rh/5AT9jO4AGwjjX2Gg==} - engines: {node: '>=18'} - dependencies: - did-jwt: 7.2.1 - did-resolver: 4.1.0 - dev: false - /did-jwt-vc@3.2.4: resolution: {integrity: sha512-aCes7YJ0+/CwLdC5Nw/MaLkGFzvyRfH3/iYrUi/nhTP0YJ6R2zOkmaXzYFZS+8vTcUnxZk/aj2i06/N5W8ylzw==} engines: {node: '>=18'} dependencies: did-jwt: 7.2.4 did-resolver: 4.1.0 - dev: true /did-jwt@6.11.6: resolution: {integrity: sha512-OfbWknRxJuUqH6Lk0x+H1FsuelGugLbBDEwsoJnicFOntIG/A4y19fn0a8RLxaQbWQ5gXg0yDq5E2huSBiiXzw==} @@ -12081,19 +10944,6 @@ packages: multiformats: 9.9.0 uint8arrays: 3.1.1 - /did-jwt@7.2.1: - resolution: {integrity: sha512-LDUquDLnicRRtebwaCCh39bakKkgSLg65tTfoQnawy+6JPNvJ4iUE8rIJgkhkjx1x1acyVSdEQbjXM735yTFCQ==} - dependencies: - '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 - '@stablelib/xchacha20poly1305': 1.0.1 - bech32: 2.0.0 - canonicalize: 2.0.0 - did-resolver: 4.1.0 - multiformats: 11.0.2 - uint8arrays: 4.0.3 - dev: false - /did-jwt@7.2.4: resolution: {integrity: sha512-xEWP+4Q0nCC/Gpek2psYR8zu2qiLnsfgr4b1s5y6DAGrgH/BvRCIxOuX+/iyzQ6N5pHHzPRDE+wKrLh7ObnJUg==} dependencies: @@ -12104,8 +10954,7 @@ packages: canonicalize: 2.0.0 did-resolver: 4.1.0 multiformats: 12.0.0 - uint8arrays: 4.0.3 - dev: true + uint8arrays: 4.0.4 /did-resolver@4.1.0: resolution: {integrity: sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA==} @@ -12259,8 +11108,13 @@ packages: engines: {node: '>=10'} dev: true - /dotenv@16.0.3: - resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==} + /dotenv@16.1.4: + resolution: {integrity: sha512-m55RtE8AsPeJBpOIFKihEmqUcoVncQIwo7x9U8ZwLEZw9ZpXboz2c+rvog+jUaJvVrZ5kBOeYQBX5+8Aa/OZQw==} + engines: {node: '>=12'} + dev: false + + /dotenv@16.3.1: + resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} engines: {node: '>=12'} /duplexer2@0.1.4: @@ -12303,6 +11157,7 @@ packages: /electron-to-chromium@1.4.284: resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} + dev: true /electron-to-chromium@1.4.427: resolution: {integrity: sha512-HK3r9l+Jm8dYAm1ctXEWIC+hV60zfcjS9UA5BDlYvnI5S7PU/yytjpvSrTNrSSRRkuu3tDyZhdkwIczh+0DWaw==} @@ -12582,8 +11437,8 @@ packages: typescript: optional: true dependencies: - '@babel/core': 7.20.12 - '@babel/eslint-parser': 7.19.1(@babel/core@7.20.12)(eslint@8.42.0) + '@babel/core': 7.22.5 + '@babel/eslint-parser': 7.19.1(@babel/core@7.22.5)(eslint@8.42.0) '@rushstack/eslint-patch': 1.2.0 '@typescript-eslint/eslint-plugin': 5.48.1(@typescript-eslint/parser@5.48.1)(eslint@8.42.0)(typescript@5.1.3) '@typescript-eslint/parser': 5.48.1(eslint@8.42.0)(typescript@5.1.3) @@ -12719,7 +11574,7 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: - '@babel/runtime': 7.20.7 + '@babel/runtime': 7.22.3 aria-query: 5.1.3 array-includes: 3.1.6 array.prototype.flatmap: 1.3.1 @@ -12947,36 +11802,16 @@ packages: resolution: {integrity: sha512-g25m4EtfQGjstWgVE1aIz7XYYjf3kH5kG17ULWVB5dH6uLahsoltOhACzSxyDV+fhn4gbR4xRrOXGe6r2uh4Bg==} dependencies: '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 - '@scure/bip32': 1.3.0 - '@scure/bip39': 1.2.0 - - /ethjs-util@0.1.6: - resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} - engines: {node: '>=6.5.0', npm: '>=3'} - dependencies: - is-hex-prefixed: 1.0.0 - strip-hex-prefix: 1.0.0 - - /ethr-did-resolver@7.0.2: - resolution: {integrity: sha512-l4TlISn8tDtBssbxlLz0bky48aQP2k7QGXiwcU1aatqLhz6Mgau2SuCy2N6zBRBPbprkYv5rrWeReHfmegQNuw==} - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/contracts': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/providers': 5.7.2 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/transactions': 5.7.0 - did-resolver: 4.1.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - dev: false + '@noble/hashes': 1.3.0 + '@scure/bip32': 1.3.0 + '@scure/bip39': 1.2.0 + + /ethjs-util@0.1.6: + resolution: {integrity: sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==} + engines: {node: '>=6.5.0', npm: '>=3'} + dependencies: + is-hex-prefixed: 1.0.0 + strip-hex-prefix: 1.0.0 /ethr-did-resolver@8.0.0: resolution: {integrity: sha512-iOsWa4qJAIt0kl6ilX1usOGq5j+Sqq5YR3OjmPSaaquvJNQUv0DjOn9656WSHvkknELmZAoXZH9naPGarTqldQ==} @@ -12997,8 +11832,8 @@ packages: - bufferutil - utf-8-validate - /ethr-did@2.3.6: - resolution: {integrity: sha512-rvDMqbnTuRqMY/2uU40IoqxN03SIqGwvjNNqxxUlr+CUaWZVgz2ZkOCygyRtTRfRLY7NAJQBFi6gXjDyBOSxrg==} + /ethr-did@2.3.14: + resolution: {integrity: sha512-lgEUJOTcQwdfLupJpqs/gOr+x2Sp5lIDMitgaRoxqP221BAU23AfSRRFC8NUrJH/wYxk2pAnijdAAzCvAhpcuA==} dependencies: '@ethersproject/abstract-signer': 5.7.0 '@ethersproject/base64': 5.7.0 @@ -13009,9 +11844,9 @@ packages: '@ethersproject/strings': 5.7.0 '@ethersproject/transactions': 5.7.0 '@ethersproject/wallet': 5.7.0 - did-jwt: 6.11.6 + did-jwt: 7.2.4 did-resolver: 4.1.0 - ethr-did-resolver: 7.0.2 + ethr-did-resolver: 8.0.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -13055,21 +11890,6 @@ packages: strip-eof: 1.0.0 dev: false - /execa@4.1.0: - resolution: {integrity: sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==} - engines: {node: '>=10'} - dependencies: - cross-spawn: 7.0.3 - get-stream: 5.2.0 - human-signals: 1.1.1 - is-stream: 2.0.1 - merge-stream: 2.0.0 - npm-run-path: 4.0.1 - onetime: 5.1.2 - signal-exit: 3.0.7 - strip-final-newline: 2.0.0 - dev: true - /execa@5.0.0: resolution: {integrity: sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==} engines: {node: '>=10'} @@ -13315,12 +12135,12 @@ packages: dev: false optional: true - /express-handlebars@7.0.0: - resolution: {integrity: sha512-gNg8ObMDjAnwmvkyt0XhweSzBkCAennVb/CHCVcwby5jsjmNDABa/MsYe2fIO3pR+Ns1PqspOuMUB/Xx4vtoyA==} + /express-handlebars@7.0.7: + resolution: {integrity: sha512-O4jUlkEVvqwyhkcmjWOqAEcV3JbcaGnlyS0oSgI3vyXO59Fco5JJtUboU2VHqv3Em3Q0VFC2VhRsmaUeNCOr5Q==} engines: {node: '>=v16'} dependencies: - glob: 9.3.5 - graceful-fs: 4.2.10 + glob: 10.2.7 + graceful-fs: 4.2.11 handlebars: 4.7.7 dev: false @@ -13798,13 +12618,16 @@ packages: for-in: 1.0.2 dev: true + /foreach@2.0.6: + resolution: {integrity: sha512-k6GAGDyqLe9JaebCsFCoudPPWfihKu8pylYXRlqP1J7ms39iPoTtk2fviNglIeQEwdh0bQeKJ01ZPyuyQvKzwg==} + dev: false + /foreground-child@3.1.1: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} dependencies: cross-spawn: 7.0.3 signal-exit: 4.0.2 - dev: true /fork-ts-checker-webpack-plugin@6.5.2(eslint@8.42.0)(typescript@5.1.3)(webpack@5.75.0): resolution: {integrity: sha512-m5cUmF30xkZ7h4tWUgTAcEaKmUW7tfyUyTqNNOz7OxWJ0v1VWKTcOvH8FWHUwSjlW/356Ijc9vi3XfcPstpQKA==} @@ -13820,7 +12643,7 @@ packages: vue-template-compiler: optional: true dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.22.5 '@types/json-schema': 7.0.11 chalk: 4.1.2 chokidar: 3.5.3 @@ -14250,7 +13073,6 @@ packages: minimatch: 9.0.1 minipass: 6.0.2 path-scurry: 1.9.2 - dev: true /glob@6.0.4: resolution: {integrity: sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==} @@ -14325,6 +13147,7 @@ packages: minimatch: 8.0.4 minipass: 4.2.8 path-scurry: 1.9.2 + dev: true /global-modules@0.2.3: resolution: {integrity: sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA==} @@ -14407,6 +13230,7 @@ packages: /graceful-fs@4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -14810,11 +13634,6 @@ packages: - supports-color dev: true - /human-signals@1.1.1: - resolution: {integrity: sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==} - engines: {node: '>=8.12.0'} - dev: true - /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -14972,7 +13791,7 @@ packages: validate-npm-package-name: 5.0.0 dev: true - /inquirer-autocomplete-prompt@3.0.0(inquirer@9.1.4): + /inquirer-autocomplete-prompt@3.0.0(inquirer@9.2.7): resolution: {integrity: sha512-nsPWllBQB3qhvpVgV1UIJN4xo3yz7Qv8y1+zrNVpJUNPxtUZ7btCum/4UCAs5apPCe/FVhKH1V6Wx0cAwkreyg==} engines: {node: '>=12'} peerDependencies: @@ -14980,7 +13799,7 @@ packages: dependencies: ansi-escapes: 6.0.0 figures: 5.0.0 - inquirer: 9.1.4 + inquirer: 9.2.7 picocolors: 1.0.0 run-async: 2.4.1 rxjs: 7.8.0 @@ -15007,25 +13826,25 @@ packages: wrap-ansi: 7.0.0 dev: true - /inquirer@9.1.4: - resolution: {integrity: sha512-9hiJxE5gkK/cM2d1mTEnuurGTAoHebbkX0BYl3h7iEg7FYfuNIom+nDfBCSWtvSnoSrWCeBxqqBZu26xdlJlXA==} - engines: {node: '>=12.0.0'} + /inquirer@9.2.7: + resolution: {integrity: sha512-Bf52lnfvNxGPJPltiNO2tLBp3zC339KNlGMqOkW+dsvNikBhcVDK5kqU2lVX2FTPzuXUFX5WJDlsw//w3ZwoTw==} + engines: {node: '>=14.18.0'} dependencies: - ansi-escapes: 6.0.0 + ansi-escapes: 4.3.2 chalk: 5.2.0 - cli-cursor: 4.0.0 + cli-cursor: 3.1.0 cli-width: 4.0.0 external-editor: 3.1.0 figures: 5.0.0 lodash: 4.17.21 - mute-stream: 0.0.8 - ora: 6.1.2 - run-async: 2.4.1 - rxjs: 7.8.0 - string-width: 5.1.2 - strip-ansi: 7.0.1 + mute-stream: 1.0.0 + ora: 5.4.1 + run-async: 3.0.0 + rxjs: 7.8.1 + string-width: 4.2.3 + strip-ansi: 6.0.1 through: 2.3.8 - wrap-ansi: 8.0.1 + wrap-ansi: 6.2.0 dev: false /internal-ip@4.3.0: @@ -15271,11 +14090,6 @@ packages: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} - /is-interactive@2.0.0: - resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==} - engines: {node: '>=12'} - dev: false - /is-invalid-path@0.1.0: resolution: {integrity: sha512-aZMG0T3F34mTg4eTdszcGXx54oiZ4NtHSft3hWNJMGJXUUqdIj3cOZuHcU0nCWWcY3jd7yRe/3AEm3vSNTpBGQ==} engines: {node: '>=0.10.0'} @@ -15570,8 +14384,8 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.20.12 - '@babel/parser': 7.20.7 + '@babel/core': 7.22.5 + '@babel/parser': 7.22.5 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.0 @@ -15614,7 +14428,6 @@ packages: '@isaacs/cliui': 8.0.2 optionalDependencies: '@pkgjs/parseargs': 0.11.0 - dev: true /jake@10.8.7: resolution: {integrity: sha512-ZDi3aP+fG/LchyBzUM804VjddnwfSfsdeYkwt8NcbKRvo4rFkjhs456iLFn3k2ZUWvNe4i48WACDbza8fhq2+w==} @@ -15771,10 +14584,10 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.20.12 + '@babel/core': 7.22.5 '@jest/test-sequencer': 27.5.1 '@jest/types': 27.5.1 - babel-jest: 27.5.1(@babel/core@7.20.12) + babel-jest: 27.5.1(@babel/core@7.22.5) chalk: 4.1.2 ci-info: 3.8.0 deepmerge: 4.3.1 @@ -16177,7 +14990,7 @@ packages: resolution: {integrity: sha512-rMyFe1+jnyAAf+NHwTclDz0eAaLkVDdKVHHBFWsBWHnnh5YeJMNWWsv7AbFYXfK3oTqvL7VTWkhNLu1jX24D+g==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.22.5 '@jest/types': 27.5.1 '@types/stack-utils': 2.0.1 chalk: 4.1.2 @@ -16469,16 +15282,16 @@ packages: resolution: {integrity: sha512-yYykXI5a0I31xX67mgeLw1DZ0bJB+gpq5IpSuCAoyDi0+BhgU/RIrL+RTzDmkNTchvDFWKP8lp+w/42Z3us5sA==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: - '@babel/core': 7.20.12 - '@babel/generator': 7.20.7 - '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.20.12) - '@babel/traverse': 7.22.4 - '@babel/types': 7.22.4 + '@babel/core': 7.22.5 + '@babel/generator': 7.22.5 + '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.22.5) + '@babel/traverse': 7.22.5 + '@babel/types': 7.22.5 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__traverse': 7.18.3 '@types/prettier': 2.7.2 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.20.12) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.5) chalk: 4.1.2 expect: 27.5.1 graceful-fs: 4.2.11 @@ -16811,7 +15624,7 @@ packages: '@babel/plugin-transform-modules-commonjs': 7.21.5(@babel/core@7.22.5) '@babel/preset-env': 7.22.4(@babel/core@7.22.5) '@babel/preset-flow': 7.21.4(@babel/core@7.22.5) - '@babel/preset-typescript': 7.21.5(@babel/core@7.22.5) + '@babel/preset-typescript': 7.22.5(@babel/core@7.22.5) '@babel/register': 7.21.0(@babel/core@7.22.5) babel-core: 7.0.0-bridge.0(@babel/core@7.22.5) chalk: 4.1.2 @@ -16902,7 +15715,7 @@ packages: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 11.0.0 - ws: 8.12.0 + ws: 8.13.0 xml-name-validator: 4.0.0 transitivePeerDependencies: - bufferutil @@ -16944,6 +15757,12 @@ packages: engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} dev: true + /json-pointer@0.6.2: + resolution: {integrity: sha512-vLWcKbOaXlO+jvRy4qNd+TI1QUPZzfJj1tpJ3vAXDych5XJf93ftpUKe5pKCrzyIIwgBJcOcCVRUfqQP25afBw==} + dependencies: + foreach: 2.0.6 + dev: false + /json-schema-deref-sync@0.13.0: resolution: {integrity: sha512-YBOEogm5w9Op337yb6pAT6ZXDqlxAsQCanM3grid8lMWNxRJO/zWEJi3ZzqDL8boWfwhTFym5EFrNgWwpqcBRg==} engines: {node: '>=6.0.0'} @@ -17498,14 +16317,6 @@ packages: chalk: 4.1.2 is-unicode-supported: 0.1.0 - /log-symbols@5.1.0: - resolution: {integrity: sha512-l0x2DvrW294C9uDCoQe1VSU4gf529FkSZ6leBl4TiqZH/e+0R7hSfHQBNut2mNygDgHwvYHfFLn6Oxb3VWj2rA==} - engines: {node: '>=12'} - dependencies: - chalk: 5.2.0 - is-unicode-supported: 1.3.0 - dev: false - /logkitty@0.7.1: resolution: {integrity: sha512-/3ER20CTTbahrCrpYfPn7Xavv9diBROZpoXGVZDWMw4b/X4uuUwAC0ki85tgsdMRONURyIJbcOvS94QsUBYPbQ==} hasBin: true @@ -18220,13 +17031,13 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 + dev: true /minimatch@9.0.1: resolution: {integrity: sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==} engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 - dev: true /minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} @@ -18237,10 +17048,6 @@ packages: kind-of: 6.0.3 dev: true - /minimist@1.2.7: - resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} - dev: true - /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} @@ -18324,6 +17131,7 @@ packages: /minipass@4.2.8: resolution: {integrity: sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ==} engines: {node: '>=8'} + dev: true /minipass@5.0.0: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} @@ -18390,11 +17198,6 @@ packages: engines: {node: '>=10'} dev: true - /mri@1.2.0: - resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} - engines: {node: '>=4'} - dev: true - /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} @@ -18452,17 +17255,6 @@ packages: varint: 5.0.2 dev: false - /multimatch@4.0.0: - resolution: {integrity: sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ==} - engines: {node: '>=8'} - dependencies: - '@types/minimatch': 3.0.5 - array-differ: 3.0.0 - array-union: 2.1.0 - arrify: 2.0.1 - minimatch: 3.1.2 - dev: true - /multimatch@5.0.0: resolution: {integrity: sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==} engines: {node: '>=10'} @@ -18476,11 +17268,11 @@ packages: /mute-stream@0.0.8: resolution: {integrity: sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==} + dev: true /mute-stream@1.0.0: resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dev: true /mv@2.1.1: resolution: {integrity: sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==} @@ -18736,6 +17528,7 @@ packages: /node-releases@2.0.8: resolution: {integrity: sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A==} + dev: true /node-stream-zip@1.15.0: resolution: {integrity: sha512-LN4fydt9TqhZhThkZIVQnF9cwjU3qmUH9h78Mx/K7d3VvfRqqwthLwJEUOEL0QPZ0XQmNN7be5Ggit5+4dq3Bw==} @@ -19111,7 +17904,7 @@ packages: oas-kit-common: 1.0.8 reftools: 1.1.9 yaml: 1.10.2 - yargs: 17.6.2 + yargs: 17.7.2 /ob1@0.73.9: resolution: {integrity: sha512-kHOzCOFXmAM26fy7V/YuXNKne2TyRiXbFAvPBIbuedJCZZWQZHLdPzMeXJI4Egt6IcfDttRzN3jQ90wOwq1iNw==} @@ -19281,13 +18074,8 @@ packages: is-docker: 2.2.1 is-wsl: 2.2.0 - /openapi-types@12.1.0: - resolution: {integrity: sha512-XpeCy01X6L5EpP+6Hc3jWN7rMZJ+/k1lwki/kTmWzbVhdPie3jd5O2ZtedEx8Yp58icJ0osVldLMrTB/zslQXA==} - dev: false - /openapi-types@12.1.3: resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} - dev: true /optionator@0.8.3: resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} @@ -19340,21 +18128,6 @@ packages: strip-ansi: 6.0.1 wcwidth: 1.0.1 - /ora@6.1.2: - resolution: {integrity: sha512-EJQ3NiP5Xo94wJXIzAyOtSb0QEIAUu7m8t6UZ9krbz0vAJqr92JpcK/lEXg91q6B9pEGqrykkd2EQplnifDSBw==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - bl: 5.1.0 - chalk: 5.2.0 - cli-cursor: 4.0.0 - cli-spinners: 2.9.0 - is-interactive: 2.0.0 - is-unicode-supported: 1.3.0 - log-symbols: 5.1.0 - strip-ansi: 7.1.0 - wcwidth: 1.0.1 - dev: false - /os-homedir@1.0.2: resolution: {integrity: sha512-B5JU3cabzk8c67mRRd3ECmROafjYMXbuzlwtqdM8IbS8ktlTix8aFGb2bAGKrSRIlnfKwovGUUr72JUPyOb6kQ==} engines: {node: '>=0.10.0'} @@ -19555,6 +18328,7 @@ packages: /packet-reader@1.0.0: resolution: {integrity: sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==} + dev: false /pacote@15.2.0: resolution: {integrity: sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==} @@ -19756,7 +18530,6 @@ packages: /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} - dev: true /path-key@4.0.0: resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} @@ -19810,22 +18583,32 @@ packages: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} dev: true - /pg-connection-string@2.5.0: - resolution: {integrity: sha512-r5o/V/ORTA6TmUnyWZR9nCj1klXCO2CEKNRlVuJptZe85QuhFayC7WeMic7ndayT5IRIR0S0xFxFi2ousartlQ==} + /pg-cloudflare@1.1.1: + resolution: {integrity: sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==} + requiresBuild: true + dev: false + optional: true + + /pg-connection-string@2.6.2: + resolution: {integrity: sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==} + dev: false /pg-int8@1.0.1: resolution: {integrity: sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==} engines: {node: '>=4.0.0'} + dev: false - /pg-pool@3.5.2(pg@8.8.0): - resolution: {integrity: sha512-His3Fh17Z4eg7oANLob6ZvH8xIVen3phEZh2QuyrIl4dQSDVEabNducv6ysROKpDNPSD+12tONZVWfSgMvDD9w==} + /pg-pool@3.6.1(pg@8.11.0): + resolution: {integrity: sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==} peerDependencies: pg: '>=8.0' dependencies: - pg: 8.8.0 + pg: 8.11.0 + dev: false - /pg-protocol@1.5.0: - resolution: {integrity: sha512-muRttij7H8TqRNu/DxrAJQITO4Ac7RmX3Klyr/9mJEOBeIpgnF8f9jAfRz5d3XwQZl5qBjF9gLsUtMPJE0vezQ==} + /pg-protocol@1.6.0: + resolution: {integrity: sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==} + dev: false /pg-types@2.2.0: resolution: {integrity: sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==} @@ -19836,9 +18619,10 @@ packages: postgres-bytea: 1.0.0 postgres-date: 1.0.7 postgres-interval: 1.2.0 + dev: false - /pg@8.8.0: - resolution: {integrity: sha512-UXYN0ziKj+AeNNP7VDMwrehpACThH7LUl/p8TDFpEUuSejCUIwGSfxpHsPvtM6/WXFy6SU4E5RG4IJV/TZAGjw==} + /pg@8.11.0: + resolution: {integrity: sha512-meLUVPn2TWgJyLmy7el3fQQVwft4gU5NGyvV0XbD41iU9Jbg8lCH4zexhIkihDzVHJStlt6r088G6/fWeNjhXA==} engines: {node: '>= 8.0.0'} peerDependencies: pg-native: '>=3.0.1' @@ -19848,16 +18632,20 @@ packages: dependencies: buffer-writer: 2.0.0 packet-reader: 1.0.0 - pg-connection-string: 2.5.0 - pg-pool: 3.5.2(pg@8.8.0) - pg-protocol: 1.5.0 + pg-connection-string: 2.6.2 + pg-pool: 3.6.1(pg@8.11.0) + pg-protocol: 1.6.0 pg-types: 2.2.0 pgpass: 1.0.5 + optionalDependencies: + pg-cloudflare: 1.1.1 + dev: false /pgpass@1.0.5: resolution: {integrity: sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==} dependencies: split2: 4.1.0 + dev: false /picocolors@0.2.1: resolution: {integrity: sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==} @@ -20018,7 +18806,7 @@ packages: peerDependencies: postcss: ^8.2.15 dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 caniuse-api: 3.0.0 colord: 2.9.3 postcss: 8.4.21 @@ -20031,7 +18819,7 @@ packages: peerDependencies: postcss: ^8.2.15 dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 postcss: 8.4.21 postcss-value-parser: 4.2.0 dev: true @@ -20296,7 +19084,7 @@ packages: peerDependencies: postcss: ^8.2.15 dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 caniuse-api: 3.0.0 cssnano-utils: 3.1.0(postcss@8.4.21) postcss: 8.4.21 @@ -20331,7 +19119,7 @@ packages: peerDependencies: postcss: ^8.2.15 dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 cssnano-utils: 3.1.0(postcss@8.4.21) postcss: 8.4.21 postcss-value-parser: 4.2.0 @@ -20474,7 +19262,7 @@ packages: peerDependencies: postcss: ^8.2.15 dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 postcss: 8.4.21 postcss-value-parser: 4.2.0 dev: true @@ -20636,7 +19424,7 @@ packages: peerDependencies: postcss: ^8.2.15 dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 caniuse-api: 3.0.0 postcss: 8.4.21 dev: true @@ -20731,20 +19519,24 @@ packages: /postgres-array@2.0.0: resolution: {integrity: sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==} engines: {node: '>=4'} + dev: false /postgres-bytea@1.0.0: resolution: {integrity: sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==} engines: {node: '>=0.10.0'} + dev: false /postgres-date@1.0.7: resolution: {integrity: sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==} engines: {node: '>=0.10.0'} + dev: false /postgres-interval@1.2.0: resolution: {integrity: sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==} engines: {node: '>=0.10.0'} dependencies: xtend: 4.0.2 + dev: false /prelude-ls@1.1.2: resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} @@ -20810,22 +19602,6 @@ packages: ansi-styles: 5.2.0 react-is: 18.2.0 - /pretty-quick@3.1.3(prettier@3.0.0): - resolution: {integrity: sha512-kOCi2FJabvuh1as9enxYmrnBC6tVMoVOenMaBqRfsvBHB0cbpYHjdQEpSglpASDFEXVwplpcGR4CLEaisYAFcA==} - engines: {node: '>=10.13'} - hasBin: true - peerDependencies: - prettier: '>=2.0.0' - dependencies: - chalk: 3.0.0 - execa: 4.1.0 - find-up: 4.1.0 - ignore: 5.2.4 - mri: 1.2.0 - multimatch: 4.0.0 - prettier: 3.0.0 - dev: true - /proc-log@3.0.0: resolution: {integrity: sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -21578,7 +20354,7 @@ packages: /regenerator-transform@0.15.1: resolution: {integrity: sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg==} dependencies: - '@babel/runtime': 7.20.7 + '@babel/runtime': 7.22.3 /regex-not@1.0.2: resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} @@ -21606,17 +20382,6 @@ packages: engines: {node: '>=8'} dev: true - /regexpu-core@5.2.2: - resolution: {integrity: sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw==} - engines: {node: '>=4'} - dependencies: - regenerate: 1.4.2 - regenerate-unicode-properties: 10.1.0 - regjsgen: 0.7.1 - regjsparser: 0.9.1 - unicode-match-property-ecmascript: 2.0.0 - unicode-match-property-value-ecmascript: 2.1.0 - /regexpu-core@5.3.2: resolution: {integrity: sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ==} engines: {node: '>=4'} @@ -21627,7 +20392,6 @@ packages: regjsparser: 0.9.1 unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.1.0 - dev: false /registry-auth-token@5.0.2: resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} @@ -21636,9 +20400,6 @@ packages: '@pnpm/npm-conf': 2.2.0 dev: true - /regjsgen@0.7.1: - resolution: {integrity: sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA==} - /regjsparser@0.9.1: resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} hasBin: true @@ -21823,14 +20584,6 @@ packages: onetime: 5.1.2 signal-exit: 3.0.7 - /restore-cursor@4.0.0: - resolution: {integrity: sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - onetime: 5.1.2 - signal-exit: 3.0.7 - dev: false - /ret@0.1.15: resolution: {integrity: sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==} engines: {node: '>=0.12'} @@ -21913,7 +20666,7 @@ packages: peerDependencies: rollup: ^2.0.0 dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.22.5 jest-worker: 26.6.2 rollup: 2.79.1 serialize-javascript: 4.0.0 @@ -21932,6 +20685,11 @@ packages: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} engines: {node: '>=0.12.0'} + /run-async@3.0.0: + resolution: {integrity: sha512-540WwVDOMxA6dN6We19EcT9sc3hkXPw5mzRNGM3FkdN/vtE9NFvj5lFAPNwUDmJjXidm3v7TC1cTE7t17Ulm1Q==} + engines: {node: '>=0.12.0'} + dev: false + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: @@ -21946,7 +20704,6 @@ packages: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: tslib: 2.5.3 - dev: true /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -22150,6 +20907,10 @@ packages: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true + /semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + /semver@7.3.2: resolution: {integrity: sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==} engines: {node: '>=10'} @@ -22317,7 +21078,6 @@ packages: engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 - dev: true /shebang-regex@1.0.0: resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} @@ -22327,7 +21087,6 @@ packages: /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} - dev: true /shell-quote@1.7.4: resolution: {integrity: sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==} @@ -22350,7 +21109,6 @@ packages: /signal-exit@4.0.2: resolution: {integrity: sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==} engines: {node: '>=14'} - dev: true /signale@1.4.0: resolution: {integrity: sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==} @@ -22669,6 +21427,7 @@ packages: /split2@4.1.0: resolution: {integrity: sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==} engines: {node: '>= 10.x'} + dev: false /split@1.0.1: resolution: {integrity: sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==} @@ -22678,23 +21437,6 @@ packages: /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - /sqlite3@5.1.4: - resolution: {integrity: sha512-i0UlWAzPlzX3B5XP2cYuhWQJsTtlMD6obOa1PgeEQ4DHEXUuyJkgv50I3isqZAP5oFc2T8OFvakmDh2W6I+YpA==} - requiresBuild: true - peerDependenciesMeta: - node-gyp: - optional: true - dependencies: - '@mapbox/node-pre-gyp': 1.0.10 - node-addon-api: 4.3.0 - tar: 6.1.13 - optionalDependencies: - node-gyp: 8.4.1 - transitivePeerDependencies: - - bluebird - - encoding - - supports-color - /sqlite3@5.1.6: resolution: {integrity: sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==} requiresBuild: true @@ -22894,13 +21636,6 @@ packages: dependencies: ansi-regex: 5.0.1 - /strip-ansi@7.0.1: - resolution: {integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==} - engines: {node: '>=12'} - dependencies: - ansi-regex: 6.0.1 - dev: false - /strip-ansi@7.1.0: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} @@ -22992,7 +21727,7 @@ packages: peerDependencies: postcss: ^8.2.15 dependencies: - browserslist: 4.21.4 + browserslist: 4.21.7 postcss: 8.4.21 postcss-selector-parser: 6.0.11 dev: true @@ -23098,11 +21833,11 @@ packages: resolution: {integrity: sha512-V3eIa28lwB6gg7/wfNvAbjwJYmDXy1Jo1POjyTzlB6wPcHiGlRxq39TSjYGVjQrUSAzpv+a7nzp7mDxgNy57xA==} dev: false - /swagger-ui-express@4.6.0(express@4.18.2): - resolution: {integrity: sha512-ZxpQFp1JR2RF8Ar++CyJzEDdvufa08ujNUJgMVTMWPi86CuQeVdBtvaeO/ysrz6dJAYXf9kbVNhWD7JWocwqsA==} + /swagger-ui-express@4.6.3(express@4.18.2): + resolution: {integrity: sha512-CDje4PndhTD2HkgyKH3pab+LKspDeB/NhPN2OF1j+piYIamQqBYwAXWESOT1Yju2xFg51bRW9sUng2WxDjzArw==} engines: {node: '>= v0.10.32'} peerDependencies: - express: '>=4.0.0' + express: '>=4.0.0 || >=5.0.0-beta' dependencies: express: 4.18.2 swagger-ui-dist: 4.15.5 @@ -23188,17 +21923,6 @@ packages: yallist: 4.0.0 dev: true - /tar@6.1.13: - resolution: {integrity: sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==} - engines: {node: '>=10'} - dependencies: - chownr: 2.0.0 - fs-minipass: 2.1.0 - minipass: 4.2.8 - minizlib: 2.1.2 - mkdirp: 1.0.4 - yallist: 4.0.0 - /tar@6.1.15: resolution: {integrity: sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==} engines: {node: '>=10'} @@ -23761,7 +22485,7 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typeorm@0.3.16(pg@8.8.0)(sqlite3@5.1.4)(ts-node@10.9.1): + /typeorm@0.3.16(pg@8.11.0)(sqlite3@5.1.6)(ts-node@10.9.1): resolution: {integrity: sha512-wJ4Qy1oqRKNDdZiBTTaVMqwo/XxC52Q7uNPTjltPgLhvIW173bL6Iad0lhptMOsFlpixFPaUu3PNziaRBwX2Zw==} engines: {node: '>= 12.9.0'} hasBin: true @@ -23824,23 +22548,24 @@ packages: buffer: 6.0.3 chalk: 4.1.2 cli-highlight: 2.1.11 - date-fns: 2.29.3 + date-fns: 2.30.0 debug: 4.3.4 - dotenv: 16.0.3 + dotenv: 16.3.1 glob: 8.1.0 mkdirp: 2.1.6 - pg: 8.8.0 + pg: 8.11.0 reflect-metadata: 0.1.13 sha.js: 2.4.11 - sqlite3: 5.1.4 + sqlite3: 5.1.6 ts-node: 10.9.1(@types/node@20.3.0)(typescript@5.1.3) tslib: 2.5.3 uuid: 9.0.0 yargs: 17.6.2 transitivePeerDependencies: - supports-color + dev: false - /typeorm@0.3.16(sqlite3@5.1.6)(ts-node@10.9.1): + /typeorm@0.3.16(ts-node@10.9.1): resolution: {integrity: sha512-wJ4Qy1oqRKNDdZiBTTaVMqwo/XxC52Q7uNPTjltPgLhvIW173bL6Iad0lhptMOsFlpixFPaUu3PNziaRBwX2Zw==} engines: {node: '>= 12.9.0'} hasBin: true @@ -23903,21 +22628,20 @@ packages: buffer: 6.0.3 chalk: 4.1.2 cli-highlight: 2.1.11 - date-fns: 2.29.3 + date-fns: 2.30.0 debug: 4.3.4 - dotenv: 16.0.3 + dotenv: 16.3.1 glob: 8.1.0 mkdirp: 2.1.6 reflect-metadata: 0.1.13 sha.js: 2.4.11 - sqlite3: 5.1.6 ts-node: 10.9.1(@types/node@20.3.0)(typescript@5.1.3) tslib: 2.5.3 uuid: 9.0.0 yargs: 17.6.2 transitivePeerDependencies: - supports-color - dev: false + dev: true /typescript@4.9.4: resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} @@ -23961,9 +22685,8 @@ packages: dependencies: multiformats: 9.9.0 - /uint8arrays@4.0.3: - resolution: {integrity: sha512-b+aKlI2oTnxnfeSQWV1sMacqSNxqhtXySaH6bflvONGxF8V/fT3ZlYH7z2qgGfydsvpVo4JUgM/Ylyfl2YouCg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /uint8arrays@4.0.4: + resolution: {integrity: sha512-AOoA66e/A7zoXm1mgzQjGmkWDTvCrS3ttWXLHFtlVAwMobLcaOA7G7WRNNAcyfjjYdFDtkEK6njRDX7hZLIO9Q==} dependencies: multiformats: 11.0.2 @@ -24129,6 +22852,7 @@ packages: browserslist: 4.21.4 escalade: 3.1.1 picocolors: 1.0.0 + dev: true /update-browserslist-db@1.0.11(browserslist@4.21.7): resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} @@ -24287,11 +23011,6 @@ packages: builtins: 5.0.1 dev: true - /validator@13.7.0: - resolution: {integrity: sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==} - engines: {node: '>= 0.10'} - dev: false - /validator@13.9.0: resolution: {integrity: sha512-B+dGG8U3fdtM0/aNK4/X8CXq/EcxU2WPrPEkJGslb47qyHsxmbggTWK0yEA4qnYVNF+nxNlN88o14hIcPmSIEA==} engines: {node: '>= 0.10'} @@ -24350,8 +23069,8 @@ packages: axios: 0.25.0 joi: 17.7.0 lodash: 4.17.21 - minimist: 1.2.7 - rxjs: 7.8.0 + minimist: 1.2.8 + rxjs: 7.8.1 transitivePeerDependencies: - debug dev: true @@ -24415,8 +23134,8 @@ packages: resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} engines: {node: '>= 8'} - /web-vitals@3.3.1: - resolution: {integrity: sha512-LTfY5GjcY3ngFzNsYFSYL+AmVmlWrzPTUxSMDis2rZbf+SzT7HH3NH4Y/l45XOlrAIunOBeURN9qtBHkRskAiA==} + /web-vitals@3.3.2: + resolution: {integrity: sha512-qRkpmSeKfEWAzNhtX541xA8gCJ+pqCqBmUlDVkVDSCSYUvfvNqF+k9g8I+uyreRcDBdfiJrd0/aLbTy5ydo49Q==} dev: false /webcrypto-core@1.7.5: @@ -24486,7 +23205,7 @@ packages: '@types/serve-index': 1.9.1 '@types/serve-static': 1.15.1 '@types/sockjs': 0.3.33 - '@types/ws': 8.5.4 + '@types/ws': 8.5.5 ansi-html-community: 0.0.8 bonjour-service: 1.1.0 chokidar: 3.5.3 @@ -24509,7 +23228,7 @@ packages: spdy: 4.0.2 webpack: 5.75.0 webpack-dev-middleware: 5.3.3(webpack@5.75.0) - ws: 8.12.0 + ws: 8.13.0 transitivePeerDependencies: - bufferutil - debug @@ -24761,10 +23480,10 @@ packages: engines: {node: '>=10.0.0'} dependencies: '@apideck/better-ajv-errors': 0.3.6(ajv@8.12.0) - '@babel/core': 7.20.12 - '@babel/preset-env': 7.20.2(@babel/core@7.20.12) - '@babel/runtime': 7.20.7 - '@rollup/plugin-babel': 5.3.1(@babel/core@7.20.12)(rollup@2.79.1) + '@babel/core': 7.22.5 + '@babel/preset-env': 7.22.4(@babel/core@7.22.5) + '@babel/runtime': 7.22.3 + '@rollup/plugin-babel': 5.3.1(@babel/core@7.22.5)(rollup@2.79.1) '@rollup/plugin-node-resolve': 11.2.1(rollup@2.79.1) '@rollup/plugin-replace': 2.4.2(rollup@2.79.1) '@surma/rollup-plugin-off-main-thread': 2.2.3 @@ -24923,15 +23642,6 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 - /wrap-ansi@8.0.1: - resolution: {integrity: sha512-QFF+ufAqhoYHvoHdajT/Po7KoXVBPXS2bgjIam5isfWJPfIOnQZ50JtUiVvCv/sjgacf3yRrt2ZKUZ/V4itN4g==} - engines: {node: '>=12'} - dependencies: - ansi-styles: 6.2.1 - string-width: 5.1.2 - strip-ansi: 7.1.0 - dev: false - /wrap-ansi@8.1.0: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} @@ -24939,7 +23649,6 @@ packages: ansi-styles: 6.2.1 string-width: 5.1.2 strip-ansi: 7.1.0 - dev: true /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -25035,18 +23744,6 @@ packages: utf-8-validate: optional: true - /ws@8.12.0: - resolution: {integrity: sha512-kU62emKIdKVeEIOIKVegvqpXMSTAMLJozpHZaJNDYqBjzlSYXQGviYwN1osDLJ9av68qHd4a2oSjd7yD4pacig==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - /ws@8.13.0: resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} engines: {node: '>=10.0.0'} @@ -25146,8 +23843,8 @@ packages: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} - /yaml@2.2.1: - resolution: {integrity: sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw==} + /yaml@2.3.1: + resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} engines: {node: '>= 14'} dev: false @@ -25269,14 +23966,14 @@ packages: optionalDependencies: commander: 9.5.0 - /z-schema@6.0.0: - resolution: {integrity: sha512-H9dIbckd1KXqEJ2zVS9rfuI/5HGA/dp11pLsftTPgOanxyDRtLp7sMNmbLh/wvcJKnw2Bj2u3fAPQN91yHhssg==} - engines: {node: '>=8.0.0'} + /z-schema@6.0.1: + resolution: {integrity: sha512-9L2G/s1hJ0bWUfhPRIpY4TZIlBEesnE8NceGrpGIuCmEDTsN98rmGD5tKYgXHlQ/ypEfmZiTP3gnAGW/6gFyhQ==} + engines: {node: '>=16.0.0'} hasBin: true dependencies: lodash.get: 4.4.2 lodash.isequal: 4.5.0 - validator: 13.7.0 + validator: 13.9.0 optionalDependencies: commander: 10.0.1 dev: false