diff --git a/.web5-spec/credentials.ts b/.web5-spec/credentials.ts index 6cd58d55f..849166e7f 100644 --- a/.web5-spec/credentials.ts +++ b/.web5-spec/credentials.ts @@ -9,7 +9,7 @@ export async function credentialIssue(req: Request, res: Response) { const ownDid = await DidKeyMethod.create(); - const vc: VerifiableCredential = VerifiableCredential.create({ + const vc: VerifiableCredential = await VerifiableCredential.create({ type: body.credential.type[body.credential.type.length - 1], issuer: body.credential.issuer, subject: body.credential.credentialSubject["id"] as string, diff --git a/package-lock.json b/package-lock.json index 7ac350677..c20add1e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1081,9 +1081,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.6.1.tgz", - "integrity": "sha512-0WQ0ouLejaUCRsL93GD4uft3rOmB8qoQMU05Kb8CmMtMBe7XUDLAltxVZI1q6byNqEtU7N1ZX1Vw5lIpgulLQA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.8.0.tgz", + "integrity": "sha512-zdTObFRoNENrdPpnTNnhOljYIcOX7aI7+7wyrSpPFFIOf/nRdedE6IYsjaBE7tjukphh1tMTojgJ7p3lKY8x6Q==", "cpu": [ "arm" ], @@ -1094,9 +1094,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.6.1.tgz", - "integrity": "sha512-1TKm25Rn20vr5aTGGZqo6E4mzPicCUD79k17EgTLAsXc1zysyi4xXKACfUbwyANEPAEIxkzwue6JZ+stYzWUTA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.8.0.tgz", + "integrity": "sha512-aiItwP48BiGpMFS9Znjo/xCNQVwTQVcRKkFKsO81m8exrGjHkCBDvm9PHay2kpa8RPnZzzKcD1iQ9KaLY4fPQQ==", "cpu": [ "arm64" ], @@ -1107,9 +1107,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.6.1.tgz", - "integrity": "sha512-cEXJQY/ZqMACb+nxzDeX9IPLAg7S94xouJJCNVE5BJM8JUEP4HeTF+ti3cmxWeSJo+5D+o8Tc0UAWUkfENdeyw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.8.0.tgz", + "integrity": "sha512-zhNIS+L4ZYkYQUjIQUR6Zl0RXhbbA0huvNIWjmPc2SL0cB1h5Djkcy+RZ3/Bwszfb6vgwUvcVJYD6e6Zkpsi8g==", "cpu": [ "arm64" ], @@ -1120,9 +1120,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.6.1.tgz", - "integrity": "sha512-LoSU9Xu56isrkV2jLldcKspJ7sSXmZWkAxg7sW/RfF7GS4F5/v4EiqKSMCFbZtDu2Nc1gxxFdQdKwkKS4rwxNg==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.8.0.tgz", + "integrity": "sha512-A/FAHFRNQYrELrb/JHncRWzTTXB2ticiRFztP4ggIUAfa9Up1qfW8aG2w/mN9jNiZ+HB0t0u0jpJgFXG6BfRTA==", "cpu": [ "x64" ], @@ -1133,9 +1133,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.6.1.tgz", - "integrity": "sha512-EfI3hzYAy5vFNDqpXsNxXcgRDcFHUWSx5nnRSCKwXuQlI5J9dD84g2Usw81n3FLBNsGCegKGwwTVsSKK9cooSQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.8.0.tgz", + "integrity": "sha512-JsidBnh3p2IJJA4/2xOF2puAYqbaczB3elZDT0qHxn362EIoIkq7hrR43Xa8RisgI6/WPfvb2umbGsuvf7E37A==", "cpu": [ "arm" ], @@ -1146,9 +1146,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.6.1.tgz", - "integrity": "sha512-9lhc4UZstsegbNLhH0Zu6TqvDfmhGzuCWtcTFXY10VjLLUe4Mr0Ye2L3rrtHaDd/J5+tFMEuo5LTCSCMXWfUKw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.8.0.tgz", + "integrity": "sha512-hBNCnqw3EVCkaPB0Oqd24bv8SklETptQWcJz06kb9OtiShn9jK1VuTgi7o4zPSt6rNGWQOTDEAccbk0OqJmS+g==", "cpu": [ "arm64" ], @@ -1159,9 +1159,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.6.1.tgz", - "integrity": "sha512-FfoOK1yP5ksX3wwZ4Zk1NgyGHZyuRhf99j64I5oEmirV8EFT7+OhUZEnP+x17lcP/QHJNWGsoJwrz4PJ9fBEXw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.8.0.tgz", + "integrity": "sha512-Fw9ChYfJPdltvi9ALJ9wzdCdxGw4wtq4t1qY028b2O7GwB5qLNSGtqMsAel1lfWTZvf4b6/+4HKp0GlSYg0ahA==", "cpu": [ "arm64" ], @@ -1171,10 +1171,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.8.0.tgz", + "integrity": "sha512-BH5xIh7tOzS9yBi8dFrCTG8Z6iNIGWGltd3IpTSKp6+pNWWO6qy8eKoRxOtwFbMrid5NZaidLYN6rHh9aB8bEw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.6.1.tgz", - "integrity": "sha512-DNGZvZDO5YF7jN5fX8ZqmGLjZEXIJRdJEdTFMhiyXqyXubBa0WVLDWSNlQ5JR2PNgDbEV1VQowhVRUh+74D+RA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.8.0.tgz", + "integrity": "sha512-PmvAj8k6EuWiyLbkNpd6BLv5XeYFpqWuRvRNRl80xVfpGXK/z6KYXmAgbI4ogz7uFiJxCnYcqyvZVD0dgFog7Q==", "cpu": [ "x64" ], @@ -1185,9 +1198,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.6.1.tgz", - "integrity": "sha512-RkJVNVRM+piYy87HrKmhbexCHg3A6Z6MU0W9GHnJwBQNBeyhCJG9KDce4SAMdicQnpURggSvtbGo9xAWOfSvIQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.8.0.tgz", + "integrity": "sha512-mdxnlW2QUzXwY+95TuxZ+CurrhgrPAMveDWI97EQlA9bfhR8tw3Pt7SUlc/eSlCNxlWktpmT//EAA8UfCHOyXg==", "cpu": [ "x64" ], @@ -1198,9 +1211,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.6.1.tgz", - "integrity": "sha512-v2FVT6xfnnmTe3W9bJXl6r5KwJglMK/iRlkKiIFfO6ysKs0rDgz7Cwwf3tjldxQUrHL9INT/1r4VA0n9L/F1vQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.8.0.tgz", + "integrity": "sha512-ge7saUz38aesM4MA7Cad8CHo0Fyd1+qTaqoIo+Jtk+ipBi4ATSrHWov9/S4u5pbEQmLjgUjB7BJt+MiKG2kzmA==", "cpu": [ "arm64" ], @@ -1211,9 +1224,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.6.1.tgz", - "integrity": "sha512-YEeOjxRyEjqcWphH9dyLbzgkF8wZSKAKUkldRY6dgNR5oKs2LZazqGB41cWJ4Iqqcy9/zqYgmzBkRoVz3Q9MLw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.8.0.tgz", + "integrity": "sha512-p9E3PZlzurhlsN5h9g7zIP1DnqKXJe8ZUkFwAazqSvHuWfihlIISPxG9hCHCoA+dOOspL/c7ty1eeEVFTE0UTw==", "cpu": [ "ia32" ], @@ -1224,9 +1237,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.6.1.tgz", - "integrity": "sha512-0zfTlFAIhgz8V2G8STq8toAjsYYA6eci1hnXuyOTUFnymrtJwnS6uGKiv3v5UrPZkBlamLvrLV2iiaeqCKzb0A==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.8.0.tgz", + "integrity": "sha512-kb4/auKXkYKqlUYTE8s40FcJIj5soOyRLHKd4ugR0dCq0G2EfcF54eYcfQiGkHzjidZ40daB4ulsFdtqNKZtBg==", "cpu": [ "x64" ], @@ -1236,14 +1249,6 @@ "win32" ] }, - "node_modules/@scure/base": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", - "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, "node_modules/@sinonjs/commons": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", @@ -1311,11 +1316,6 @@ "resolved": "https://registry.npmjs.org/@sphereon/pex-models/-/pex-models-2.1.2.tgz", "integrity": "sha512-Ec1qZl8tuPd+s6E+ZM7v+HkGkSOjGDMLNN1kqaxAfWpITBYtTLb+d5YvwjvBZ1P2upZ7zwNER97FfW5n/30y2w==" }, - "node_modules/@sphereon/pex/node_modules/jwt-decode": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", - "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" - }, "node_modules/@sphereon/ssi-types": { "version": "0.13.0", "resolved": "https://registry.npmjs.org/@sphereon/ssi-types/-/ssi-types-0.13.0.tgz", @@ -1324,11 +1324,6 @@ "jwt-decode": "^3.1.2" } }, - "node_modules/@sphereon/ssi-types/node_modules/jwt-decode": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", - "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" - }, "node_modules/@tbd54566975/dwn-sdk-js": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/@tbd54566975/dwn-sdk-js/-/dwn-sdk-js-0.2.8.tgz", @@ -1403,14 +1398,6 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" }, - "node_modules/@tbd54566975/dwn-sdk-js/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/@tbd54566975/dwn-sdk-js/node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -1687,9 +1674,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.10.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz", - "integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==", + "version": "20.10.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", + "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -1832,16 +1819,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.2.tgz", - "integrity": "sha512-MUkcC+7Wt/QOGeVlM8aGGJZy1XV5YKjTpq9jK6r6/iLsGXhBVaGP5N0UYvFsu9BFlSpwY9kMretzdBH01rkRXg==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.14.0.tgz", + "integrity": "sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.13.2", - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/typescript-estree": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2", + "@typescript-eslint/scope-manager": "6.14.0", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4" }, "engines": { @@ -1861,14 +1848,14 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.2.tgz", - "integrity": "sha512-CXQA0xo7z6x13FeDYCgBkjWzNqzBn8RXaE3QVQVIUm74fWJLkJkaHmHdKStrxQllGh6Q4eUGyNpMe0b1hMkXFA==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", + "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2" + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1879,13 +1866,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.2.tgz", - "integrity": "sha512-OGznFs0eAQXJsp+xSd6k/O1UbFi/K/L7WjqeRoFE7vadjAF9y0uppXhYNQNEqygjou782maGClOoZwPqF0Drlw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", + "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", + "@typescript-eslint/types": "6.14.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1994,9 +1981,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.2.tgz", - "integrity": "sha512-7sxbQ+EMRubQc3wTfTsycgYpSujyVbI1xw+3UMRUcrhSy+pN09y/lWzeKDbvhoqcRbHdc+APLs/PWYi/cisLPg==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", + "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", "dev": true, "peer": true, "engines": { @@ -2008,14 +1995,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.2.tgz", - "integrity": "sha512-SuD8YLQv6WHnOEtKv8D6HZUzOub855cfPnPMKvdM/Bh1plv1f7Q/0iFUDLKKlxHcEstQnaUU4QZskgQq74t+3w==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", + "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", - "@typescript-eslint/visitor-keys": "6.13.2", + "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/visitor-keys": "6.14.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2036,13 +2023,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.13.2", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.2.tgz", - "integrity": "sha512-OGznFs0eAQXJsp+xSd6k/O1UbFi/K/L7WjqeRoFE7vadjAF9y0uppXhYNQNEqygjou782maGClOoZwPqF0Drlw==", + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", + "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", "dev": true, "peer": true, "dependencies": { - "@typescript-eslint/types": "6.13.2", + "@typescript-eslint/types": "6.14.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3529,9 +3516,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001566", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001566.tgz", - "integrity": "sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==", + "version": "1.0.30001568", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001568.tgz", + "integrity": "sha512-vSUkH84HontZJ88MiNrOau1EBrCqEQYgkC5gIySiDlpsm8sGVrhU7Kx4V6h0tnqaHzIHZv08HlJIwPbL4XL9+A==", "dev": true, "funding": [ { @@ -4448,27 +4435,6 @@ "integrity": "sha512-hyWmRrexdhbZ1tcJUGpO95ivbRhWXz++F4Ko+n21AY5PNln2ovoJw+8ZMNDTtip+CNFQfrtLVh/w4009dXO/eQ==", "dev": true }, - "node_modules/did-jwt": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/did-jwt/-/did-jwt-7.4.5.tgz", - "integrity": "sha512-PjUFy/yhYeivNrQI5EaqYvF+cRL0itARQlXPfAnUUcj4tm40fzCU/0yWkhAoAPfM41e8O+QVRqOXwg0cZjlVeg==", - "dependencies": { - "@noble/ciphers": "^0.4.0", - "@noble/curves": "^1.0.0", - "@noble/hashes": "^1.3.0", - "@scure/base": "^1.1.3", - "canonicalize": "^2.0.0", - "did-resolver": "^4.1.0", - "multibase": "^4.0.6", - "multiformats": "^9.6.2", - "uint8arrays": "3.1.1" - } - }, - "node_modules/did-jwt/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" - }, "node_modules/did-resolver": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/did-resolver/-/did-resolver-4.1.0.tgz", @@ -4581,9 +4547,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.605", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.605.tgz", - "integrity": "sha512-V52j+P5z6cdRqTjPR/bYNxx7ETCHIkm5VIGuyCy3CMrfSnbEpIlLnk5oHmZo7gYvDfh2TfHeanB6rawyQ23ktg==", + "version": "1.4.610", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.610.tgz", + "integrity": "sha512-mqi2oL1mfeHYtOdCxbPQYV/PL7YrQlxbvFEZ0Ee8GbDdShimqt2/S6z2RWqysuvlwdOrQdqvE0KZrBTipAeJzg==", "dev": true, "peer": true }, @@ -5676,9 +5642,9 @@ } }, "node_modules/globals": { - "version": "13.23.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", - "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==", + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -5768,23 +5734,6 @@ "npm": ">=7.0.0" } }, - "node_modules/hamt-sharding/node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/hamt-sharding/node_modules/uint8arrays": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz", - "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -6203,23 +6152,6 @@ "npm": ">=7.0.0" } }, - "node_modules/ipfs-unixfs-exporter/node_modules/uint8arrays": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz", - "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, - "node_modules/ipfs-unixfs-exporter/node_modules/uint8arrays/node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/ipfs-unixfs-importer": { "version": "15.1.5", "resolved": "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-15.1.5.tgz", @@ -6247,23 +6179,6 @@ "npm": ">=7.0.0" } }, - "node_modules/ipfs-unixfs-importer/node_modules/uint8arrays": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz", - "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, - "node_modules/ipfs-unixfs-importer/node_modules/uint8arrays/node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, "node_modules/is-arguments": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", @@ -6967,12 +6882,9 @@ "dev": true }, "node_modules/jwt-decode": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-4.0.0.tgz", - "integrity": "sha512-+KJGIyHgkGuIq3IEBNftfhW/LfWhXUIY6OmyVWjliu5KH1y0fw7VQ8YndE2O4qZdMSd9SqbnC8GOcZEy0Om7sA==", - "engines": { - "node": ">=18" - } + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-3.1.2.tgz", + "integrity": "sha512-UfpWE/VZn0iP50d8cz9NrZLM9lSWhcJ+0Gt/nm4by88UL+J1SiKN8/5dkjMmbEzwL2CAe+67GsegCbIKtbp75A==" }, "node_modules/k-bucket": { "version": "5.1.0", @@ -7956,6 +7868,19 @@ "npm": ">=6.0.0" } }, + "node_modules/multihashes/node_modules/multiformats": { + "version": "9.9.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", + "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" + }, + "node_modules/multihashes/node_modules/uint8arrays": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", + "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", + "dependencies": { + "multiformats": "^9.4.2" + } + }, "node_modules/multihashes/node_modules/varint": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/varint/-/varint-5.0.2.tgz", @@ -8858,23 +8783,6 @@ "uint8arrays": "^4.0.6" } }, - "node_modules/protons-runtime/node_modules/multiformats": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", - "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", - "engines": { - "node": ">=16.0.0", - "npm": ">=7.0.0" - } - }, - "node_modules/protons-runtime/node_modules/uint8arrays": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz", - "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, "node_modules/proxy-agent": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.0.tgz", @@ -9467,9 +9375,9 @@ } }, "node_modules/rollup": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.6.1.tgz", - "integrity": "sha512-jZHaZotEHQaHLgKr8JnQiDT1rmatjgKlMekyksz+yk9jt/8z9quNjnKNRoaM0wd9DC2QKXjmWWuDYtM3jfF8pQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.8.0.tgz", + "integrity": "sha512-NpsklK2fach5CdI+PScmlE5R4Ao/FSWtF7LkoIrHDxPACY/xshNasPsbpG0VVHxUTbf74tJbVT4PrP8JsJ6ZDA==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -9479,18 +9387,19 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.6.1", - "@rollup/rollup-android-arm64": "4.6.1", - "@rollup/rollup-darwin-arm64": "4.6.1", - "@rollup/rollup-darwin-x64": "4.6.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.6.1", - "@rollup/rollup-linux-arm64-gnu": "4.6.1", - "@rollup/rollup-linux-arm64-musl": "4.6.1", - "@rollup/rollup-linux-x64-gnu": "4.6.1", - "@rollup/rollup-linux-x64-musl": "4.6.1", - "@rollup/rollup-win32-arm64-msvc": "4.6.1", - "@rollup/rollup-win32-ia32-msvc": "4.6.1", - "@rollup/rollup-win32-x64-msvc": "4.6.1", + "@rollup/rollup-android-arm-eabi": "4.8.0", + "@rollup/rollup-android-arm64": "4.8.0", + "@rollup/rollup-darwin-arm64": "4.8.0", + "@rollup/rollup-darwin-x64": "4.8.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.8.0", + "@rollup/rollup-linux-arm64-gnu": "4.8.0", + "@rollup/rollup-linux-arm64-musl": "4.8.0", + "@rollup/rollup-linux-riscv64-gnu": "4.8.0", + "@rollup/rollup-linux-x64-gnu": "4.8.0", + "@rollup/rollup-linux-x64-musl": "4.8.0", + "@rollup/rollup-win32-arm64-msvc": "4.8.0", + "@rollup/rollup-win32-ia32-msvc": "4.8.0", + "@rollup/rollup-win32-x64-msvc": "4.8.0", "fsevents": "~2.3.2" } }, @@ -10287,9 +10196,9 @@ } }, "node_modules/streamx": { - "version": "2.15.5", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.5.tgz", - "integrity": "sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg==", + "version": "2.15.6", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz", + "integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==", "dev": true, "dependencies": { "fast-fifo": "^1.1.0", @@ -10582,9 +10491,9 @@ } }, "node_modules/terser": { - "version": "5.25.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.25.0.tgz", - "integrity": "sha512-we0I9SIsfvNUMP77zC9HG+MylwYYsGFSBG8qm+13oud2Yh+O104y614FRbyjpxys16jZwot72Fpi827YvGzuqg==", + "version": "5.26.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.26.0.tgz", + "integrity": "sha512-dytTGoE2oHgbNV9nTzgBEPaqAWvcJNl66VZ0BkJqlvp71IjO8CxdBx/ykCNb47cLnCmCvRZ6ZR0tLkqvZCdVBQ==", "dev": true, "peer": true, "dependencies": { @@ -10891,11 +10800,10 @@ } }, "node_modules/typescript": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.2.tgz", - "integrity": "sha512-6l+RyNy7oAHDfxC4FzSJcz9vnjTKxrLpDG5M2Vu4SHRVNg6xzqZp6LYSR9zjqQTu8DU/f5xwxUdADOkbrIX2gQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -10929,7 +10837,15 @@ "uint8arrays": "^4.0.2" } }, - "node_modules/uint8arraylist/node_modules/multiformats": { + "node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, + "node_modules/uint8arrays/node_modules/multiformats": { "version": "12.1.3", "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-12.1.3.tgz", "integrity": "sha512-eajQ/ZH7qXZQR2AgtfpmSMizQzmyYVmCql7pdhldPuYQi4atACekbJaQplk6dWyIi10jCaFnd6pqvcEFXjbaJw==", @@ -10938,27 +10854,6 @@ "npm": ">=7.0.0" } }, - "node_modules/uint8arraylist/node_modules/uint8arrays": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.9.tgz", - "integrity": "sha512-iHU8XJJnfeijILZWzV7RgILdPHqe0mjJvyzY4mO8aUUtHsDbPa2Gc8/02Kc4zeokp2W6Qq8z9Ap1xkQ1HfbKwg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, - "node_modules/uint8arrays": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", - "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", - "dependencies": { - "multiformats": "^9.4.2" - } - }, - "node_modules/uint8arrays/node_modules/multiformats": { - "version": "9.9.0", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-9.9.0.tgz", - "integrity": "sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==" - }, "node_modules/ulidx": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/ulidx/-/ulidx-2.1.0.tgz", @@ -11118,13 +11013,9 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/uuid": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", - "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", - "funding": [ - "https://github.com/sponsors/broofa", - "https://github.com/sponsors/ctavan" - ], + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", "bin": { "uuid": "dist/bin/uuid" } @@ -11707,14 +11598,16 @@ }, "packages/agent/node_modules/@noble/ciphers": { "version": "0.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.1.4.tgz", + "integrity": "sha512-d3ZR8vGSpy3v/nllS+bD/OMN5UZqusWiQqkyj7AwzTnhXFH72pF5oB4Ach6DQ50g5kXxC28LdaYBEpsyv9KOUQ==", "funding": { "url": "https://paulmillr.com/funding/" } }, "packages/agent/node_modules/@noble/curves": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", "dependencies": { "@noble/hashes": "1.3.1" }, @@ -11724,7 +11617,8 @@ }, "packages/agent/node_modules/@noble/hashes": { "version": "1.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", "engines": { "node": ">= 16" }, @@ -11734,8 +11628,9 @@ }, "packages/agent/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -11761,8 +11656,9 @@ }, "packages/agent/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -11773,8 +11669,9 @@ }, "packages/agent/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -11799,7 +11696,8 @@ }, "packages/agent/node_modules/@web5/crypto": { "version": "0.2.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@web5/crypto/-/crypto-0.2.2.tgz", + "integrity": "sha512-vHFg0wXQSQXrwuBNQyDHnmSZchfTfO6/Sv+7rDsNkvofs+6lGTE8CZ02cwUYMeIwTRMLer12c+fMfzYrXokEUQ==", "dependencies": { "@noble/ciphers": "0.1.4", "@noble/curves": "1.1.0", @@ -11824,8 +11722,9 @@ }, "packages/agent/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -11839,8 +11738,9 @@ }, "packages/agent/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -11853,8 +11753,9 @@ }, "packages/agent/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -11868,8 +11769,9 @@ }, "packages/agent/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -11879,13 +11781,15 @@ }, "packages/agent/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/agent/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -11895,8 +11799,9 @@ }, "packages/agent/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -11948,8 +11853,9 @@ }, "packages/agent/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -11959,21 +11865,24 @@ }, "packages/agent/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/agent/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/agent/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -11981,19 +11890,6 @@ "node": ">=8" } }, - "packages/agent/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/api": { "name": "@web5/api", "version": "0.8.3", @@ -12043,14 +11939,16 @@ }, "packages/api/node_modules/@noble/ciphers": { "version": "0.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.1.4.tgz", + "integrity": "sha512-d3ZR8vGSpy3v/nllS+bD/OMN5UZqusWiQqkyj7AwzTnhXFH72pF5oB4Ach6DQ50g5kXxC28LdaYBEpsyv9KOUQ==", "funding": { "url": "https://paulmillr.com/funding/" } }, "packages/api/node_modules/@noble/curves": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", "dependencies": { "@noble/hashes": "1.3.1" }, @@ -12060,7 +11958,8 @@ }, "packages/api/node_modules/@noble/hashes": { "version": "1.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", "engines": { "node": ">= 16" }, @@ -12070,8 +11969,9 @@ }, "packages/api/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -12097,8 +11997,9 @@ }, "packages/api/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -12109,8 +12010,9 @@ }, "packages/api/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -12135,7 +12037,8 @@ }, "packages/api/node_modules/@web5/crypto": { "version": "0.2.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@web5/crypto/-/crypto-0.2.2.tgz", + "integrity": "sha512-vHFg0wXQSQXrwuBNQyDHnmSZchfTfO6/Sv+7rDsNkvofs+6lGTE8CZ02cwUYMeIwTRMLer12c+fMfzYrXokEUQ==", "dependencies": { "@noble/ciphers": "0.1.4", "@noble/curves": "1.1.0", @@ -12160,8 +12063,9 @@ }, "packages/api/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -12175,8 +12079,9 @@ }, "packages/api/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -12189,8 +12094,9 @@ }, "packages/api/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -12204,8 +12110,9 @@ }, "packages/api/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -12215,13 +12122,15 @@ }, "packages/api/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/api/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -12231,8 +12140,9 @@ }, "packages/api/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -12284,8 +12194,9 @@ }, "packages/api/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -12295,21 +12206,24 @@ }, "packages/api/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/api/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/api/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -12317,19 +12231,6 @@ "node": ">=8" } }, - "packages/api/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/common": { "name": "@web5/common", "version": "0.2.2", @@ -12367,8 +12268,9 @@ }, "packages/common/node_modules/@types/readable-stream": { "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.9.tgz", + "integrity": "sha512-4cwuvrmNF96M4Nrx0Eep37RwPB1Mth+nCSezsGRv5+PsFyRvDdLd0pil6gVLcWD/bh69INNdwZ98dJwfHpLohA==", "dev": true, - "license": "MIT", "dependencies": { "@types/node": "*", "safe-buffer": "~5.1.1" @@ -12376,8 +12278,9 @@ }, "packages/common/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -12403,8 +12306,9 @@ }, "packages/common/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -12415,8 +12319,9 @@ }, "packages/common/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -12441,8 +12346,9 @@ }, "packages/common/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -12456,8 +12362,9 @@ }, "packages/common/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -12470,8 +12377,9 @@ }, "packages/common/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -12485,8 +12393,9 @@ }, "packages/common/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -12496,13 +12405,15 @@ }, "packages/common/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/common/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -12512,8 +12423,9 @@ }, "packages/common/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -12565,8 +12477,9 @@ }, "packages/common/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -12576,21 +12489,24 @@ }, "packages/common/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/common/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/common/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -12598,28 +12514,15 @@ "node": ">=8" } }, - "packages/common/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/credentials": { "name": "@web5/credentials", - "version": "0.3.2", + "version": "0.4.0", "license": "Apache-2.0", "dependencies": { "@sphereon/pex": "2.1.0", - "did-jwt": "^7.2.6", - "jwt-decode": "4.0.0", - "uuid": "^9.0.0" + "@web5/common": "0.2.2", + "@web5/crypto": "0.2.4", + "@web5/dids": "0.2.3" }, "devDependencies": { "@playwright/test": "1.40.1", @@ -12630,9 +12533,6 @@ "@typescript-eslint/parser": "6.4.0", "@web/test-runner": "0.18.0", "@web/test-runner-playwright": "0.11.0", - "@web5/common": "0.2.2", - "@web5/crypto": "0.2.3", - "@web5/dids": "0.2.3", "c8": "8.0.1", "chai": "4.3.10", "esbuild": "0.19.8", @@ -12649,8 +12549,9 @@ }, "packages/credentials/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -12676,8 +12577,9 @@ }, "packages/credentials/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -12688,8 +12590,9 @@ }, "packages/credentials/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -12714,8 +12617,9 @@ }, "packages/credentials/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -12729,8 +12633,9 @@ }, "packages/credentials/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -12743,8 +12648,9 @@ }, "packages/credentials/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -12758,8 +12664,9 @@ }, "packages/credentials/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -12769,13 +12676,15 @@ }, "packages/credentials/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/credentials/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -12785,8 +12694,9 @@ }, "packages/credentials/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -12838,8 +12748,9 @@ }, "packages/credentials/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -12849,21 +12760,24 @@ }, "packages/credentials/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/credentials/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/credentials/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -12871,22 +12785,9 @@ "node": ">=8" } }, - "packages/credentials/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/crypto": { "name": "@web5/crypto", - "version": "0.2.3", + "version": "0.2.4", "license": "Apache-2.0", "dependencies": { "@noble/ciphers": "0.4.0", @@ -12926,8 +12827,9 @@ }, "packages/crypto/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -12953,8 +12855,9 @@ }, "packages/crypto/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -12965,8 +12868,9 @@ }, "packages/crypto/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -12991,8 +12895,9 @@ }, "packages/crypto/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -13006,8 +12911,9 @@ }, "packages/crypto/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -13020,8 +12926,9 @@ }, "packages/crypto/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -13035,8 +12942,9 @@ }, "packages/crypto/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -13046,13 +12954,15 @@ }, "packages/crypto/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/crypto/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -13062,8 +12972,9 @@ }, "packages/crypto/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -13115,8 +13026,9 @@ }, "packages/crypto/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -13126,21 +13038,24 @@ }, "packages/crypto/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/crypto/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/crypto/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -13148,19 +13063,6 @@ "node": ">=8" } }, - "packages/crypto/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/dids": { "name": "@web5/dids", "version": "0.2.3", @@ -13208,14 +13110,16 @@ }, "packages/dids/node_modules/@noble/ciphers": { "version": "0.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.1.4.tgz", + "integrity": "sha512-d3ZR8vGSpy3v/nllS+bD/OMN5UZqusWiQqkyj7AwzTnhXFH72pF5oB4Ach6DQ50g5kXxC28LdaYBEpsyv9KOUQ==", "funding": { "url": "https://paulmillr.com/funding/" } }, "packages/dids/node_modules/@noble/curves": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", "dependencies": { "@noble/hashes": "1.3.1" }, @@ -13225,7 +13129,8 @@ }, "packages/dids/node_modules/@noble/hashes": { "version": "1.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", "engines": { "node": ">= 16" }, @@ -13235,8 +13140,9 @@ }, "packages/dids/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -13262,8 +13168,9 @@ }, "packages/dids/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -13274,8 +13181,9 @@ }, "packages/dids/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -13300,7 +13208,8 @@ }, "packages/dids/node_modules/@web5/crypto": { "version": "0.2.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@web5/crypto/-/crypto-0.2.2.tgz", + "integrity": "sha512-vHFg0wXQSQXrwuBNQyDHnmSZchfTfO6/Sv+7rDsNkvofs+6lGTE8CZ02cwUYMeIwTRMLer12c+fMfzYrXokEUQ==", "dependencies": { "@noble/ciphers": "0.1.4", "@noble/curves": "1.1.0", @@ -13325,8 +13234,9 @@ }, "packages/dids/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -13340,8 +13250,9 @@ }, "packages/dids/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -13354,8 +13265,9 @@ }, "packages/dids/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -13369,8 +13281,9 @@ }, "packages/dids/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -13380,13 +13293,15 @@ }, "packages/dids/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/dids/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -13396,8 +13311,9 @@ }, "packages/dids/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -13449,8 +13365,9 @@ }, "packages/dids/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -13460,21 +13377,24 @@ }, "packages/dids/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/dids/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/dids/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -13482,19 +13402,6 @@ "node": ">=8" } }, - "packages/dids/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/identity-agent": { "name": "@web5/identity-agent", "version": "0.2.5", @@ -13534,14 +13441,16 @@ }, "packages/identity-agent/node_modules/@noble/ciphers": { "version": "0.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.1.4.tgz", + "integrity": "sha512-d3ZR8vGSpy3v/nllS+bD/OMN5UZqusWiQqkyj7AwzTnhXFH72pF5oB4Ach6DQ50g5kXxC28LdaYBEpsyv9KOUQ==", "funding": { "url": "https://paulmillr.com/funding/" } }, "packages/identity-agent/node_modules/@noble/curves": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", "dependencies": { "@noble/hashes": "1.3.1" }, @@ -13551,7 +13460,8 @@ }, "packages/identity-agent/node_modules/@noble/hashes": { "version": "1.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", "engines": { "node": ">= 16" }, @@ -13561,8 +13471,9 @@ }, "packages/identity-agent/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -13588,8 +13499,9 @@ }, "packages/identity-agent/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -13600,8 +13512,9 @@ }, "packages/identity-agent/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -13626,7 +13539,8 @@ }, "packages/identity-agent/node_modules/@web5/crypto": { "version": "0.2.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@web5/crypto/-/crypto-0.2.2.tgz", + "integrity": "sha512-vHFg0wXQSQXrwuBNQyDHnmSZchfTfO6/Sv+7rDsNkvofs+6lGTE8CZ02cwUYMeIwTRMLer12c+fMfzYrXokEUQ==", "dependencies": { "@noble/ciphers": "0.1.4", "@noble/curves": "1.1.0", @@ -13651,8 +13565,9 @@ }, "packages/identity-agent/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -13666,8 +13581,9 @@ }, "packages/identity-agent/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -13680,8 +13596,9 @@ }, "packages/identity-agent/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -13695,8 +13612,9 @@ }, "packages/identity-agent/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -13706,13 +13624,15 @@ }, "packages/identity-agent/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/identity-agent/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -13722,8 +13642,9 @@ }, "packages/identity-agent/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -13775,8 +13696,9 @@ }, "packages/identity-agent/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -13786,21 +13708,24 @@ }, "packages/identity-agent/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/identity-agent/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/identity-agent/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -13808,19 +13733,6 @@ "node": ">=8" } }, - "packages/identity-agent/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/proxy-agent": { "name": "@web5/proxy-agent", "version": "0.2.5", @@ -13859,14 +13771,16 @@ }, "packages/proxy-agent/node_modules/@noble/ciphers": { "version": "0.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.1.4.tgz", + "integrity": "sha512-d3ZR8vGSpy3v/nllS+bD/OMN5UZqusWiQqkyj7AwzTnhXFH72pF5oB4Ach6DQ50g5kXxC28LdaYBEpsyv9KOUQ==", "funding": { "url": "https://paulmillr.com/funding/" } }, "packages/proxy-agent/node_modules/@noble/curves": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", "dependencies": { "@noble/hashes": "1.3.1" }, @@ -13876,7 +13790,8 @@ }, "packages/proxy-agent/node_modules/@noble/hashes": { "version": "1.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", "engines": { "node": ">= 16" }, @@ -13886,8 +13801,9 @@ }, "packages/proxy-agent/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -13913,8 +13829,9 @@ }, "packages/proxy-agent/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -13925,8 +13842,9 @@ }, "packages/proxy-agent/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -13951,7 +13869,8 @@ }, "packages/proxy-agent/node_modules/@web5/crypto": { "version": "0.2.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@web5/crypto/-/crypto-0.2.2.tgz", + "integrity": "sha512-vHFg0wXQSQXrwuBNQyDHnmSZchfTfO6/Sv+7rDsNkvofs+6lGTE8CZ02cwUYMeIwTRMLer12c+fMfzYrXokEUQ==", "dependencies": { "@noble/ciphers": "0.1.4", "@noble/curves": "1.1.0", @@ -13976,8 +13895,9 @@ }, "packages/proxy-agent/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -13991,8 +13911,9 @@ }, "packages/proxy-agent/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -14005,8 +13926,9 @@ }, "packages/proxy-agent/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -14020,8 +13942,9 @@ }, "packages/proxy-agent/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -14031,13 +13954,15 @@ }, "packages/proxy-agent/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/proxy-agent/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -14047,8 +13972,9 @@ }, "packages/proxy-agent/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -14100,8 +14026,9 @@ }, "packages/proxy-agent/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -14111,21 +14038,24 @@ }, "packages/proxy-agent/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/proxy-agent/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/proxy-agent/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, @@ -14133,19 +14063,6 @@ "node": ">=8" } }, - "packages/proxy-agent/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "packages/user-agent": { "name": "@web5/user-agent", "version": "0.2.5", @@ -14184,14 +14101,16 @@ }, "packages/user-agent/node_modules/@noble/ciphers": { "version": "0.1.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.1.4.tgz", + "integrity": "sha512-d3ZR8vGSpy3v/nllS+bD/OMN5UZqusWiQqkyj7AwzTnhXFH72pF5oB4Ach6DQ50g5kXxC28LdaYBEpsyv9KOUQ==", "funding": { "url": "https://paulmillr.com/funding/" } }, "packages/user-agent/node_modules/@noble/curves": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", "dependencies": { "@noble/hashes": "1.3.1" }, @@ -14201,7 +14120,8 @@ }, "packages/user-agent/node_modules/@noble/hashes": { "version": "1.3.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", "engines": { "node": ">= 16" }, @@ -14211,8 +14131,9 @@ }, "packages/user-agent/node_modules/@typescript-eslint/parser": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.4.0.tgz", + "integrity": "sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "6.4.0", "@typescript-eslint/types": "6.4.0", @@ -14238,8 +14159,9 @@ }, "packages/user-agent/node_modules/@typescript-eslint/types": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.4.0.tgz", + "integrity": "sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==", "dev": true, - "license": "MIT", "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -14250,8 +14172,9 @@ }, "packages/user-agent/node_modules/@typescript-eslint/typescript-estree": { "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.4.0.tgz", + "integrity": "sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/types": "6.4.0", "@typescript-eslint/visitor-keys": "6.4.0", @@ -14276,7 +14199,8 @@ }, "packages/user-agent/node_modules/@web5/crypto": { "version": "0.2.2", - "license": "Apache-2.0", + "resolved": "https://registry.npmjs.org/@web5/crypto/-/crypto-0.2.2.tgz", + "integrity": "sha512-vHFg0wXQSQXrwuBNQyDHnmSZchfTfO6/Sv+7rDsNkvofs+6lGTE8CZ02cwUYMeIwTRMLer12c+fMfzYrXokEUQ==", "dependencies": { "@noble/ciphers": "0.1.4", "@noble/curves": "1.1.0", @@ -14301,8 +14225,9 @@ }, "packages/user-agent/node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -14316,8 +14241,9 @@ }, "packages/user-agent/node_modules/ansi-styles": { "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -14330,8 +14256,9 @@ }, "packages/user-agent/node_modules/chalk": { "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -14345,8 +14272,9 @@ }, "packages/user-agent/node_modules/color-convert": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -14356,13 +14284,15 @@ }, "packages/user-agent/node_modules/color-name": { "version": "1.1.4", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, "packages/user-agent/node_modules/escape-string-regexp": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "license": "MIT", "engines": { "node": ">=10" }, @@ -14372,8 +14302,9 @@ }, "packages/user-agent/node_modules/eslint": { "version": "8.47.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.47.0.tgz", + "integrity": "sha512-spUQWrdPt+pRVP1TTJLmfRNJJHHZryFmptzcafwSvHsceV81djHOdnEeDmkdotZyLNjDhrOasNK8nikkoG1O8Q==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -14425,8 +14356,9 @@ }, "packages/user-agent/node_modules/glob-parent": { "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "ISC", "dependencies": { "is-glob": "^4.0.3" }, @@ -14436,40 +14368,30 @@ }, "packages/user-agent/node_modules/has-flag": { "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=8" } }, "packages/user-agent/node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "packages/user-agent/node_modules/supports-color": { "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "license": "MIT", "dependencies": { "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } - }, - "packages/user-agent/node_modules/typescript": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", - "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } } } } diff --git a/packages/credentials/package.json b/packages/credentials/package.json index 13f740f0d..6a2e45baa 100644 --- a/packages/credentials/package.json +++ b/packages/credentials/package.json @@ -1,6 +1,6 @@ { "name": "@web5/credentials", - "version": "0.3.2", + "version": "0.4.0", "description": "Verifiable Credentials", "type": "module", "main": "./dist/cjs/index.js", @@ -75,9 +75,9 @@ }, "dependencies": { "@sphereon/pex": "2.1.0", - "did-jwt": "^7.2.6", - "jwt-decode": "4.0.0", - "uuid": "^9.0.0" + "@web5/common": "0.2.2", + "@web5/crypto": "0.2.4", + "@web5/dids": "0.2.3" }, "devDependencies": { "@playwright/test": "1.40.1", @@ -88,9 +88,6 @@ "@typescript-eslint/parser": "6.4.0", "@web/test-runner": "0.18.0", "@web/test-runner-playwright": "0.11.0", - "@web5/crypto": "0.2.3", - "@web5/common": "0.2.2", - "@web5/dids": "0.2.3", "c8": "8.0.1", "chai": "4.3.10", "esbuild": "0.19.8", diff --git a/packages/credentials/src/index.ts b/packages/credentials/src/index.ts index 07b19e24c..55ad631b3 100644 --- a/packages/credentials/src/index.ts +++ b/packages/credentials/src/index.ts @@ -1,3 +1,4 @@ -export * from './verifiable-credential.js'; +export * from './jwt.js'; export * from './presentation-exchange.js'; +export * from './verifiable-credential.js'; export * as utils from './utils.js'; \ No newline at end of file diff --git a/packages/credentials/src/jwt.ts b/packages/credentials/src/jwt.ts new file mode 100644 index 000000000..13317ec37 --- /dev/null +++ b/packages/credentials/src/jwt.ts @@ -0,0 +1,263 @@ +import type { PortableDid } from '@web5/dids'; +import type { + JwtPayload, + Web5Crypto, + CryptoAlgorithm, + JwtHeaderParams, + JwkParamsEcPrivate, + JwkParamsOkpPrivate, + JwkParamsEcPublic, + JwkParamsOkpPublic, +} from '@web5/crypto'; + +import { Convert } from '@web5/common'; +import { EdDsaAlgorithm, EcdsaAlgorithm } from '@web5/crypto'; +import { DidDhtMethod, DidIonMethod, DidKeyMethod, DidResolver, utils as didUtils } from '@web5/dids'; + +/** + * Result of parsing a JWT. + */ +export type JwtParseResult = { + decoded: JwtVerifyResult + encoded: { + header: string + payload: string + signature: string + } +} + +/** + * Result of verifying a JWT. + */ +export interface JwtVerifyResult { + /** JWT Protected Header */ + header: JwtHeaderParams; + + /** JWT Claims Set */ + payload: JwtPayload; +} + +/** + * Parameters for parsing a JWT. + * used in {@link Jwt.parse} + */ +export type ParseJwtOptions = { + jwt: string +} + +/** + * Parameters for signing a JWT. + */ +export type SignJwtOptions = { + signerDid: PortableDid + payload: JwtPayload +} + +/** + * Parameters for verifying a JWT. + */ +export type VerifyJwtOptions = { + jwt: string +} + +/** + * Represents a signer with a specific cryptographic algorithm and options. + * @template T - The type of cryptographic options. + */ +type Signer = { + signer: CryptoAlgorithm, + options?: T | undefined + alg: string + crv: string +} + +const secp256k1Signer: Signer = { + signer : new EcdsaAlgorithm(), + options : { name: 'ES256K'}, + alg : 'ES256K', + crv : 'secp256k1' +}; + +const ed25519Signer: Signer = { + signer : new EdDsaAlgorithm(), + options : { name: 'EdDSA' }, + alg : 'EdDSA', + crv : 'Ed25519' +}; + +/** + * Class for handling Compact JSON Web Tokens (JWTs). + * This class provides methods to create, verify, and decode JWTs using various cryptographic algorithms. + * More information on JWTs can be found [here](https://datatracker.ietf.org/doc/html/rfc7519) + */ +export class Jwt { + /** supported cryptographic algorithms. keys are `${alg}:${crv}`. */ + static algorithms: { [alg: string]: Signer } = { + 'ES256K:' : secp256k1Signer, + 'ES256K:secp256k1' : secp256k1Signer, + ':secp256k1' : secp256k1Signer, + 'EdDSA:Ed25519' : ed25519Signer + }; + + /** + * DID Resolver instance for resolving decentralized identifiers. + */ + static didResolver: DidResolver = new DidResolver({ didResolvers: [DidIonMethod, DidKeyMethod, DidDhtMethod] }); + + /** + * Creates a signed JWT. + * + * @example + * ```ts + * const jwt = await Jwt.sign({ signerDid: myDid, payload: myPayload }); + * ``` + * + * @param options - Parameters for JWT creation including signer DID and payload. + * @returns The compact JWT as a string. + */ + static async sign(options: SignJwtOptions): Promise { + const { signerDid, payload } = options; + const privateKeyJwk = signerDid.keySet.verificationMethodKeys![0].privateKeyJwk! as JwkParamsEcPrivate | JwkParamsOkpPrivate; + + let vmId = signerDid.document.verificationMethod![0].id; + if (vmId.charAt(0) === '#') { + vmId = `${signerDid.did}${vmId}`; + } + + const header: JwtHeaderParams = { + typ : 'JWT', + alg : privateKeyJwk.alg!, + kid : vmId + }; + + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + const base64UrlEncodedPayload = Convert.object(payload).toBase64Url(); + + const toSign = `${base64UrlEncodedHeader}.${base64UrlEncodedPayload}`; + const toSignBytes = Convert.string(toSign).toUint8Array(); + + const algorithmId = `${header.alg}:${privateKeyJwk['crv'] || ''}`; + if (!(algorithmId in Jwt.algorithms)) { + throw new Error(`Signing failed: ${algorithmId} not supported`); + } + + const { signer, options: signatureAlgorithm } = Jwt.algorithms[algorithmId]; + + const signatureBytes = await signer.sign({ key: privateKeyJwk, data: toSignBytes, algorithm: signatureAlgorithm! }); + const base64UrlEncodedSignature = Convert.uint8Array(signatureBytes).toBase64Url(); + + return `${toSign}.${base64UrlEncodedSignature}`; + } + + /** + * Verifies a JWT. + * + * @example + * ```ts + * const verifiedJwt = await Jwt.verify({ jwt: myJwt }); + * ``` + * + * @param options - Parameters for JWT verification + * @returns Verified JWT information including signer DID, header, and payload. + */ + static async verify(options: VerifyJwtOptions): Promise { + const { decoded: decodedJwt, encoded: encodedJwt } = Jwt.parse({ jwt: options.jwt }); + + // TODO: should really be looking for verificationMethod with authentication verification relationship + const dereferenceResult = await Jwt.didResolver.dereference({ didUrl: decodedJwt.header.kid! }); + if (dereferenceResult.dereferencingMetadata.error) { + throw new Error(`Failed to resolve ${decodedJwt.header.kid}`); + } + + const verificationMethod = dereferenceResult.contentStream; + if (!verificationMethod || !didUtils.isVerificationMethod(verificationMethod)) { // ensure that appropriate verification method was found + throw new Error('Verification failed: Expected kid in JWT header to dereference a DID Document Verification Method'); + } + + // will be used to verify signature + const publicKeyJwk = verificationMethod.publicKeyJwk as JwkParamsEcPublic | JwkParamsOkpPublic; + if (!publicKeyJwk) { // ensure that Verification Method includes public key as a JWK. + throw new Error('Verification failed: Expected kid in JWT header to dereference to a DID Document Verification Method with publicKeyJwk'); + } + + const signedData = `${encodedJwt.header}.${encodedJwt.payload}`; + const signedDataBytes = Convert.string(signedData).toUint8Array(); + + const signatureBytes = Convert.base64Url(encodedJwt.signature).toUint8Array(); + + const algorithmId = `${decodedJwt.header.alg}:${publicKeyJwk['crv'] || ''}`; + if (!(algorithmId in Jwt.algorithms)) { + throw new Error(`Verification failed: ${algorithmId} not supported`); + } + + const { signer, options: signatureAlgorithm } = Jwt.algorithms[algorithmId]; + + const isSignatureValid = await signer.verify({ + algorithm : signatureAlgorithm!, + key : publicKeyJwk, + data : signedDataBytes, + signature : signatureBytes + }); + + if (!isSignatureValid) { + throw new Error('Signature verification failed: Integrity mismatch'); + } + + return decodedJwt; + } + + /** + * Parses a JWT without verifying its signature. + * + * @example + * ```ts + * const { encoded: encodedJwt, decoded: decodedJwt } = Jwt.parse({ jwt: myJwt }); + * ``` + * + * @param options - Parameters for JWT decoding, including the JWT string. + * @returns both encoded and decoded JWT parts + */ + static parse(options: ParseJwtOptions): JwtParseResult { + const splitJwt = options.jwt.split('.'); + if (splitJwt.length !== 3) { + throw new Error(`Verification failed: Malformed JWT. expected 3 parts. got ${splitJwt.length}`); + } + + const [base64urlEncodedJwtHeader, base64urlEncodedJwtPayload, base64urlEncodedSignature] = splitJwt; + let jwtHeader: JwtHeaderParams; + let jwtPayload: JwtPayload; + + try { + jwtHeader = Convert.base64Url(base64urlEncodedJwtHeader).toObject() as JwtHeaderParams; + } catch(e) { + throw new Error('Verification failed: Malformed JWT. Invalid base64url encoding for JWT header'); + } + + if (!jwtHeader.typ || jwtHeader.typ !== 'JWT') { + throw new Error('Verification failed: Expected JWT header to contain typ property set to JWT'); + } + + if (!jwtHeader.alg || !jwtHeader.kid) { // ensure that JWT header has required properties + throw new Error('Verification failed: Expected JWT header to contain alg and kid'); + } + + // TODO: validate optional payload fields: https://datatracker.ietf.org/doc/html/rfc7519#section-4.1 + try { + jwtPayload = Convert.base64Url(base64urlEncodedJwtPayload).toObject() as JwtPayload; + } catch(e) { + throw new Error('Verification failed: Malformed JWT. Invalid base64url encoding for JWT payload'); + } + + return { + decoded: { + header : jwtHeader, + payload : jwtPayload, + }, + encoded: { + header : base64urlEncodedJwtHeader, + payload : base64urlEncodedJwtPayload, + signature : base64urlEncodedSignature + } + }; + } +} \ No newline at end of file diff --git a/packages/credentials/src/presentation-exchange.ts b/packages/credentials/src/presentation-exchange.ts index c8c132874..aecbb292d 100644 --- a/packages/credentials/src/presentation-exchange.ts +++ b/packages/credentials/src/presentation-exchange.ts @@ -1,12 +1,13 @@ -import type { EvaluationResults, PresentationResult, SelectResults, Validated as PexValidated } from '@sphereon/pex'; -import { PEX } from '@sphereon/pex'; - +import type { IPresentation, PresentationSubmission } from '@sphereon/ssi-types'; import type { PresentationDefinitionV2 as PexPresDefV2 } from '@sphereon/pex-models'; - import type { - IPresentation, - PresentationSubmission, -} from '@sphereon/ssi-types'; + SelectResults, + EvaluationResults, + PresentationResult, + Validated as PexValidated, +} from '@sphereon/pex'; + +import { PEX } from '@sphereon/pex'; export interface PresentationDefinitionV2 extends PexPresDefV2 { } @@ -23,12 +24,12 @@ export class PresentationExchange { * * @param {string[]} vcJwts The list of Verifiable Credentials to select from. * @param {PresentationDefinitionV2} presentationDefinition The Presentation Definition to match against. - * @return {string[]} selectedVcJwts A list of Verifiable Credentials that satisfy the Presentation Definition. + * @returns {string[]} selectedVcJwts A list of Verifiable Credentials that satisfy the Presentation Definition. */ - public static selectCredentials( + public static selectCredentials({ vcJwts, presentationDefinition }: { vcJwts: string[], presentationDefinition: PresentationDefinitionV2 - ): string[] { + }): string[] { this.resetPex(); const selectResults: SelectResults = this.pex.selectFrom(presentationDefinition, vcJwts); return selectResults.verifiableCredential as string[] ?? []; @@ -37,14 +38,14 @@ export class PresentationExchange { /** * Validates if a list of VC JWTs satisfies the given presentation definition. * - * @param {string[]} vcJwts An array of VC JWTs as strings. - * @param {PresentationDefinitionV2} presentationDefinition The criteria to validate against. - * @throws {Error} If the evaluation results in warnings or errors. + * @param vcJwts - An array of VC JWTs as strings. + * @param presentationDefinition - The criteria to validate against. + * @throws Error if the evaluation results in warnings or errors. */ - public static satisfiesPresentationDefinition( + public static satisfiesPresentationDefinition({ vcJwts, presentationDefinition }: { vcJwts: string[], presentationDefinition: PresentationDefinitionV2 - ): void { + }): void { this.resetPex(); const evaluationResults: EvaluationResults = this.pex.evaluateCredentials(presentationDefinition, vcJwts); if (evaluationResults.warnings?.length) { @@ -78,10 +79,10 @@ export class PresentationExchange { * @throws {Error} If the evaluation results in warnings or errors, or if the required credentials are not present, * an error is thrown with a descriptive message. */ - public static createPresentationFromCredentials( + public static createPresentationFromCredentials({ vcJwts, presentationDefinition }: { vcJwts: string[], presentationDefinition: PresentationDefinitionV2 - ): PresentationResult { + }): PresentationResult { this.resetPex(); const pdValidated: Validated = PEX.validateDefinition(presentationDefinition); @@ -118,10 +119,11 @@ export class PresentationExchange { * This method validates whether an object is usable as a presentation definition or not. * * @param {PresentationDefinitionV2} presentationDefinition: presentationDefinition to be validated. - * - * @return {Validated} the validation results to reveal what is acceptable/unacceptable about the passed object to be considered a valid presentation definition + * @returns {Validated} the validation results to reveal what is acceptable/unacceptable about the passed object to be considered a valid presentation definition */ - public static validateDefinition(presentationDefinition: PresentationDefinitionV2): Validated { + public static validateDefinition({ presentationDefinition }: { + presentationDefinition: PresentationDefinitionV2 + }): Validated { return PEX.validateDefinition(presentationDefinition); } @@ -129,8 +131,7 @@ export class PresentationExchange { * This method validates whether an object is usable as a presentation submission or not. * * @param {PresentationSubmission} presentationSubmission the object to be validated. - * - * @return {Validated} the validation results to reveal what is acceptable/unacceptable about the passed object to be considered a valid presentation submission + * @returns {Validated} the validation results to reveal what is acceptable/unacceptable about the passed object to be considered a valid presentation submission */ public static validateSubmission(presentationSubmission: PresentationSubmission): Validated { return PEX.validateSubmission(presentationSubmission); @@ -138,12 +139,13 @@ export class PresentationExchange { /** * Evaluates a presentation against a presentation definition. + * * @returns {EvaluationResults} The result of the evaluation process. */ - public static evaluatePresentation( + public static evaluatePresentation({ presentationDefinition, presentation }: { presentationDefinition: PresentationDefinitionV2, presentation: IPresentation - ): EvaluationResults { + }): EvaluationResults { this.resetPex(); return this.pex.evaluatePresentation(presentationDefinition, presentation); } @@ -166,4 +168,4 @@ function isValid(validated: Validated) { throw new Error(errorMessage); } } -} +} \ No newline at end of file diff --git a/packages/credentials/src/utils.ts b/packages/credentials/src/utils.ts index b0ca17d4d..a49862f89 100644 --- a/packages/credentials/src/utils.ts +++ b/packages/credentials/src/utils.ts @@ -4,10 +4,12 @@ * This function omits the milliseconds part from the ISO 8601 timestamp, returning a date-time * string in the format "yyyy-MM-ddTHH:mm:ssZ". * - * @returns The current timestamp in XML Schema 1.1.2 format. - * * @example + * ```ts * const currentTimestamp = getCurrentXmlSchema112Timestamp(); // "2023-08-23T12:34:56Z" + * ``` + * + * @returns The current timestamp in XML Schema 1.1.2 format. */ export function getCurrentXmlSchema112Timestamp(): string { // Omit the milliseconds part from toISOString() output @@ -21,11 +23,13 @@ export function getCurrentXmlSchema112Timestamp(): string { * This function takes a number of seconds and adds it to the current timestamp, returning a * date-time string in the format "yyyy-MM-ddTHH:mm:ssZ" without milliseconds. * - * @param secondsInFuture - The number of seconds to project into the future. - * @returns The future timestamp in XML Schema 1.1.2 format. - * * @example + * ```ts * const futureTimestamp = getFutureXmlSchema112Timestamp(60); // "2023-08-23T12:35:56Z" + * ``` + * + * @param secondsInFuture - The number of seconds to project into the future. + * @returns The future timestamp in XML Schema 1.1.2 format. */ export function getFutureXmlSchema112Timestamp(secondsInFuture: number): string { const futureDate = new Date(Date.now() + secondsInFuture * 1000); @@ -38,11 +42,13 @@ export function getFutureXmlSchema112Timestamp(secondsInFuture: number): string * This function checks whether the provided timestamp string conforms to the * format "yyyy-MM-ddTHH:mm:ssZ", without milliseconds, as defined in XML Schema 1.1.2. * - * @param timestamp - The timestamp string to validate. - * @returns `true` if the timestamp is valid, `false` otherwise. - * * @example + * ```ts * const isValid = isValidXmlSchema112Timestamp('2023-08-23T12:34:56Z'); // true + * ``` + * + * @param timestamp - The timestamp string to validate. + * @returns `true` if the timestamp is valid, `false` otherwise. */ export function isValidXmlSchema112Timestamp(timestamp: string): boolean { // Format: yyyy-MM-ddTHH:mm:ssZ @@ -54,5 +60,4 @@ export function isValidXmlSchema112Timestamp(timestamp: string): boolean { const date = new Date(timestamp); return !isNaN(date.getTime()); -} - +} \ No newline at end of file diff --git a/packages/credentials/src/validators.ts b/packages/credentials/src/validators.ts index 3f17b9404..d28c41129 100644 --- a/packages/credentials/src/validators.ts +++ b/packages/credentials/src/validators.ts @@ -1,3 +1,8 @@ +import type { + ICredentialContextType, + ICredentialSubject +} from '@sphereon/ssi-types'; + import { DEFAULT_CONTEXT, DEFAULT_VC_TYPE, @@ -6,11 +11,6 @@ import { import { isValidXmlSchema112Timestamp } from './utils.js'; -import type { - ICredentialContextType, - ICredentialSubject -} from '@sphereon/ssi-types'; - export class SsiValidator { static validateCredentialPayload(vc: VerifiableCredential): void { this.validateContext(vc.vcDataModel['@context']); @@ -49,4 +49,4 @@ export class SsiValidator { static asArray(arg: any | any[]): any[] { return Array.isArray(arg) ? arg : [arg]; } -} +} \ No newline at end of file diff --git a/packages/credentials/src/verifiable-credential.ts b/packages/credentials/src/verifiable-credential.ts index 32c04605a..7bd43b1e3 100644 --- a/packages/credentials/src/verifiable-credential.ts +++ b/packages/credentials/src/verifiable-credential.ts @@ -1,19 +1,11 @@ -import type { Resolvable, DIDResolutionResult} from 'did-resolver'; -import type { CryptoAlgorithm, JwkParamsEcPrivate, JwkParamsOkpPrivate, Web5Crypto } from '@web5/crypto'; -import type { JwtHeader } from 'jwt-decode'; -import type { - ICredential, - ICredentialSubject, - JwtDecodedVerifiableCredential } from '@sphereon/ssi-types'; +import type { PortableDid } from '@web5/dids'; +import type { ICredential, ICredentialSubject} from '@sphereon/ssi-types'; -import { v4 as uuidv4 } from 'uuid'; -import { getCurrentXmlSchema112Timestamp } from './utils.js'; -import { Convert } from '@web5/common'; -import { verifyJWT } from 'did-jwt'; -import { DidDhtMethod, DidIonMethod, DidKeyMethod, DidResolver } from '@web5/dids'; +import { utils as cryptoUtils } from '@web5/crypto'; + +import { Jwt } from './jwt.js'; import { SsiValidator } from './validators.js'; -import { PortableDid } from '@web5/dids'; -import { PrivateKeyJwk, EdDsaAlgorithm, EcdsaAlgorithm } from '@web5/crypto'; +import { getCurrentXmlSchema112Timestamp } from './utils.js'; export const DEFAULT_CONTEXT = 'https://www.w3.org/2018/credentials/v1'; export const DEFAULT_VC_TYPE = 'VerifiableCredential'; @@ -52,63 +44,8 @@ export type VerifiableCredentialSignOptions = { did: PortableDid; }; -/** - * Options for `createJwt` - * @param issuerDid - The DID to sign with. - * @param subjectDid - The subject of the credential. - * @param payload - The payload to be signed. - */ -export type CreateJwtOptions = { - issuerDid: PortableDid, - subjectDid: string, - payload: any, -} - type CredentialSubject = ICredentialSubject; -type JwtHeaderParams = { - alg: string; - typ: 'JWT' - kid: string; -}; - -type DecodedVcJwt = { - header: JwtHeaderParams - payload: JwtDecodedVerifiableCredential, - signature: string -} - -type Signer = { - signer: CryptoAlgorithm, - options?: T | undefined - alg: string - crv: string -} - -const secp256k1Signer: Signer = { - signer : new EcdsaAlgorithm(), - options : { name: 'ES256K'}, - alg : 'ES256K', - crv : 'secp256k1' -}; - -const ed25519Signer: Signer = { - signer : new EdDsaAlgorithm(), - options : { name: 'EdDSA' }, - alg : 'EdDSA', - crv : 'Ed25519' -}; - -const didResolver = new DidResolver({ didResolvers: [DidIonMethod, DidKeyMethod, DidDhtMethod] }); - -class TbdResolver implements Resolvable { - async resolve(didUrl: string): Promise { - return await didResolver.resolve(didUrl) as DIDResolutionResult; - } -} - -const tbdResolver = new TbdResolver(); - /** * `VerifiableCredential` represents a digitally verifiable credential according to the * [W3C Verifiable Credentials Data Model](https://www.w3.org/TR/vc-data-model/). @@ -122,14 +59,6 @@ const tbdResolver = new TbdResolver(); export class VerifiableCredential { constructor(public vcDataModel: VcDataModel) {} - /** supported cryptographic algorithms. keys are `${alg}:${crv}`. */ - static algorithms: { [alg: string]: Signer } = { - 'ES256K:' : secp256k1Signer, - 'ES256K:secp256k1' : secp256k1Signer, - ':secp256k1' : secp256k1Signer, - 'EdDSA:Ed25519' : ed25519Signer - }; - get type(): string { return this.vcDataModel.type[this.vcDataModel.type.length - 1]; } @@ -147,26 +76,33 @@ export class VerifiableCredential { } /** - * Sign a verifiable credential using [signOptions] + * Signs the verifiable credential and returns it as a signed JWT. * - * - * @param vcSignOptions The sign options used to sign the credential. - * @return The JWT representing the signed verifiable credential. - * - * Example: - * ``` - * const vcJwt = verifiableCredential.sign(vcSignOptions) + * @example + * ```ts + * const vcJwt = verifiableCredential.sign({ did: myDid }); * ``` + * + * @param options - The sign options used to sign the credential. + * @returns The JWT representing the signed verifiable credential. */ - public async sign(vcSignOptions: VerifiableCredentialSignOptions): Promise { - const vcJwt: string = await createJwt({issuerDid: vcSignOptions.did, subjectDid: this.subject, payload: { vc: this.vcDataModel }}); + public async sign(options: VerifiableCredentialSignOptions): Promise { + const vcJwt: string = await Jwt.sign({ + signerDid : options.did, + payload : { + vc : this.vcDataModel, + iss : this.issuer, + sub : this.subject, + } + }); + return vcJwt; } /** * Converts the current object to its JSON representation. * - * @return The JSON representation of the object. + * @returns The JSON representation of the object. */ public toString(): string { return JSON.stringify(this.vcDataModel); @@ -175,11 +111,8 @@ export class VerifiableCredential { /** * Create a [VerifiableCredential] based on the provided parameters. * - * @param vcCreateOptions The options to use when creating the Verifiable Credential. - * @return A [VerifiableCredential] instance. - * - * Example: - * ``` + * @example + * ```ts * const vc = VerifiableCredential.create({ * type: 'StreetCredibility', * issuer: 'did:ex:issuer', @@ -187,9 +120,12 @@ export class VerifiableCredential { * data: { 'arbitrary': 'data' } * }) * ``` + * + * @param options - The options to use when creating the Verifiable Credential. + * @returns A [VerifiableCredential] instance. */ - public static create(vcCreateOptions: VerifiableCredentialCreateOptions): VerifiableCredential { - const { type, issuer, subject, data, issuanceDate, expirationDate } = vcCreateOptions; + public static async create(options: VerifiableCredentialCreateOptions): Promise { + const { type, issuer, subject, data, issuanceDate, expirationDate } = options; const jsonData = JSON.parse(JSON.stringify(data)); @@ -211,7 +147,7 @@ export class VerifiableCredential { type : Array.isArray(type) ? [DEFAULT_VC_TYPE, ...type] : (type ? [DEFAULT_VC_TYPE, type] : [DEFAULT_VC_TYPE]), - id : `urn:uuid:${uuidv4()}`, + id : `urn:uuid:${cryptoUtils.randomUuid()}`, issuer : issuer, issuanceDate : issuanceDate || getCurrentXmlSchema112Timestamp(), // use default if undefined credentialSubject : credentialSubject, @@ -219,6 +155,7 @@ export class VerifiableCredential { }; validatePayload(vcDataModel); + return new VerifiableCredential(vcDataModel); } @@ -235,51 +172,52 @@ export class VerifiableCredential { * * If any of these steps fail, the function will throw a [Error] with a message indicating the nature of the failure. * - * @param vcJwt The Verifiable Credential in JWT format as a [string]. - * @throws Error if the verification fails at any step, providing a message with failure details. - * @throws Error if critical JWT header elements are absent. - * - * ### Example: - * ``` + * @example + * ```ts * try { - * VerifiableCredential.verify(signedVcJwt) + * VerifiableCredential.verify({ vcJwt: signedVcJwt }) * console.log("VC Verification successful!") * } catch (e: Error) { * console.log("VC Verification failed: ${e.message}") * } * ``` + * + * @param vcJwt The Verifiable Credential in JWT format as a [string]. + * @throws Error if the verification fails at any step, providing a message with failure details. + * @throws Error if critical JWT header elements are absent. */ - public static async verify(vcJwt: string): Promise { - const jwt = decode(vcJwt); // Parse and validate JWT - - // Ensure the presence of critical header elements `alg` and `kid` - if (!jwt.header.alg || !jwt.header.kid) { - throw new Error('Signature verification failed: Expected JWS header to contain alg and kid'); + public static async verify({ vcJwt }: { + vcJwt: string + }) { + const { payload } = await Jwt.verify({ jwt: vcJwt }); + const vc = payload['vc'] as VcDataModel; + if (!vc) { + throw new Error('vc property missing.'); } - const verificationResponse = await verifyJWT(vcJwt, { - resolver: tbdResolver - }); + validatePayload(vc); - if (!verificationResponse.verified) { - throw new Error('VC JWT could not be verified. Reason: ' + JSON.stringify(verificationResponse)); - } + return { + issuer : payload.iss!, + subject : payload.sub!, + vc : payload['vc'] as VcDataModel + }; } /** * Parses a JWT into a [VerifiableCredential] instance. * - * @param vcJwt The verifiable credential JWT as a [String]. - * @return A [VerifiableCredential] instance derived from the JWT. - * - * Example: - * ``` - * val vc = VerifiableCredential.parseJwt(signedVcJwt) + * @example + * ```ts + * val vc = VerifiableCredential.parseJwt({ vcJwt: signedVcJwt }) * ``` + * + * @param vcJwt The verifiable credential JWT as a [String]. + * @returns A [VerifiableCredential] instance derived from the JWT. */ - public static parseJwt(vcJwt: string): VerifiableCredential { - const decodedVcJwt: DecodedVcJwt = decode(vcJwt); - const vcDataModel: VcDataModel = decodedVcJwt.payload.vc; + public static parseJwt({ vcJwt }: { vcJwt: string }): VerifiableCredential { + const parsedJwt = Jwt.parse({ jwt: vcJwt }); + const vcDataModel: VcDataModel = parsedJwt.decoded.payload['vc'] as VcDataModel; if(!vcDataModel) { throw Error('Jwt payload missing vc property'); @@ -301,55 +239,4 @@ function validatePayload(vc: VcDataModel): void { SsiValidator.validateCredentialSubject(vc.credentialSubject); if (vc.issuanceDate) SsiValidator.validateTimestamp(vc.issuanceDate); if (vc.expirationDate) SsiValidator.validateTimestamp(vc.expirationDate); -} - -/** - * Decodes a VC JWT into its constituent parts: header, payload, and signature. - * - * @param jwt - The JWT string to decode. - * @returns An object containing the decoded header, payload, and signature. - */ -function decode(jwt: string): DecodedVcJwt { - const [encodedHeader, encodedPayload, encodedSignature] = jwt.split('.'); - - if (!encodedHeader || !encodedPayload || !encodedSignature) { - throw Error('Not a valid jwt'); - } - - return { - header : Convert.base64Url(encodedHeader).toObject() as JwtHeaderParams, - payload : Convert.base64Url(encodedPayload).toObject() as JwtDecodedVerifiableCredential, - signature : encodedSignature - }; -} - -async function createJwt(createJwtOptions: CreateJwtOptions) { - const { issuerDid, subjectDid, payload } = createJwtOptions; - const privateKeyJwk = issuerDid.keySet.verificationMethodKeys![0].privateKeyJwk! as JwkParamsEcPrivate | JwkParamsOkpPrivate; - - const header: JwtHeader = { typ: 'JWT', alg: privateKeyJwk.alg, kid: issuerDid.document.verificationMethod![0].id }; - const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); - - const jwtPayload = { - iss : issuerDid.did, - sub : subjectDid, - ...payload, - }; - - const base64UrlEncodedPayload = Convert.object(jwtPayload).toBase64Url(); - - const toSign = `${base64UrlEncodedHeader}.${base64UrlEncodedPayload}`; - const toSignBytes = Convert.string(toSign).toUint8Array(); - - const algorithmId = `${header.alg}:${privateKeyJwk['crv'] || ''}`; - if (!(algorithmId in VerifiableCredential.algorithms)) { - throw new Error(`Signing failed: ${algorithmId} not supported`); - } - - const { signer, options } = VerifiableCredential.algorithms[algorithmId]; - - const signatureBytes = await signer.sign({ key: privateKeyJwk as PrivateKeyJwk, data: toSignBytes, algorithm: options! }); - const base64UrlEncodedSignature = Convert.uint8Array(signatureBytes).toBase64Url(); - - return `${toSign}.${base64UrlEncodedSignature}`; } \ No newline at end of file diff --git a/packages/credentials/tests/jwt.spec.ts b/packages/credentials/tests/jwt.spec.ts new file mode 100644 index 000000000..7edec27e7 --- /dev/null +++ b/packages/credentials/tests/jwt.spec.ts @@ -0,0 +1,127 @@ +import type { JwtHeaderParams, JwtPayload, PrivateKeyJwk } from '@web5/crypto'; + +import { expect } from 'chai'; +import { Convert } from '@web5/common'; +import { Secp256k1 } from '@web5/crypto'; +import { DidKeyMethod } from '@web5/dids'; + +import { Jwt } from '../src/jwt.js'; + +describe('Jwt', () => { + describe('parse()', () => { + it('throws error if JWT doesnt contain 3 parts', async () => { + expect(() => + Jwt.parse({ jwt: 'abcd123' }) + ).to.throw('Malformed JWT. expected 3 parts'); + }); + + it('throws error if JWT header is not properly base64url encoded', async () => { + expect(() => + Jwt.parse({ jwt: 'abcd123.efgh.hijk' }) + ).to.throw('Invalid base64url encoding for JWT header'); + }); + + it('throws error if JWT header is missing typ property', async () => { + const header: JwtHeaderParams = { alg: 'ES256K', kid: 'whateva' }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + expect(() => + Jwt.parse({ jwt: `${base64UrlEncodedHeader}.efgh.hijk` }) + ).to.throw('typ property set to JWT'); + }); + + it('throws error if JWT header typ property is not set to JWT', async () => { + const header: JwtHeaderParams = { typ: 'hehe', alg: 'ES256K', kid: 'whateva' }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + expect(() => + Jwt.parse({ jwt: `${base64UrlEncodedHeader}.efgh.hijk` }) + ).to.throw('typ property set to JWT'); + }); + + it('throws error if JWT header alg property is missing', async () => { + // @ts-expect-error because alg is intentionally missing to trigger error. + const header: JwtHeaderParams = { typ: 'JWT', kid: 'whateva' }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + expect(() => + Jwt.parse({ jwt: `${base64UrlEncodedHeader}.efgh.hijk` }) + ).to.throw('to contain alg and kid'); + }); + + it('throws error if JWT header kid property is missing', async () => { + const header: JwtHeaderParams = { typ: 'JWT', alg: 'ES256K' }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + expect(() => + Jwt.parse({ jwt: `${base64UrlEncodedHeader}.efgh.hijk` }) + ).to.throw('to contain alg and kid'); + }); + + it('throws error if JWT payload is not properly base64url encoded', async () => { + const header: JwtHeaderParams = { typ: 'JWT', alg: 'ES256K', kid: 'whateva' }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + expect(() => + Jwt.parse({ jwt: `${base64UrlEncodedHeader}.efgh.hijk` }) + ).to.throw('Invalid base64url encoding for JWT payload'); + }); + }); + + describe('verify()', () => { + it('throws error if JWT header kid does not dereference a verification method', async () => { + const did = await DidKeyMethod.create({ keyAlgorithm: 'secp256k1' }); + const header: JwtHeaderParams = { typ: 'JWT', alg: 'ES256K', kid: did.did }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + const payload: JwtPayload = { iat: Math.floor(Date.now() / 1000) }; + const base64UrlEncodedPayload = Convert.object(payload).toBase64Url(); + + try { + await Jwt.verify({ jwt: `${base64UrlEncodedHeader}.${base64UrlEncodedPayload}.hijk` }); + expect.fail(); + } catch(e: any) { + expect(e.message).to.include('dereference a DID Document Verification Method'); + } + }); + + it('throws error if alg is not supported', async () => { + const did = await DidKeyMethod.create({ keyAlgorithm: 'secp256k1' }); + const header: JwtHeaderParams = { typ: 'JWT', alg: 'RS256', kid: did.document.verificationMethod![0].id }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + const payload: JwtPayload = { iat: Math.floor(Date.now() / 1000) }; + const base64UrlEncodedPayload = Convert.object(payload).toBase64Url(); + + try { + await Jwt.verify({ jwt: `${base64UrlEncodedHeader}.${base64UrlEncodedPayload}.hijk` }); + expect.fail(); + } catch(e: any) { + expect(e.message).to.include('not supported'); + } + }); + + it('returns signer DID if verification succeeds', async () => { + const did = await DidKeyMethod.create({ keyAlgorithm: 'secp256k1' }); + const header: JwtHeaderParams = { typ: 'JWT', alg: 'ES256K', kid: did.document.verificationMethod![0].id }; + const base64UrlEncodedHeader = Convert.object(header).toBase64Url(); + + const payload: JwtPayload = { iat: Math.floor(Date.now() / 1000) }; + const base64UrlEncodedPayload = Convert.object(payload).toBase64Url(); + + const toSign = `${base64UrlEncodedHeader}.${base64UrlEncodedPayload}`; + const toSignBytes = Convert.string(toSign).toUint8Array(); + + const privateKeyJwk = did.keySet.verificationMethodKeys![0].privateKeyJwk; + + const signatureBytes = await Secp256k1.sign({ key: privateKeyJwk as PrivateKeyJwk, data: toSignBytes }); + const base64UrlEncodedSignature = Convert.uint8Array(signatureBytes).toBase64Url(); + + const jwt = `${toSign}.${base64UrlEncodedSignature}`; + const verifyResult = await Jwt.verify({ jwt }); + + expect(verifyResult.header).to.deep.equal(header); + expect(verifyResult.payload).to.deep.equal(payload); + }); + }); +}); \ No newline at end of file diff --git a/packages/credentials/tests/presentation-exchange.spec.ts b/packages/credentials/tests/presentation-exchange.spec.ts index f11769ccc..c2e08265f 100644 --- a/packages/credentials/tests/presentation-exchange.spec.ts +++ b/packages/credentials/tests/presentation-exchange.spec.ts @@ -1,7 +1,10 @@ import { expect } from 'chai'; import { DidKeyMethod, PortableDid } from '@web5/dids'; -import { PresentationExchange, Validated, PresentationDefinitionV2 } from '../src/presentation-exchange.js'; + +import type { Validated, PresentationDefinitionV2 } from '../src/presentation-exchange.js'; + import { VerifiableCredential } from '../src/verifiable-credential.js'; +import { PresentationExchange } from '../src/presentation-exchange.js'; class BitcoinCredential { constructor( @@ -24,7 +27,7 @@ describe('PresentationExchange', () => { before(async () => { issuerDid = await DidKeyMethod.create(); - const vc = VerifiableCredential.create({ + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : issuerDid.did, subject : issuerDid.did, @@ -36,16 +39,22 @@ describe('PresentationExchange', () => { }); it('should evaluate credentials without any errors or warnings', async () => { - PresentationExchange.satisfiesPresentationDefinition([btcCredentialJwt], presentationDefinition); + PresentationExchange.satisfiesPresentationDefinition({ + vcJwts: [btcCredentialJwt], + presentationDefinition + }); }); it('should return the selected verifiable credentials', () => { - const actualSelectedVcJwts = PresentationExchange.selectCredentials([btcCredentialJwt], presentationDefinition); + const actualSelectedVcJwts = PresentationExchange.selectCredentials({ + vcJwts: [btcCredentialJwt], + presentationDefinition + }); expect(actualSelectedVcJwts).to.deep.equal([btcCredentialJwt]); }); it('should return the only one verifiable credential', async () => { - const vc = VerifiableCredential.create({ + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : issuerDid.did, subject : issuerDid.did, @@ -54,11 +63,14 @@ describe('PresentationExchange', () => { const otherCredJwt = await vc.sign({did: issuerDid}); - const actualSelectedVcJwts = PresentationExchange.selectCredentials([btcCredentialJwt, otherCredJwt], presentationDefinition); + const actualSelectedVcJwts = PresentationExchange.selectCredentials({ + vcJwts: [btcCredentialJwt, otherCredJwt], + presentationDefinition + }); expect(actualSelectedVcJwts).to.deep.equal([btcCredentialJwt]); }); - it('should evaluate that the credential does not satisfy the presentation definition', async () => { + it('should throw error for a credential that does not satisfy the presentation definition', async () => { const otherPresentationDefinition = { 'id' : 'test-pd-id', 'name' : 'simple PD', @@ -80,11 +92,19 @@ describe('PresentationExchange', () => { ] }; - await expectThrowsAsync(() => PresentationExchange.satisfiesPresentationDefinition([btcCredentialJwt], otherPresentationDefinition), 'Input candidate does not contain property'); + expect(() => + PresentationExchange.satisfiesPresentationDefinition({ + vcJwts : [btcCredentialJwt], + presentationDefinition : otherPresentationDefinition + }) + ).to.throw('Input candidate does not contain property'); }); - it('should successfully create a presentation from the given definition and credentials', () => { - const presentationResult = PresentationExchange.createPresentationFromCredentials([btcCredentialJwt], presentationDefinition); + it('should successfully create a presentation from the given definition and credentials', async () => { + const presentationResult = PresentationExchange.createPresentationFromCredentials({ + vcJwts: [btcCredentialJwt], + presentationDefinition + }); expect(presentationResult).to.exist; expect(presentationResult.presentationSubmission.definition_id).to.equal(presentationDefinition.id); }); @@ -111,11 +131,16 @@ describe('PresentationExchange', () => { ] }; - await expectThrowsAsync(() => PresentationExchange.createPresentationFromCredentials([btcCredentialJwt], invalidPresentationDefinition), 'Failed to pass validation check'); + expect(() => + PresentationExchange.createPresentationFromCredentials({ + vcJwts : [btcCredentialJwt], + presentationDefinition : invalidPresentationDefinition + }) + ).to.throw('Failed to pass validation check'); }); - it('should fail to create a presentation with vc that does not match presentation definition', async() => { - const vc = VerifiableCredential.create({ + it('should fail to create a presentation with vc that does not match presentation definition', async () => { + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : issuerDid.did, subject : issuerDid.did, @@ -123,38 +148,59 @@ describe('PresentationExchange', () => { }); const otherCredJwt = await vc.sign({did: issuerDid}); - await expectThrowsAsync(() => PresentationExchange.createPresentationFromCredentials([otherCredJwt], presentationDefinition), 'Failed to create Verifiable Presentation JWT due to: Required Credentials Not Present'); + + expect(() => + PresentationExchange.createPresentationFromCredentials({ + vcJwts: [otherCredJwt], + presentationDefinition + }) + ).to.throw('Failed to create Verifiable Presentation JWT due to: Required Credentials Not Present'); }); it('should successfully validate a presentation definition', () => { - const result:Validated = PresentationExchange.validateDefinition(presentationDefinition); + const result:Validated = PresentationExchange.validateDefinition({ presentationDefinition }); expect(result).to.deep.equal([{ tag: 'root', status: 'info', message: 'ok' }]); }); it('should successfully validate a submission', () => { - const presentationResult = PresentationExchange.createPresentationFromCredentials([btcCredentialJwt], presentationDefinition); - const result:Validated = PresentationExchange.validateSubmission(presentationResult.presentationSubmission); + const presentationResult = PresentationExchange.createPresentationFromCredentials({ + vcJwts: [btcCredentialJwt], + presentationDefinition + }); + const result = PresentationExchange.validateSubmission(presentationResult.presentationSubmission); expect(result).to.deep.equal([{ tag: 'root', status: 'info', message: 'ok' }]); }); - it('should evaluate the presentation without any errors or warnings', async () => { - const presentationResult = PresentationExchange.createPresentationFromCredentials([btcCredentialJwt], presentationDefinition); + it('should evaluate the presentation without any errors or warnings', () => { + const presentationResult = PresentationExchange.createPresentationFromCredentials({ + vcJwts: [btcCredentialJwt], + presentationDefinition + }); - const presentationEvaluationResults = PresentationExchange.evaluatePresentation(presentationDefinition, presentationResult.presentation ); + const presentationEvaluationResults = PresentationExchange.evaluatePresentation({ + presentationDefinition, + presentation: presentationResult.presentation + }); expect(presentationEvaluationResults.errors).to.deep.equal([]); expect(presentationEvaluationResults.warnings).to.deep.equal([]); - const result:Validated = PresentationExchange.validateSubmission(presentationResult.presentationSubmission); + const result = PresentationExchange.validateSubmission(presentationResult.presentationSubmission); expect(result).to.deep.equal([{ tag: 'root', status: 'info', message: 'ok' }]); }); - it('should successfully execute the complete presentation exchange flow', async () => { - const presentationResult = PresentationExchange.createPresentationFromCredentials([btcCredentialJwt], presentationDefinition); + it('should successfully execute the complete presentation exchange flow', () => { + const presentationResult = PresentationExchange.createPresentationFromCredentials({ + vcJwts: [btcCredentialJwt], + presentationDefinition + }); expect(presentationResult).to.exist; expect(presentationResult.presentationSubmission.definition_id).to.equal(presentationDefinition.id); - const { warnings, errors } = PresentationExchange.evaluatePresentation(presentationDefinition, presentationResult.presentation ); + const { warnings, errors } = PresentationExchange.evaluatePresentation({ + presentationDefinition, + presentation: presentationResult.presentation + }); expect(errors).to.be.an('array'); expect(errors?.length).to.equal(0); @@ -186,18 +232,4 @@ function createPresentationDefinition(): PresentationDefinitionV2 { } ] }; -} - -const expectThrowsAsync = async (method: any, errorMessage: string) => { - let error: any = null; - try { - await method(); - } - catch (err) { - error = err; - } - expect(error).to.be.an('Error'); - if (errorMessage) { - expect(error.message).to.contain(errorMessage); - } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/packages/credentials/tests/ssi-validator.spec.ts b/packages/credentials/tests/ssi-validator.spec.ts index 1815dd707..fa5d579e3 100644 --- a/packages/credentials/tests/ssi-validator.spec.ts +++ b/packages/credentials/tests/ssi-validator.spec.ts @@ -1,6 +1,6 @@ -import { SsiValidator } from '../src/validators.js'; import { expect } from 'chai'; +import { SsiValidator } from '../src/validators.js'; import { DEFAULT_CONTEXT, DEFAULT_VC_TYPE } from '../src/verifiable-credential.js'; describe('SsiValidator', () => { diff --git a/packages/credentials/tests/verifiable-credential.spec.ts b/packages/credentials/tests/verifiable-credential.spec.ts index a15fd6a9f..38a9c3ccf 100644 --- a/packages/credentials/tests/verifiable-credential.spec.ts +++ b/packages/credentials/tests/verifiable-credential.spec.ts @@ -1,7 +1,11 @@ +import type { PortableDid } from '@web5/dids'; + +import sinon from 'sinon'; import { expect } from 'chai'; +import { DidDhtMethod, DidKeyMethod, DidIonMethod } from '@web5/dids'; + +import { Jwt } from '../src/jwt.js'; import { VerifiableCredential } from '../src/verifiable-credential.js'; -import { DidDhtMethod, DidKeyMethod, DidIonMethod, PortableDid } from '@web5/dids'; -import sinon from 'sinon'; describe('Verifiable Credential Tests', () => { let issuerDid: PortableDid; @@ -21,7 +25,7 @@ describe('Verifiable Credential Tests', () => { it('create vc works', async () => { const subjectDid = issuerDid.did; - const vc = VerifiableCredential.create({ + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : issuerDid.did, subject : subjectDid, @@ -49,9 +53,9 @@ describe('Verifiable Credential Tests', () => { const vcJwt = await vc.sign({ did }); - await VerifiableCredential.verify(vcJwt); + await VerifiableCredential.verify({ vcJwt }); - for( const currentVc of [vc, VerifiableCredential.parseJwt(vcJwt)]){ + for( const currentVc of [vc, VerifiableCredential.parseJwt({ vcJwt })]){ expect(currentVc.issuer).to.equal(did.did); expect(currentVc.subject).to.equal(did.did); expect(currentVc.type).to.equal('TBDeveloperCredential'); @@ -74,9 +78,9 @@ describe('Verifiable Credential Tests', () => { const vcJwt = await vc.sign({ did }); - await VerifiableCredential.verify(vcJwt); + await VerifiableCredential.verify({ vcJwt }); - for( const currentVc of [vc, VerifiableCredential.parseJwt(vcJwt)]){ + for (const currentVc of [vc, VerifiableCredential.parseJwt({ vcJwt })]){ expect(currentVc.issuer).to.equal(did.did); expect(currentVc.subject).to.equal(did.did); expect(currentVc.type).to.equal('TBDeveloperCredential'); @@ -85,51 +89,59 @@ describe('Verifiable Credential Tests', () => { } }); - it('should throw an error if data is not parseable into a JSON object', () => { + it('should throw an error if data is not parseable into a JSON object', async () => { const issuerDid = 'did:example:issuer'; const subjectDid = 'did:example:subject'; const invalidData = 'NotAJSONObject'; - expect(() => { - VerifiableCredential.create({ + try { + await VerifiableCredential.create({ type : 'InvalidDataTest', issuer : issuerDid, subject : subjectDid, data : invalidData }); - }).to.throw('Expected data to be parseable into a JSON object'); + expect.fail(); + } catch(e: any) { + expect(e.message).to.include('Expected data to be parseable into a JSON object'); + } }); - it('should throw an error if issuer or subject is not defined', () => { + it('should throw an error if issuer or subject is not defined', async () => { const issuerDid = 'did:example:issuer'; const subjectDid = 'did:example:subject'; const validData = new StreetCredibility('high', true); - expect(() => { - VerifiableCredential.create({ + try { + await VerifiableCredential.create({ type : 'IssuerUndefinedTest', issuer : '', subject : subjectDid, data : validData }); - }).to.throw('Issuer and subject must be defined'); + expect.fail(); + } catch(e: any) { + expect(e.message).to.include('Issuer and subject must be defined'); + } - expect(() => { - VerifiableCredential.create({ + try { + await VerifiableCredential.create({ type : 'SubjectUndefinedTest', issuer : issuerDid, subject : '', data : validData }); - }).to.throw('Issuer and subject must be defined'); - + expect.fail(); + } catch(e: any) { + expect(e.message).to.include('Issuer and subject must be defined'); + } }); it('signing with Ed25519 key works', async () => { const subjectDid = issuerDid.did; - const vc = VerifiableCredential.create({ + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : issuerDid.did, subject : subjectDid, @@ -147,7 +159,7 @@ describe('Verifiable Credential Tests', () => { it('signing with secp256k1 key works', async () => { const did = await DidKeyMethod.create({ keyAlgorithm: 'secp256k1' }); - const vc = VerifiableCredential.create({ + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : did.did, subject : did.did, @@ -162,18 +174,29 @@ describe('Verifiable Credential Tests', () => { expect(parts.length).to.equal(3); }); - it('parseJwt throws ParseException if argument is not a valid JWT', () => { - expect(() => { - VerifiableCredential.parseJwt('hi'); - }).to.throw('Not a valid jwt'); + it('parseJwt throws ParseException if argument is not a valid JWT', async () => { + expect(() => + VerifiableCredential.parseJwt({ vcJwt: 'hi' }) + ).to.throw('Malformed JWT'); }); it('parseJwt checks if missing vc property', async () => { - await expectThrowsAsync(() => VerifiableCredential.parseJwt('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'), 'Jwt payload missing vc property'); + const did = await DidKeyMethod.create(); + const jwt = await Jwt.sign({ + signerDid : did, + payload : { + iss : did.did, + sub : did.did + } + }); + + expect(() => + VerifiableCredential.parseJwt({ vcJwt: jwt }) + ).to.throw('Jwt payload missing vc property'); }); it('parseJwt returns an instance of VerifiableCredential on success', async () => { - const vc = VerifiableCredential.create({ + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : issuerDid.did, subject : issuerDid.did, @@ -181,7 +204,7 @@ describe('Verifiable Credential Tests', () => { }); const vcJwt = await vc.sign({did: issuerDid}); - const parsedVc = VerifiableCredential.parseJwt(vcJwt); + const parsedVc = VerifiableCredential.parseJwt({ vcJwt }); expect(parsedVc).to.not.be.null; expect(parsedVc.type).to.equal(vc.type); @@ -192,17 +215,27 @@ describe('Verifiable Credential Tests', () => { }); it('fails to verify an invalid VC JWT', async () => { - await expectThrowsAsync(() => VerifiableCredential.verify('invalid-jwt'), 'Not a valid jwt'); + try { + await VerifiableCredential.verify({ vcJwt: 'invalid-jwt' }); + expect.fail(); + } catch(e: any) { + expect(e.message).to.include('Malformed JWT'); + } }); it('should throw an error if JWS header does not contain alg and kid', async () => { const invalidJwt = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'; - await expectThrowsAsync(() => VerifiableCredential.verify(invalidJwt), 'Signature verification failed: Expected JWS header to contain alg and kid'); + try { + await VerifiableCredential.verify({ vcJwt: invalidJwt }); + expect.fail(); + } catch(e: any) { + expect(e.message).to.include('to contain alg and kid'); + } }); - it('verify does not throw an exception with vaild vc', async () => { - const vc = VerifiableCredential.create({ + it('verify does not throw an exception with valid vc', async () => { + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : issuerDid.did, subject : issuerDid.did, @@ -211,7 +244,39 @@ describe('Verifiable Credential Tests', () => { const vcJwt = await vc.sign({did: issuerDid}); - await VerifiableCredential.verify(vcJwt); + const { issuer, subject, vc: credential } = await VerifiableCredential.verify({ vcJwt }); + expect(issuer).to.equal(issuerDid.did); + expect(subject).to.equal(issuerDid.did); + expect(credential).to.not.be.null; + }); + + it('verify throws exception if vc property does not exist', async () => { + const did = await DidKeyMethod.create(); + const jwt = await Jwt.sign({ + payload : { jti: 'hi' }, + signerDid : did + }); + + try { + await VerifiableCredential.verify({ vcJwt: jwt }); + } catch(e: any) { + expect(e.message).to.include('vc property missing'); + } + }); + + it('verify throws exception if vc property is invalid', async () => { + const did = await DidKeyMethod.create(); + const jwt = await Jwt.sign({ + payload : { vc: 'hi' }, + signerDid : did + }); + + try { + await VerifiableCredential.verify({ vcJwt: jwt }); + expect.fail(); + } catch(e: any) { + expect(e).to.not.be.null; + } }); it('verify does not throw an exception with vaild vc signed by did:dht', async () => { @@ -287,7 +352,7 @@ describe('Verifiable Credential Tests', () => { const alice = await DidDhtMethod.create({ publish: true }); - const vc = VerifiableCredential.create({ + const vc = await VerifiableCredential.create({ type : 'StreetCred', issuer : alice.did, subject : alice.did, @@ -338,25 +403,11 @@ describe('Verifiable Credential Tests', () => { const vcJwt = await vc.sign({did: alice}); - await VerifiableCredential.verify(vcJwt); + await VerifiableCredential.verify({ vcJwt }); expect(didDhtCreateStub.calledOnce).to.be.true; expect(dhtDidResolutionSpy.calledOnce).to.be.true; sinon.restore(); }); }); -}); - -const expectThrowsAsync = async (method: any, errorMessage: string) => { - let error: any = null; - try { - await method(); - } - catch (err) { - error = err; - } - expect(error).to.be.an('Error'); - if (errorMessage) { - expect(error.message).to.contain(errorMessage); - } -}; \ No newline at end of file +}); \ No newline at end of file diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 5e18b6b99..7d3f42096 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -1,6 +1,6 @@ { "name": "@web5/crypto", - "version": "0.2.3", + "version": "0.2.4", "description": "TBD crypto library", "type": "module", "main": "./dist/cjs/index.js", diff --git a/packages/crypto/src/jose.ts b/packages/crypto/src/jose.ts index ff373b3e1..ba8af77f6 100644 --- a/packages/crypto/src/jose.ts +++ b/packages/crypto/src/jose.ts @@ -345,6 +345,18 @@ export interface JoseHeaderParams { } export interface JwsHeaderParams extends JoseHeaderParams { + /** + * Identifies the cryptographic algorithm used to secure the JWS. The JWS Signature value is not + * valid if the "alg" value does not represent a supported algorithm or if there is not a key for + * use with that algorithm associated with the party that digitally signed or MACed the content. + * + * "alg" values should either be registered in the IANA "JSON Web Signature and Encryption + * Algorithms" registry or be a value that contains a Collision-Resistant Name. The "alg" value is + * a case-sensitive ASCII string. This Header Parameter MUST be present and MUST be understood + * and processed by implementations. + * + * @see {@link https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.1 | RFC 7515, Section 4.1.1} + */ alg: // Edwards curve digital signature algorithm (e.g., Ed25519) | 'EdDSA' @@ -361,17 +373,35 @@ export interface JwsHeaderParams extends JoseHeaderParams { // HMAC using SHA-384 | 'HS384' // HMAC using SHA-512 - | 'HS512'; + | 'HS512' + // an unregistered, case-sensitive, collision-resistant string + | string; - // Indicates that extensions to JOSE RFCs are being used - // that MUST be understood and processed. + /** + * Indicates that extensions to JOSE RFCs are being used that MUST be understood and processed. + */ crit?: string[] - // Additional Public or Private Header Parameter names. + /** + * Additional Public or Private Header Parameter names. + */ [key: string]: unknown } export interface JweHeaderParams extends JoseHeaderParams { + /** + * Identifies the cryptographic algorithm used to encrypt or determine the value of the Content + * Encryption Key (CEK). The encrypted content is not usable if the "alg" value does not represent + * a supported algorithm, or if the recipient does not have a key that can be used with that + * algorithm. + * + * "alg" values should either be registered in the IANA "JSON Web Signature and Encryption + * Algorithms" registry or be a value that contains a Collision-Resistant Name. The "alg" value is + * a case-sensitive ASCII string. This Header Parameter MUST be present and MUST be understood + * and processed by implementations. + * + * @see {@link https://datatracker.ietf.org/doc/html/rfc7516#section-4.1.1 | RFC 7516, Section 4.1.1} + */ alg: // AES Key Wrap with default initial value using 128-bit key | 'A128KW' @@ -402,20 +432,32 @@ export interface JweHeaderParams extends JoseHeaderParams { // PBES2 with HMAC SHA-512 and "A256KW" wrapping | 'PBES2-HS512+A256KW' // PBES2 with HMAC SHA-512 and "XC20PKW" wrapping - | 'PBES2-HS512+XC20PKW'; + | 'PBES2-HS512+XC20PKW' + // an unregistered, case-sensitive, collision-resistant string + | string; apu?: Uint8Array; apv?: Uint8Array; - // Indicates that extensions to JOSE RFCs are being used - // that MUST be understood and processed. + /** + * Indicates that extensions to JOSE RFCs are being used that MUST be understood and processed. + */ crit?: string[] /** - * Cryptographic Algorithms for Content Encryption - * JWE uses cryptographic algorithms to encrypt and integrity-protect the - * plaintext and to integrity-protect the Additional Authenticated Data. + * Identifies the content encryption algorithm used to encrypt and integrity-protect (also + * known as "authenticated encryption") the plaintext and to integrity-protect the Additional + * Authenticated Data (AAD), if any. This algorithm MUST be an AEAD algorithm with a specified + * key length. + * + * The encrypted content is not usable if the "enc" value does not represent a supported + * algorithm. "enc" values should either be registered in the IANA "JSON Web Signature and + * Encryption Algorithms" registry or be a value that contains a Collision-Resistant Name. The + * "enc" value is a case-sensitive ASCII string containing a StringOrURI value. This Header + * Parameter MUST be present and MUST be understood and processed by implementations. + * + * @see {@link https://datatracker.ietf.org/doc/html/rfc7516#section-4.1.2 | RFC 7516, Section 4.1.2} */ enc: // AES_128_CBC_HMAC_SHA_256 authenticated encryption algorithm, @@ -434,7 +476,9 @@ export interface JweHeaderParams extends JoseHeaderParams { // AES GCM using 256-bit key | 'A256GCM' // XChaCha20-Poly1305 authenticated encryption algorithm - | 'XC20P'; + | 'XC20P' + // an unregistered, case-sensitive, collision-resistant string + | string; epk?: Uint8Array; @@ -444,10 +488,157 @@ export interface JweHeaderParams extends JoseHeaderParams { p2s?: string; - // Additional Public or Private Header Parameter names. + /** + * Additional Public or Private Header Parameter names. + */ [key: string]: unknown } +/** + * JSON Web Token (JWT) Header + * + * For a JWT object, the members of the JSON object represented by the JOSE Header describe the + * cryptographic operations applied to the JWT and optionally, additional properties of the JWT. + * Depending upon whether the JWT is a JWS or JWE, the corresponding rules for the JOSE Header + * values apply. + * + * The {@link https://datatracker.ietf.org/doc/html/rfc7519#section-5 | RFC 7519} specification + * further specifies the use of the following Header Parameters in both the cases where the JWT is a + * JWS and where it is a JWE: + * + * - "typ" (type) Header Parameter: This Header Parameter is OPTIONAL. When used, this Header + * Parameter MUST be used to declare the MIME Media Type of this complete JWT. This parameter is + * ignored by JWT implementations; any processing of this parameter is performed by the JWT + * application. If present, it is RECOMMENDED that its value be "JWT" to indicate that this + * object is a JWT. While media type names are not case sensitive, it is RECOMMENDED that "JWT" + * always be spelled using uppercase characters for compatibility with legacy implementations. + * + * - "cty" (content type) Header Parameter: This Header Parameter is OPTIONAL. When used, this + * Header Parameter MUST be used to declare the MIME Media Type of the secured content (the + * payload). In the normal case in which nested signing or encryption operations are not employed, + * the use of this Header Parameter is NOT RECOMMENDED. In the case that nested signing or + * encryption is employed, this Header Parameter MUST be present; in this case, the value MUST be + * "JWT", to indicate that a Nested JWT is carried in this JWT. While media type names are not + * case sensitive, it is RECOMMENDED that "JWT" always be spelled using uppercase characters + * for compatibility with legacy implementations. + * + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-5 | RFC 7519, Section 5} + */ +export type JwtHeaderParams = JwsHeaderParams | JweHeaderParams; + +/** + * JSON Web Token Payload + * + * The JWT Claims Set represents a JSON object whose members are the claims conveyed by the JWT. + * The Claim Names within a JWT Claims Set MUST be unique; JWT parsers MUST either reject JWTs + * with duplicate Claim Names or use a JSON parser that returns only the lexically last duplicate + * member name. + * + * The set of claims that a JWT must contain to be considered valid is context dependent and is + * undefined by RFC 7519. Specific applications of JWTs will require implementations to understand + * and process some claims in particular ways. + * + * There are three classes of JWT Claim Names: + * + * - Registered Claim Names: Claim names registered in the IANA "JSON Web Token Claims" registry. + * None of the claims defined below are intended to be mandatory to use or implement in all cases, + * but rather they provide a starting point for a set of useful, interoperable claims + * Applications using JWTs should define which specific claims they use and when they are required + * or optional. + * + * - Public Claim Names: Claim Names can be defined at will by those using JWTs. However, in order + * prevent collisions, any new Claim Name should either be registered in the IANA "JSON Web Token + * Claims" registry or be a Public Name: a value that contains a Collision-Resistant Name. In each + * case, the definer of the name or value needs to take reasonable precautions to make sure they + * are in control of the part of the namespace they use to define the Claim Name. + * + * - Private Claim Names: A producer and consumer of a JWT MAY agree to use Claim Names that are + * Private Names: names that are not Registered Claim Names or Public Claim Names. Unlike Public + * Claim Names, Private Claim Names are subject to collision and should be used with caution. + * + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4 | RFC 7519, Section 4} + */ +export interface JwtPayload { + /** + * Issuer + * Identifies the principal that issued the JWT. The "iss" value is a case-sensitive string + * containing a string or URI value. Use of this claim is OPTIONAL. + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.1 | RFC 7519, Section 4.1.1} + */ + iss?: string; + + /** + * Subject + * Identifies the principal that is the subject of the JWT. The claims in a JWT are normally + * statements about the subject. The subject value MUST either be scoped to be locally unique in + * the context of the issuer or be globally unique. The "sub" value is a case-sensitive string + * containing a string or URI value. Use of this claim is OPTIONAL. + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.2 | RFC 7519, Section 4.1.2} + */ + sub?: string; + + /** + * Audience + * Identifies the recipients that the JWT is intended for. Each principal intended to process + * the JWT MUST identify itself with a value in the audience claim. If the principal processing + * the claim does not identify itself with a value in the "aud" claim when this claim is present, + * then the JWT MUST be rejected. In the general case, the "aud" value is an array of case- + * sensitive strings, each containing a string or URI value. In the special case when the JWT has + * one audience, the "aud" value MAY be a single case-sensitive string containing a string or URI + * value. Use of this claim is OPTIONAL. + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3 | RFC 7519, Section 4.1.3} + */ + aud?: string | string[]; + + /** + * Expiration Time + * Identifies the expiration time on or after which the JWT MUST NOT be accepted for processing. + * The processing of the "exp" claim requires that the current date/time MUST be before the + * expiration date/time listed in the "exp" claim. Implementers MAY provide for some small leeway, + * usually no more than a few minutes, to account for clock skew. Its value MUST be a number + * containing a numeric date value. Use of this claim is OPTIONAL. + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4 | RFC 7519, Section 4.1.4} + */ + exp?: number; + + /** + * Not Before + * Identifies the time before which the JWT MUST NOT be accepted for processing. The processing + * of the "nbf" claim requires that the current date/time MUST be after or equal to the not-before + * date/time listed in the "nbf" claim. Implementers MAY provide for some small leeway, usually no + * more than a few minutes, to account for clock skew. Its value MUST be a number containing a + * numeric date value. Use of this claim is OPTIONAL. + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.5 | RFC 7519, Section 4.1.5} + */ + nbf?: number; + + /** + * Issued At + * Identifies the time at which the JWT was issued. This claim can be used to determine the age + * of the JWT. Its value MUST be a number containing a numeric date value. Use of this claim is + * OPTIONAL. + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.6 | RFC 7519, Section 4.1.6} + */ + iat?: number; + + /** + * JWT ID + * Provides a unique identifier for the JWT. The identifier value MUST be assigned in a manner + * that ensures that there is a negligible probability that the same value will be accidentally + * assigned to a different data object; if the application uses multiple issuers, collisions + * MUST be prevented among values produced by different issuers as well. The "jti" claim can be + * used to prevent the JWT from being replayed. The "jti" value is a case-sensitive string. + * Use of this claim is OPTIONAL. + * @see {@link https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7 | RFC 7519, Section 4.1.7} + */ + jti?: string; + + /** + * Additional Public or Private Claim names. + */ + [key: string]: unknown; +} + const multicodecToJoseMapping: { [key: string]: JsonWebKey } = { 'ed25519-pub' : { crv: 'Ed25519', kty: 'OKP', x: '' }, 'ed25519-priv' : { crv: 'Ed25519', kty: 'OKP', x: '', d: '' }, diff --git a/packages/crypto/src/utils.ts b/packages/crypto/src/utils.ts index 2636f815a..d3062ea54 100644 --- a/packages/crypto/src/utils.ts +++ b/packages/crypto/src/utils.ts @@ -1,5 +1,6 @@ +import { crypto } from '@noble/hashes/crypto'; import { Convert, Multicodec } from '@web5/common'; -import { bytesToHex, randomBytes as nobleRandomBytes } from '@noble/hashes/utils'; +import { randomBytes as nobleRandomBytes } from '@noble/hashes/utils'; /** * Checks whether the properties object provided contains the specified property. @@ -145,27 +146,10 @@ export function randomBytes(bytesLength: number): Uint8Array { * practically unique" given the large number of possible UUIDs and * the randomness of generation. * - * After generating the UUID, the function securely wipes the memory - * areas used to hold temporary values to prevent any possibility of - * the random values being unintentionally leaked or retained in memory. - * - * @returns A UUID string in version 4 format. + * @returns A string containing a randomly generated, 36 character long v4 UUID. */ export function randomUuid(): string { - const bytes = randomBytes(16); - bytes[6] = (bytes[6] & 0x0f) | 0x40; // set version 4 - bytes[8] = (bytes[8] & 0x3f) | 0x80; // set variant 1 - const hex = bytesToHex(bytes); - bytes.fill(0); // wipe the random values array - const segments = [ - hex.slice(0, 8), - hex.slice(8, 12), - hex.slice(12, 16), - hex.slice(16, 20), - hex.slice(20, 32) - ]; - const uuid = segments.join('-'); - segments.fill('0'); // wipe the segments array + const uuid = crypto.randomUUID(); return uuid; } \ No newline at end of file diff --git a/packages/crypto/tests/utils.spec.ts b/packages/crypto/tests/utils.spec.ts index 50a27e93f..c0c30d406 100644 --- a/packages/crypto/tests/utils.spec.ts +++ b/packages/crypto/tests/utils.spec.ts @@ -3,6 +3,7 @@ import * as sinon from 'sinon'; import { randomUuid, + randomBytes, keyToMultibaseId, multibaseIdToKey, checkValidProperty, @@ -117,7 +118,7 @@ describe('Crypto Utils', () => { }); describe('multibaseIdToKey()', () => { - it('Converts secp256k1-pub multibase identifiers', () => { + it('converts secp256k1-pub multibase identifiers', () => { const multibaseKeyId = 'zQ3shMrXA3Ah8h5asMM69USP8qRDnPaCLRV3nPmitAXVfWhgp'; const { key, multicodecCode, multicodecName } = multibaseIdToKey({ multibaseKeyId }); @@ -131,7 +132,7 @@ describe('Crypto Utils', () => { expect(multicodecName).to.equal('secp256k1-pub'); }); - it('Converts ed25519-pub multibase identifiers', () => { + it('converts ed25519-pub multibase identifiers', () => { const multibaseKeyId = 'z6MkizSHspkM891CAnYZis1TJkB4fWwuyVjt4pV93rWPGYwW'; const { key, multicodecCode, multicodecName } = multibaseIdToKey({ multibaseKeyId }); @@ -145,7 +146,7 @@ describe('Crypto Utils', () => { expect(multicodecName).to.equal('ed25519-pub'); }); - it('Converts x25519-pub multibase identifiers', () => { + it('converts x25519-pub multibase identifiers', () => { const multibaseKeyId = 'z6LSfsF6tQA7j56WSzNPT4yrzZprzGEK8137DMeAVLgGBJEz'; const { key, multicodecCode, multicodecName } = multibaseIdToKey({ multibaseKeyId }); @@ -160,17 +161,42 @@ describe('Crypto Utils', () => { }); }); + describe('randomBytes()', () => { + it('returns a Uint8Array of the specified length', () => { + const length = 16; + const result = randomBytes(length); + + expect(result).to.be.instanceof(Uint8Array); + expect(result).to.have.length(length); + }); + + it('handles invalid input gracefully', () => { + expect(() => randomBytes(-1)).to.throw(RangeError, 'length'); // Length cannot be negative. + expect(() => randomBytes(1e9)).to.throw(Error, 'exceed'); // Extremely large number that exceeds the available entropy. + }); + + it('produces unique values on each call', () => { + const set = new Set(); + for (let i = 0; i < 100; i++) { + set.add(randomBytes(10).toString()); + } + expect(set.size).to.equal(100); + }); + }); + describe('randomUuid()', () => { - it('should generate a valid v4 UUID', () => { + it('generates a valid v4 UUID', () => { const id = randomUuid(); expect(id).to.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/); expect(id).to.have.length(36); }); - it('should generate different UUIDs', () => { - const id1 = randomUuid(); - const id2 = randomUuid(); - expect(id1).to.not.equal(id2); + it('produces unique values on each call', () => { + const set = new Set(); + for (let i = 0; i < 100; i++) { + set.add(randomUuid()); + } + expect(set.size).to.equal(100); }); }); }); \ No newline at end of file diff --git a/packages/dids/src/did-resolver.ts b/packages/dids/src/did-resolver.ts index cdd49d505..9e66b5647 100644 --- a/packages/dids/src/did-resolver.ts +++ b/packages/dids/src/did-resolver.ts @@ -3,6 +3,8 @@ import type { DidMethodResolver, DidResolutionResult, DidResolutionOptions, + DidResource, + DidDereferenceResult } from './types.js'; import { parseDid } from './utils.js'; @@ -13,6 +15,13 @@ export type DidResolverOptions = { cache?: DidResolverCache; } +/** + * argument passed to {@link DidResolver.resolve} + */ +export type DereferenceParams = { + didUrl: string +} + /** * The `DidResolver` class is responsible for resolving DIDs to DID documents. * It uses method resolvers to resolve DIDs of different methods and a cache @@ -99,9 +108,87 @@ export class DidResolver { didUrl: parsedDid.did, resolutionOptions }); + await this.cache.set(parsedDid.did, resolutionResult); return resolutionResult; } } + + /** + * dereferences a DID (Decentralized Identifier) URL to a corresponding DID resource. This method interprets + * the DID URL's components, which include the DID method, method-specific identifier, path, query, and fragment, + * and retrieves the related resource as per the DID Core specifications. The dereferencing process involves resolving + * the DID contained in the DID URL to a DID document, and then extracting the specific part of the document identified + * by the fragment in the DID URL. If no fragment is specified, the entire DID document is returned. + * + * This method supports resolution of different components within a DID document such as + * service endpoints and verification methods, based on their IDs. It accommodates both full and relative DID URLs + * as specified in the DID Core specification. + * + * More information on DID URL dereferencing can be found in the DID Core specification + * [here](https://www.w3.org/TR/did-core/#did-url-dereferencing) + * + * @param params - An object of type `DereferenceParams` containing the `didUrl` which needs to be dereferenced. + * @returns a {@link DidDereferenceResult} + */ + async dereference(params: DereferenceParams): Promise { + const { didUrl } = params; + const { didDocument, didResolutionMetadata = {}, didDocumentMetadata = {} } = await this.resolve(didUrl); + if (didResolutionMetadata.error) { + return { + dereferencingMetadata : didResolutionMetadata, + contentStream : null, + contentMetadata : didDocumentMetadata + }; + } + + const parsedDid = parseDid(params); + + // return the entire DID Document if no fragment is present on the did url + if (!parsedDid.fragment) { + return { + dereferencingMetadata : didResolutionMetadata, + contentStream : didDocument, + contentMetadata : didDocumentMetadata + }; + } + + const { service = [], verificationMethod = [] } = didDocument; + + // create a set of possible id matches. the DID spec allows for an id to be the entire did#fragment or just #fragment. + // See: https://www.w3.org/TR/did-core/#relative-did-urls + // using a set for fast string comparison. DIDs can be lonnng. + const idSet = new Set([didUrl, parsedDid.fragment, `#${parsedDid.fragment}`]); + + let didResource: DidResource; + for (let vm of verificationMethod) { + if (idSet.has(vm.id)) { + didResource = vm; + break; + } + } + + for (let svc of service) { + if (idSet.has(svc.id)) { + didResource = svc; + break; + } + } + if (didResource) { + return { + dereferencingMetadata : didResolutionMetadata, + contentStream : didResource, + contentMetadata : didResolutionMetadata + }; + } else { + return { + dereferencingMetadata: { + error: 'notFound' + }, + contentStream : null, + contentMetadata : {}, + }; + } + } } \ No newline at end of file diff --git a/packages/dids/src/types.ts b/packages/dids/src/types.ts index b1e95b462..097315afb 100644 --- a/packages/dids/src/types.ts +++ b/packages/dids/src/types.ts @@ -90,6 +90,11 @@ export interface DidMethodOperator { getDefaultSigningKey(options: { didDocument: DidDocument }): Promise; } +/** + * A DID Resource is either a DID Document, a DID Verification method or a DID Service + */ +export type DidResource = DidDocument | VerificationMethod | DidService + /** * Services are used in DID documents to express ways of communicating with the DID subject or associated entities. * A service can be any type of service the DID subject wants to advertise. @@ -178,6 +183,35 @@ export type DidResolutionResult = { didDocumentMetadata: DidDocumentMetadata }; +export type DidDereferenceResult = { + /** + * A metadata structure consisting of values relating to the results of the DID URL dereferencing process. + * This structure is REQUIRED, and in the case of an error in the dereferencing process, this MUST NOT be empty. + * Properties defined by this specification are in 7.2.2 DID URL Dereferencing Metadata. If the dereferencing is + * not successful, this structure MUST contain an error property describing the error. + */ + dereferencingMetadata: DidResolutionMetadata + /** + * If the dereferencing function was called and successful, this MUST contain a resource corresponding to the DID URL. + * The contentStream MAY be a resource such as: + * * A DID document that is serializable in one of the conformant representations + * * A Verification Method, + * * A service + * * Any other resource format that can be identified via a Media Type and obtained through the resolution process. + * + * If the dereferencing is unsuccessful, this value MUST be empty. + */ + contentStream: DidResource | null + /** + * If the dereferencing is successful, this MUST be a metadata structure, but the structure MAY be empty. + * This structure contains metadata about the contentStream. If the contentStream is a DID document, + * this MUST be a didDocumentMetadata structure as described in DID Resolution. If the dereferencing is unsuccessful, + * this output MUST be an empty metadata structure. + + */ + contentMetadata: DidDocumentMetadata +} + /** * implement this interface to provide your own cache for did resolution results. can be plugged in through Web5 API */ @@ -275,4 +309,4 @@ export type VerificationRelationship = * subject to invoke a cryptographic capability, such as the authorization * to update the DID Document. */ - | 'capabilityInvocation'; + | 'capabilityInvocation'; \ No newline at end of file diff --git a/packages/dids/src/utils.ts b/packages/dids/src/utils.ts index 39bd6e5b9..d4ed0881f 100644 --- a/packages/dids/src/utils.ts +++ b/packages/dids/src/utils.ts @@ -1,7 +1,7 @@ import type { PublicKeyJwk } from '@web5/crypto'; import { parse, type ParsedDID } from 'did-resolver'; -import type { DidDocument, DidService, DidServiceEndpoint, DwnServiceEndpoint } from './types.js'; +import type { DidDocument, DidResource, VerificationMethod, DidService, DidServiceEndpoint, DwnServiceEndpoint } from './types.js'; export interface ParsedDid { did: string @@ -121,4 +121,13 @@ export function parseDid({ didUrl }: { didUrl: string }): ParsedDid | undefined const parsedDid: ParsedDid = parse(didUrl); return parsedDid; +} + +/** + * type guard for {@link VerificationMethod} + * @param didResource - the resource to check + * @returns true if the didResource is a `VerificationMethod` + */ +export function isVerificationMethod(didResource: DidResource): didResource is VerificationMethod { + return didResource && 'id' in didResource && 'type' in didResource && 'controller' in didResource; } \ No newline at end of file diff --git a/packages/dids/tests/did-resolver.spec.ts b/packages/dids/tests/did-resolver.spec.ts index 914e5a49d..1b182c63c 100644 --- a/packages/dids/tests/did-resolver.spec.ts +++ b/packages/dids/tests/did-resolver.spec.ts @@ -6,6 +6,7 @@ import { DidResolver } from '../src/did-resolver.js'; import { didResolverTestVectors } from './fixtures/test-vectors/did-resolver.js'; import { DidResolverCacheLevel } from '../src/resolver-cache-level.js'; import { DidResolverCache } from '../src/types.js'; +import { isVerificationMethod } from '../src/utils.js'; describe('DidResolver', () => { describe('resolve()', () => { @@ -114,4 +115,53 @@ describe('DidResolver', () => { }); }); }); + + describe('dereference()', () => { + let didResolver: DidResolver; + + beforeEach(() => { + const didMethodApis = [DidKeyMethod]; + didResolver = new DidResolver({ didResolvers: didMethodApis }); + }); + + it('returns a result with contentStream set to null and dereferenceMetadata.error set if resolution fails', async () => { + const result = await didResolver.dereference({ didUrl: 'abcd123;;;' }); + expect(result.contentStream).to.be.null; + expect(result.dereferencingMetadata.error).to.exist; + expect(result.dereferencingMetadata.error).to.equal('invalidDid'); + + }); + + it('returns the appropriate DID resource as the value of contentStream if found', async () => { + const did = await DidKeyMethod.create(); + + const result = await didResolver.dereference({ didUrl: did.document.verificationMethod[0].id }); + expect(result.contentStream).to.be.not.be.null; + expect(result.dereferencingMetadata.error).to.not.exist; + + const didResource = result.contentStream; + expect(isVerificationMethod(didResource)).to.be.true; + }); + + it('returns the entire did document as the value of contentStream if the did url contains no fragment', async () => { + const did = await DidKeyMethod.create(); + + const result = await didResolver.dereference({ didUrl: did.did }); + expect(result.contentStream).to.be.not.be.null; + expect(result.dereferencingMetadata.error).to.not.exist; + + const didResource = result.contentStream; + expect(didResource['@context']).to.exist; + expect(didResource['@context']).to.include('https://www.w3.org/ns/did/v1'); + }); + + it('returns contentStream set to null and dereferenceMetadata.error set to notFound if resource is not found', async () => { + const did = await DidKeyMethod.create(); + + const result = await didResolver.dereference({ didUrl: `${did.did}#0` }); + expect(result.contentStream).to.be.null; + expect(result.dereferencingMetadata.error).to.exist; + expect(result.dereferencingMetadata.error).to.equal('notFound'); + }); + }); }); \ No newline at end of file