From a1742233c6b1d0ad3b5e12f17159019b65db51fa Mon Sep 17 00:00:00 2001 From: Paul Le Cam Date: Thu, 29 Aug 2024 14:00:04 +0100 Subject: [PATCH 1/2] Add WebAuthn test vectors --- apps/explorer/package.json | 8 +- package.json | 2 +- packages/events/package.json | 2 +- packages/http-client/package.json | 4 +- packages/identifiers/package.json | 2 +- packages/model-instance-handler/package.json | 2 +- packages/model-instance-protocol/package.json | 2 +- packages/model-protocol/package.json | 2 +- .../test-vectors/assets/key-ecdsa-p256.car | Bin 2467 -> 2467 bytes packages/test-vectors/assets/pkh-ethereum.car | Bin 10772 -> 10772 bytes packages/test-vectors/assets/pkh-solana.car | Bin 10694 -> 10694 bytes packages/test-vectors/assets/pkh-webauthn.car | Bin 0 -> 11655 bytes packages/test-vectors/package.json | 6 +- .../scripts/create-test-vectors.ts | 123 +++++----- .../test-vectors/scripts/utils/webauthn.ts | 156 ++++++++++++ packages/test-vectors/src/index.ts | 1 + packages/test-vectors/test/vectors.test.ts | 26 +- pnpm-lock.yaml | 231 +++++++++++------- 18 files changed, 386 insertions(+), 181 deletions(-) create mode 100644 packages/test-vectors/assets/pkh-webauthn.car create mode 100644 packages/test-vectors/scripts/utils/webauthn.ts diff --git a/apps/explorer/package.json b/apps/explorer/package.json index a1dd0ba..933450e 100644 --- a/apps/explorer/package.json +++ b/apps/explorer/package.json @@ -20,10 +20,10 @@ "@didtools/key-did": "^1.0.0", "@mantine/core": "^7.11.2", "@mantine/hooks": "^7.11.2", - "@tabler/icons-react": "^3.12.0", + "@tabler/icons-react": "^3.14.0", "@tanstack/react-query": "^5.52.2", - "@tanstack/react-router": "^1.51.0", - "codeco": "^1.4.1", + "@tanstack/react-router": "^1.51.2", + "codeco": "^1.4.2", "jotai": "^2.9.2", "multiformats": "^13.2.2", "react": "^18.3.1", @@ -32,7 +32,7 @@ "devDependencies": { "@ceramic-sdk/model-client": "workspace:^", "@ceramic-sdk/model-instance-client": "workspace:^", - "@tanstack/router-devtools": "^1.51.0", + "@tanstack/router-devtools": "^1.51.2", "@tanstack/router-plugin": "^1.51.0", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", diff --git a/package.json b/package.json index cb7d5cd..49a1e6c 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "del-cli": "^5.1.0", "jest": "^29.7.0", "tsx": "^4.19.0", - "turbo": "^2.0.14", + "turbo": "^2.1.0", "typescript": "^5.5.2" }, "pnpm": { diff --git a/packages/events/package.json b/packages/events/package.json index bff4898..2234e01 100644 --- a/packages/events/package.json +++ b/packages/events/package.json @@ -37,7 +37,7 @@ "@ipld/dag-cbor": "^9.2.1", "@ipld/dag-json": "^10.2.2", "cartonne": "^3.0.1", - "codeco": "^1.4.1", + "codeco": "^1.4.2", "dag-jose": "^5.1.1", "multiformats": "^13.2.2", "multihashes-sync": "^2.0.0", diff --git a/packages/http-client/package.json b/packages/http-client/package.json index 5186ba6..e377703 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -38,10 +38,10 @@ }, "devDependencies": { "cartonne": "^3.0.1", - "codeco": "^1.4.1", + "codeco": "^1.4.2", "multiformats": "^13.2.2", "openapi-typescript": "^7.3.0", - "type-fest": "^4.24.0" + "type-fest": "^4.26.0" }, "jest": { "extensionsToTreatAsEsm": [".ts"], diff --git a/packages/identifiers/package.json b/packages/identifiers/package.json index 16ea146..3f06823 100644 --- a/packages/identifiers/package.json +++ b/packages/identifiers/package.json @@ -33,7 +33,7 @@ }, "dependencies": { "@ipld/dag-cbor": "^9.2.1", - "codeco": "^1.4.1", + "codeco": "^1.4.2", "mapmoize": "^1.2.1", "multiformats": "^13.2.2", "uint8arrays": "^5.1.0", diff --git a/packages/model-instance-handler/package.json b/packages/model-instance-handler/package.json index 0bdad2d..d77b20e 100644 --- a/packages/model-instance-handler/package.json +++ b/packages/model-instance-handler/package.json @@ -37,7 +37,7 @@ "@ceramic-sdk/model-instance-protocol": "workspace:^", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", - "codeco": "^1.4.1", + "codeco": "^1.4.2", "fast-json-patch": "^3.1.1", "uint8arrays": "^5.1.0" }, diff --git a/packages/model-instance-protocol/package.json b/packages/model-instance-protocol/package.json index a464746..d3e6dae 100644 --- a/packages/model-instance-protocol/package.json +++ b/packages/model-instance-protocol/package.json @@ -35,7 +35,7 @@ "@ceramic-sdk/events": "workspace:^", "@ceramic-sdk/identifiers": "workspace:^", "@didtools/codecs": "^3.0.0", - "codeco": "^1.4.1", + "codeco": "^1.4.2", "object-sizeof": "^2.6.4" }, "devDependencies": { diff --git a/packages/model-protocol/package.json b/packages/model-protocol/package.json index 8b14d9d..06d84d1 100644 --- a/packages/model-protocol/package.json +++ b/packages/model-protocol/package.json @@ -38,7 +38,7 @@ "@didtools/codecs": "^3.0.0", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", - "codeco": "^1.4.1", + "codeco": "^1.4.2", "json-ptr": "^3.1.1" }, "devDependencies": { diff --git a/packages/test-vectors/assets/key-ecdsa-p256.car b/packages/test-vectors/assets/key-ecdsa-p256.car index 3d0eedb056eaad39a765e9eaf14076419fe4e52b..c5cee3027fb6c5c00ca805f4ead6a70bf8bc5de5 100644 GIT binary patch literal 2467 zcmcColv$Z4vt=+drhmFOy*Lio9<~=&V<+xriJ@#~PfPwX*^n%37oczR;2o+-d zomHHfo|jlsT9jJcxG1xrD8D2%xg<3uqPbcrF(+NgO35|Y$ka?pM=3iq1;``Y^~xms zSE)7=?zRYr72>;tohvW4O)t<*Du~;m#TRY`qqGdj?}{G z)4$(R;c-%Q>c7OV@^DVvg1@G_9g=w$gHu7KsvkqKv$Eg^&6`s@E3#+kS2+HElO6x= z>YqagJ?(w>FHXu#0j4lD2BLx*oMajoC*>C;C#IyN6eN~pr0bU!025MbYFT1VY3kRM zf}+$i;thmGvBtqzr<}88Qq8k8me?_t@4k|=%}_b>)1Q$2@y8`+Ziq&UVnUu8Dp8!U zSM;=A_T-s-&Tb{^R=wQ$ciY*}JIq1#H$}HHsv8HaJSM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zk3;cX2xFPUR!(s@bauonRT;~q} diff --git a/packages/test-vectors/assets/pkh-ethereum.car b/packages/test-vectors/assets/pkh-ethereum.car index 320a8c98ade00d4e7983fbf4000449b85a7e82b8..fdbd9a35d4b66c07c68b28e725835c5278bdb3c5 100644 GIT binary patch literal 10772 zcmeHN2~-qUx(1g~6qlgUAOR6EDvH#;K#XFDphk^~xF&k5>Q;C4TD{P8x6!}@SJYr4 zIJiUwgVE7I)Ibig3`!8Sp z%NLmgt!A^`mhwZ`=q_H~7QbMD>$I-CS5#3O*2g|Q{Iqf9&>elw9GvnUHFm|ac@cvO zH4bRCDQ1)R{6-bGxBEDB1L^nu@Fp3BxlOKgxaxgxWA_7DY*#r%?#En@%`Mm%a{n&=wVdcTXADX^vB~kOJXb?`*uRY zu;HYnlSY%q7_)hlDnh5~e1%7!a12M^cnpiI{Pw~yY^(a5AI_k|BT~$`Ft;C9;6PaEca@VlWyL0nSQ1 zL304zCNQK(vjPWc49XIP&JIW*^DHKcEIK?UU@Qd%5lR$EKvKkHjv)z5rf`DBcnLiM ziUNxZz%ExPl*fy`E4;!KmV5G@OC8FWI9HwAOZb#8y1Z2#SFGRZXMl@Gq)u&|BUKz_ zd8NAU$XW;_Xk8)NpbCv<2^y;Yj_$hGyFrDtdH#FMuYA@g=h0~L(d7NNQ~%h?9=K%S zoOO{M+Dyq1AGDMcO^PKE#&~%*Xs8#>CcD*aFd#2Y`SpG_wW0S^Z@=LAy1V1mvpMl2 z(??Dlmb|vu)d%KJZGy*M2n)PO@&21u+k_<+YwNoTXT5S{(rB@^*>et3w=U*D2A(NGwLyqoywb#qU z7jrj!7It%K`0+*~wndC@E?w>2Wpk;$TdtCAo}W4(d7a-IB~w1gpD=XFjk)V>5L&jg8X!&^k;*NhypTG3c!#&%|gN?a@ zA|d>G&Fg2`tkU&Tas{(00!floVApCQ5>@1o5ITS%5#EthD|GyPfz`e;Zf8(V*NKmP z3uc}E%zy0WmNyUe?(z4I1Iye6d$WfycL&t+6;Fr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#Q-(?%cZeD37YIY*PCUU<{T-kkQv z;c`idt;wH^{bCVCdAM91h=Wg;{jO)4{Rqy}jmlE^L?9tWv=*}@DU0hhW=m+jm(Emk zvpLpOFbR?Z7S3bYU+cy&I&>U+rb8fL-K>L!>=q7W3Oa9+6>6tBOBqMAo|GiUWMbS* zwHre!XN-v%S{DeXC>?Q#4>TAJM#dvDXGk>GWDkd@%P=_9LYUB{J_i1shW>Q-N<`a_wO05NT`AZV@|6FF`dL`XHNeS=6uF{^F_|3lJ%>nwu-EUf8@BByKCOZ2X>#U zJy29xwpsYqN8b^t(IT{)6x^U%WUD7bqr(4rlws$R_vXy~az=?Ke_z|8qybYezgF1i zqm5e^pIeuLS^fXWnW|U)bLD%ZrOo%9JG1g|RajNr-4&&CT1BUDjvsBOG_+n*<0iRT zeE+=c(1PSGRVWWeN&Y%(Uk!DE%1z0g0WBiYX5^4#sE=t`{8j2EXJ(rEG)3PR=k7CGK z0A$qFKEOv~3Wd(vXbp_0p=hD*hitF^;q)X#cODMp{Bb30$j~C`v3p{ literal 0 HcmV?d00001 diff --git a/packages/test-vectors/package.json b/packages/test-vectors/package.json index a48193f..3b3a488 100644 --- a/packages/test-vectors/package.json +++ b/packages/test-vectors/package.json @@ -48,15 +48,19 @@ "@ceramic-sdk/test-utils": "workspace:^", "@didtools/cacao": "^3.0.1", "@didtools/key-did": "^1.0.0", + "@didtools/key-webauthn": "^2.0.2", "@didtools/key-webcrypto": "^0.2.0", "@didtools/pkh-ethereum": "^0.6.0", "@didtools/pkh-solana": "^0.2.0", + "@noble/curves": "^1.5.0", "@solana/signers": "^2.0.0-rc.1", "caip": "^1.1.1", + "cborg": "^4.2.3", "did-session": "^4.0.0", "dids": "^5.0.2", "key-did-resolver": "^4.0.0", - "multiformats": "^13.1.1" + "multiformats": "^13.1.1", + "uint8arrays": "^5.1.0" }, "jest": { "extensionsToTreatAsEsm": [".ts"], diff --git a/packages/test-vectors/scripts/create-test-vectors.ts b/packages/test-vectors/scripts/create-test-vectors.ts index f126df9..36f1db2 100644 --- a/packages/test-vectors/scripts/create-test-vectors.ts +++ b/packages/test-vectors/scripts/create-test-vectors.ts @@ -11,7 +11,7 @@ import { getDeterministicInitEvent, } from '@ceramic-sdk/model-instance-client' import { getStreamID } from '@ceramic-sdk/model-instance-protocol' -import type { Cacao } from '@didtools/cacao' +import type { AuthMethod, Cacao } from '@didtools/cacao' import type { IBlock } from 'cartonne' import type { CreateJWSOptions, DID } from 'dids' @@ -26,6 +26,7 @@ import { import { getAuthMethod as getEthereumAuth } from './utils/ethereum.ts' import { writeCARFile } from './utils/fs.ts' import { getAuthMethod as getSolanaAuth } from './utils/solana.ts' +import { getAuthMethod as getWebAuthnAuth } from './utils/webauthn.ts' import { getP256KeyDID } from './utils/webcrypto.ts' function changeEventSignature(event: SignedEvent): SignedEvent { @@ -55,19 +56,55 @@ const MODEL_ID = 'k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lq' const model = StreamID.fromString(MODEL_ID) -type Controller = { +type ControllerCommon = { id: string signer: DID -} & ( - | { withCapability: false } - | { - withCapability: true - expiredSigner: DID - noResourceSigner: DID - expectedModelSigner: DID - otherModelSigner: DID - } -) +} + +type ControllerWithoutCapability = ControllerCommon & { withCapability: false } + +type ControllerWithCapability = ControllerCommon & { + withCapability: true + expiredSigner: DID + noResourceSigner: DID + expectedModelSigner: DID + otherModelSigner: DID +} + +type Controller = ControllerWithoutCapability | ControllerWithCapability + +async function createCapabilityController( + authMethod: AuthMethod, +): Promise { + const [ + signer, + expiredSigner, + noResourceSigner, + expectedModelSigner, + otherModelSigner, + ] = await Promise.all([ + createCapabilityDID(authMethod, { resources: ['ceramic://*'] }), + createExpiredCapabilityDID(authMethod, { resources: ['ceramic://*'] }), + createCapabilityDID(authMethod, { resources: [] }), + createCapabilityDID(authMethod, { + resources: [`ceramic://*?model=${MODEL_ID}`], + }), + createCapabilityDID(authMethod, { + resources: [ + 'ceramic://*?model=k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lr', + ], + }), + ]) + return { + withCapability: true, + id: signer.id, + signer, + expiredSigner, + noResourceSigner, + expectedModelSigner, + otherModelSigner, + } +} const controllerFactories = { 'key-ecdsa-p256': async () => { @@ -79,65 +116,15 @@ const controllerFactories = { }, 'pkh-ethereum': async () => { const authMethod = await getEthereumAuth() - const [ - signer, - expiredSigner, - noResourceSigner, - expectedModelSigner, - otherModelSigner, - ] = await Promise.all([ - createCapabilityDID(authMethod, { resources: ['ceramic://*'] }), - createExpiredCapabilityDID(authMethod, { resources: ['ceramic://*'] }), - createCapabilityDID(authMethod, { resources: [] }), - createCapabilityDID(authMethod, { - resources: [`ceramic://*?model=${MODEL_ID}`], - }), - createCapabilityDID(authMethod, { - resources: [ - 'ceramic://*?model=k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lr', - ], - }), - ]) - return { - withCapability: true, - id: signer.id, - signer, - expiredSigner, - noResourceSigner, - expectedModelSigner, - otherModelSigner, - } + return await createCapabilityController(authMethod) }, 'pkh-solana': async () => { const authMethod = await getSolanaAuth() - const [ - signer, - expiredSigner, - noResourceSigner, - expectedModelSigner, - otherModelSigner, - ] = await Promise.all([ - createCapabilityDID(authMethod, { resources: ['ceramic://*'] }), - createExpiredCapabilityDID(authMethod, { resources: ['ceramic://*'] }), - createCapabilityDID(authMethod, { resources: [] }), - createCapabilityDID(authMethod, { - resources: [`ceramic://*?model=${MODEL_ID}`], - }), - createCapabilityDID(authMethod, { - resources: [ - 'ceramic://*?model=k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lr', - ], - }), - ]) - return { - withCapability: true, - id: signer.id, - signer, - expiredSigner, - noResourceSigner, - expectedModelSigner, - otherModelSigner, - } + return await createCapabilityController(authMethod) + }, + 'pkh-webauthn': async () => { + const authMethod = await getWebAuthnAuth() + return await createCapabilityController(authMethod) }, } satisfies Record Controller | Promise> diff --git a/packages/test-vectors/scripts/utils/webauthn.ts b/packages/test-vectors/scripts/utils/webauthn.ts new file mode 100644 index 0000000..0c74404 --- /dev/null +++ b/packages/test-vectors/scripts/utils/webauthn.ts @@ -0,0 +1,156 @@ +import type { AuthMethod } from '@didtools/cacao' +import { WebauthnAuth } from '@didtools/key-webauthn' +import { p256 } from '@noble/curves/p256' +import { encode } from 'cborg' +import * as u8a from 'uint8arrays' + +type MockCredential = { + secret: Uint8Array + pk: Uint8Array + id: string + rawId: ArrayBuffer + userHandle: Uint8Array + createResponse: PublicKeyCredential +} + +/** + * Dummy webauthn/fido2 Mock device that uses + * p256/ES256(-7). + * Produces structurally correct and verifiale credentials/signatures for unit tests. + * Does not support multiple credentials. + */ +export class MockAuthenticator { + credentials: Array = [] + + async create(opts: CredentialCreationOptions) { + // Return previous cached result + if (this.credentials.length) return this.credentials[0].createResponse + + // Generate a new identity + const secret = p256.utils.randomPrivateKey() + const pk = p256.getPublicKey(secret) + const rawId = u8a.concat([pk.slice(1, 14), u8a.fromString('STUB', 'utf8')]) + const id = u8a.toString(rawId, 'base64url') + const userHandle = hash( + opts.publicKey?.user?.id || p256.CURVE.randomBytes(32), + ) + const authData = mkAuthData(pk) + const attestationObject = bufToU8( + encode({ fmt: 'none', attStmt: {}, authData }), + ) + const challenge = u8a.toString( + opts.publicKey?.challenge as Uint8Array, + 'base64url', + ) + const rawCDJ = { + type: 'webauthn.create', + origin: opts.publicKey?.rp?.id, + challenge, + crossOrigin: false, + } + const clientDataJSON = u8a.fromString(JSON.stringify(rawCDJ)) + const out: PublicKeyCredential = { + authenticatorAttachment: 'cross-platform', + id, + rawId, + response: { + attestationObject, + clientDataJSON, + userHandle, + getPublicKey: () => pk, + getPublicKeyAlgorithm: () => -7, + getTransports: () => ['nfc', 'usb'], + getAuthenticatorData: () => authData, + } as AuthenticatorAttestationResponse, + type: 'public-key', + getClientExtensionResults: () => ({}), + } + this.credentials.push({ + secret, + pk, + id, + rawId, + userHandle, + createResponse: out, + }) + return out + } + + async get(opts) { + const { secret, id, rawId, userHandle } = this.credentials[0] // pick first + const challenge = u8a.toString( + opts.publicKey.challenge as Uint8Array, + 'base64url', + ) + const rawCDJ = { + type: 'webauthn.get', + origin: opts.publicKey?.rp?.id, + challenge, + crossOrigin: false, + } + const clientDataJSON = u8a.fromString(JSON.stringify(rawCDJ)) + // This authenticatorData dosen't matter really but don't try to decode it. + const authenticatorData = u8a.fromString( + 'f689f6b7489197aacf01172f02a82e0715f72aff70d5f758b9b0f7d3999978d20500000004', + ) + const msgHash = hash(u8a.concat([authenticatorData, hash(clientDataJSON)])) + const signature = p256.sign(msgHash, secret).toDERRawBytes() + const out: PublicKeyCredential = { + authenticatorAttachment: 'cross-platform', + id, + rawId, + response: { + authenticatorData, + clientDataJSON, + signature, + userHandle, + } as AuthenticatorAssertionResponse, + type: 'public-key', + getClientExtensionResults: () => ({}), + } + return out + } +} + +// cbor decoders in @didtools/* codebase do not support numerical keys, +// assuming that the encode does not either. +// The offset in authenticator data is static, +// so we use a live sample and inject the test-key to satisfy utils.js#decodeAuthenticatorData(). +function mkAuthData(pk) { + const authDataCreate = + 'f689f6b7489197aacf01172f02a82e0715f72aff70d5f758b9b0f7d3999978d2c5000000020000000000000000000000000000000000309face7743395482aefb4e1a67134641cdea3529c5752594090f26252e2198e4a0c547a4b0bd2fa346500e47cdf9c58f6a50102032620012158209face7743395482aefb4e1a671aafbf1566cc099f7647db230952bc169f43f9c2258203462f7968f7824f955570f3453280452948cccf132f03f369a2e834546649a78a16b6372656450726f7465637402' + const buffer = u8a.fromString(authDataCreate, 'hex') + const point = p256.ProjectivePoint.fromHex(u8a.toString(pk, 'hex')) + const uncompressed = point.toRawBytes(false) + const offsetX = 113 + const offsetY = 148 + const x = uncompressed.slice(1, 33) + const y = uncompressed.slice(33) + buffer.set(x, offsetX) + buffer.set(y, offsetY) + return buffer +} + +// node:Buffer to Uint8Array +function bufToU8(b) { + if (b instanceof Uint8Array || b instanceof ArrayBuffer) return b // no conversion needed + return new Uint8Array(b.buffer.slice(b.offset, b.offset + b.length)) +} +function hash(m) { + return p256.CURVE.hash(m) +} + +// Stub navigator.credentials for nodeJS +// @ts-ignore +globalThis.location ??= {} +// @ts-ignore +globalThis.location.hostname = 'http://localhost' +// @ts-ignore +globalThis.navigator ??= {} +// @ts-ignore +globalThis.navigator.credentials = new MockAuthenticator() + +export async function getAuthMethod(): Promise { + const did = await WebauthnAuth.createDID('test') + return await WebauthnAuth.getAuthMethod({ did }) +} diff --git a/packages/test-vectors/src/index.ts b/packages/test-vectors/src/index.ts index 705868e..2a8b992 100644 --- a/packages/test-vectors/src/index.ts +++ b/packages/test-vectors/src/index.ts @@ -12,6 +12,7 @@ const CONTROLLER_TYPES = { 'key-ed25519': true, 'pkh-ethereum': true, 'pkh-solana': true, + 'pkh-webauthn': true, } export type ControllerType = keyof typeof CONTROLLER_TYPES diff --git a/packages/test-vectors/test/vectors.test.ts b/packages/test-vectors/test/vectors.test.ts index 5afa928..ac84f3e 100644 --- a/packages/test-vectors/test/vectors.test.ts +++ b/packages/test-vectors/test/vectors.test.ts @@ -11,10 +11,14 @@ import { } from '@ceramic-sdk/model-instance-protocol' import { Cacao } from '@didtools/cacao' import { createDID } from '@didtools/key-did' +import { WebauthnAuth } from '@didtools/key-webauthn' import { getEIP191Verifier } from '@didtools/pkh-ethereum' import { getSolanaVerifier } from '@didtools/pkh-solana' import type { CAR } from 'cartonne' +// Inject mock WebAuthn authenticator +import '../scripts/utils/webauthn.ts' + import { type ArchiveRootContentCommon, type ArchiveRootContentWithCapability, @@ -26,13 +30,19 @@ const EXPECTED_EXPIRED_DATE = new Date(2000, 0).toISOString() const verifier = createDID() -const [keyP256CAR, keyEd25519CAR, pkhEthereumCAR, pkhSolanaCAR] = - await Promise.all([ - loadCAR('key-ecdsa-p256'), - loadCAR('key-ed25519'), - loadCAR('pkh-ethereum'), - loadCAR('pkh-solana'), - ]) +const [ + keyP256CAR, + keyEd25519CAR, + pkhEthereumCAR, + pkhSolanaCAR, + pkhWebAuthnCAR, +] = await Promise.all([ + loadCAR('key-ecdsa-p256'), + loadCAR('key-ed25519'), + loadCAR('pkh-ethereum'), + loadCAR('pkh-solana'), + loadCAR('pkh-webauthn'), +]) // Tests applying to any DID type @@ -41,6 +51,7 @@ describe.each([ ['key-ed25519', keyEd25519CAR], ['pkh-ethereum', pkhEthereumCAR], ['pkh-solana', pkhSolanaCAR], + ['pkh-webauthn', pkhWebAuthnCAR], ])('common checks using %s', (controllerType: string, car: CAR) => { const root = car.get(car.roots[0]) as ArchiveRootContentCommon @@ -129,6 +140,7 @@ describe.each([ describe.each([ ['pkh-ethereum', pkhEthereumCAR, getEIP191Verifier()], ['pkh-solana', pkhSolanaCAR, getSolanaVerifier()], + ['pkh-webauthn', pkhWebAuthnCAR, WebauthnAuth.getVerifier()], ])( 'CACAO signatures using %s', (controllerType: string, car: CAR, verifiers) => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6552b0e..58109c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,8 +39,8 @@ importers: specifier: ^4.19.0 version: 4.19.0 turbo: - specifier: ^2.0.14 - version: 2.0.14 + specifier: ^2.1.0 + version: 2.1.0 typescript: specifier: ^5.5.2 version: 5.5.4 @@ -72,17 +72,17 @@ importers: specifier: ^7.11.2 version: 7.12.1(react@18.3.1) '@tabler/icons-react': - specifier: ^3.12.0 - version: 3.13.0(react@18.3.1) + specifier: ^3.14.0 + version: 3.14.0(react@18.3.1) '@tanstack/react-query': specifier: ^5.52.2 version: 5.52.2(react@18.3.1) '@tanstack/react-router': - specifier: ^1.51.0 - version: 1.51.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.51.2 + version: 1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) codeco: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.4.2 + version: 1.4.2 jotai: specifier: ^2.9.2 version: 2.9.3(@types/react@18.3.4)(react@18.3.1) @@ -103,11 +103,11 @@ importers: specifier: workspace:^ version: link:../../packages/model-instance-client '@tanstack/router-devtools': - specifier: ^1.51.0 - version: 1.51.0(@tanstack/react-router@1.51.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.51.2 + version: 1.51.2(@tanstack/react-router@1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/router-plugin': specifier: ^1.51.0 - version: 1.51.0(vite@5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41))) + version: 1.51.0(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41))) '@types/react': specifier: ^18.3.3 version: 18.3.4 @@ -116,7 +116,7 @@ importers: version: 18.3.0 '@vitejs/plugin-react-swc': specifier: ^3.5.0 - version: 3.7.0(vite@5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41))) + version: 3.7.0(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41))) postcss: specifier: ^8.4.40 version: 8.4.41 @@ -134,7 +134,7 @@ importers: version: 5.5.4 vite: specifier: ^5.4.0 - version: 5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41)) + version: 5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)) packages/events: dependencies: @@ -154,8 +154,8 @@ importers: specifier: ^3.0.1 version: 3.0.1 codeco: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.4.2 + version: 1.4.2 dag-jose: specifier: ^5.1.1 version: 5.1.1 @@ -192,8 +192,8 @@ importers: specifier: ^3.0.1 version: 3.0.1 codeco: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.4.2 + version: 1.4.2 multiformats: specifier: ^13.2.2 version: 13.2.2 @@ -201,8 +201,8 @@ importers: specifier: ^7.3.0 version: 7.3.0(typescript@5.5.4) type-fest: - specifier: ^4.24.0 - version: 4.25.0 + specifier: ^4.26.0 + version: 4.26.0 packages/identifiers: dependencies: @@ -210,8 +210,8 @@ importers: specifier: ^9.2.1 version: 9.2.1 codeco: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.4.2 + version: 1.4.2 mapmoize: specifier: ^1.2.1 version: 1.2.1 @@ -350,8 +350,8 @@ importers: specifier: ^3.0.1 version: 3.0.1(ajv@8.17.1) codeco: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.4.2 + version: 1.4.2 fast-json-patch: specifier: ^3.1.1 version: 3.1.1 @@ -390,8 +390,8 @@ importers: specifier: ^3.0.0 version: 3.0.0 codeco: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.4.2 + version: 1.4.2 object-sizeof: specifier: ^2.6.4 version: 2.6.5 @@ -424,8 +424,8 @@ importers: specifier: ^3.0.1 version: 3.0.1(ajv@8.17.1) codeco: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.4.2 + version: 1.4.2 json-ptr: specifier: ^3.1.1 version: 3.1.1 @@ -507,6 +507,9 @@ importers: '@didtools/key-did': specifier: ^1.0.0 version: 1.0.0(typescript@5.5.4)(zod@3.23.8) + '@didtools/key-webauthn': + specifier: ^2.0.2 + version: 2.0.2(typescript@5.5.4)(zod@3.23.8) '@didtools/key-webcrypto': specifier: ^0.2.0 version: 0.2.0 @@ -516,12 +519,18 @@ importers: '@didtools/pkh-solana': specifier: ^0.2.0 version: 0.2.0(typescript@5.5.4)(zod@3.23.8) + '@noble/curves': + specifier: ^1.5.0 + version: 1.5.0 '@solana/signers': specifier: ^2.0.0-rc.1 version: 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.4) caip: specifier: ^1.1.1 version: 1.1.1 + cborg: + specifier: ^4.2.3 + version: 4.2.3 did-session: specifier: ^4.0.0 version: 4.0.0(typescript@5.5.4)(zod@3.23.8) @@ -534,6 +543,9 @@ importers: multiformats: specifier: ^13.1.1 version: 13.2.2 + uint8arrays: + specifier: ^5.1.0 + version: 5.1.0 tests/c1-integration: dependencies: @@ -824,6 +836,10 @@ packages: resolution: {integrity: sha512-Hsm00JaGfXXGob5YKn7GvvoRtQK/GhuPP+ddXbCpIkCfp9gqp8yJhI5uuQovFfnaP7bKA+PjqKygDLgy4JKBWQ==} engines: {node: '>=14.14'} + '@didtools/key-webauthn@2.0.2': + resolution: {integrity: sha512-MkOqAiRBcRO64PMVfSFAB0SUIJMk+L8QyymE9dknjmfSKgD/ZKz7cw4pFV6IUNin75/DLrlDSfmCIIjYokivvQ==} + engines: {node: '>=14.14'} + '@didtools/key-webcrypto@0.2.0': resolution: {integrity: sha512-5WK2Np0Tb6ApDoK71vYmEGiIdwLKzaEjr5KTK6RXFdl5xJnOYOHGkn4Ohco9D0UsoUGyDZE/ztlXmPQIbzHXQA==} engines: {node: '>=14.14'} @@ -1282,6 +1298,9 @@ packages: '@noble/curves@1.4.2': resolution: {integrity: sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==} + '@noble/curves@1.5.0': + resolution: {integrity: sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A==} + '@noble/hashes@1.3.2': resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} @@ -1600,13 +1619,13 @@ packages: resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} engines: {node: '>=10'} - '@tabler/icons-react@3.13.0': - resolution: {integrity: sha512-Px9NRe7+CVismWNah1QUXEz1879z2XVOBJWgmGzQzjwB5HD/SOUzR5HS6MlVUsFi2H8YTbf9iXAChQ/8gJndEw==} + '@tabler/icons-react@3.14.0': + resolution: {integrity: sha512-3XdbuyhBNq8aZW0qagR9YL8diACZYSAtaw6VuwcO2l6HzVFPN6N5TDex9WTz/3lf+uktAvOv1kNuuFBjSjN9yw==} peerDependencies: react: '>= 16' - '@tabler/icons@3.13.0': - resolution: {integrity: sha512-5STudfFoCeYZuDwH5k9A1j6YIRrkrwufMUWxf+wrwCkzWMN6PAyAWVJkx1RNW09szGZ4OKa2hEc2NRGPjh/MNQ==} + '@tabler/icons@3.14.0': + resolution: {integrity: sha512-OakKjK1kuDWKoNwdnHHVMt11kTZAC10iZpN/8o/CSYdeBH7S3v5n8IyqAYynFxLI8yBGTyBvljtvWdmWh57zSg==} '@tanstack/history@1.49.7': resolution: {integrity: sha512-9e9e+QFeWve6rB5BWK9MR8/1BmQYd1LFmM5BYh1Ht15yLcyU0FoiPG4Iun9Coc3Obo1mA+NbYCoOYoSZ+h+9yw==} @@ -1620,8 +1639,8 @@ packages: peerDependencies: react: ^18 || ^19 - '@tanstack/react-router@1.51.0': - resolution: {integrity: sha512-K2dwML0IushPSwBI/+DU8FOjcHAAKiYAMbWBoE4FH/XDDTqoGKJN2FL6uWe1tAlPxu5OwTMagNn6xIMcGwAbfA==} + '@tanstack/react-router@1.51.2': + resolution: {integrity: sha512-m4eIS4h8tGLtYJ6C75nKZe32yB8SjL23LUKlsJiEIMHkpkYMfsCI09qqEiPxL/5vEqVNNNS13LbAIzMiX8Yu3A==} engines: {node: '>=12'} peerDependencies: react: '>=18' @@ -1633,11 +1652,11 @@ packages: react: ^17.0.0 || ^18.0.0 react-dom: ^17.0.0 || ^18.0.0 - '@tanstack/router-devtools@1.51.0': - resolution: {integrity: sha512-/lnmm7WZ07vM18vvonv33LIk+0kjft+qySRJ0RS0xAuqi0JyvJ0Fmb+id4uNVL2zKyUbWZJKr08oQYi09vMEHg==} + '@tanstack/router-devtools@1.51.2': + resolution: {integrity: sha512-5ZE44al1dkluTdhL0YNh7aGpesM5Xc2XYKqOXMnyQ6qO+kMl/P/mgh/hRzycbKNC0zU5ywse3nt7QGEstNfTPw==} engines: {node: '>=12'} peerDependencies: - '@tanstack/react-router': ^1.51.0 + '@tanstack/react-router': ^1.51.2 react: '>=18' react-dom: '>=18' @@ -1720,8 +1739,8 @@ packages: '@types/node@20.14.14': resolution: {integrity: sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==} - '@types/node@22.5.0': - resolution: {integrity: sha512-DkFrJOe+rfdHTqqMg0bSNlGlQ85hSoh2TPzZyhHsXnMtligRWpxUySiyw8FY14ITt24HVCiQPWxS3KO/QlGmWg==} + '@types/node@22.5.1': + resolution: {integrity: sha512-KkHsxej0j9IW1KKOOAA/XBA0z08UFSrRQHErzEfA3Vgq57eXIMYboIlHJuYIfd+lwCQjtKqUu3UnmKbtUc9yRw==} '@types/normalize-package-data@2.4.4': resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} @@ -2010,8 +2029,8 @@ packages: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - codeco@1.4.1: - resolution: {integrity: sha512-wIu+qN1Gz8UqCZMwLMTp5Txd19kuRv3axg68oermsIBj/Xa4now0cLdE+yVHSgwJxi/V7Rog55VPha5An9/3iA==} + codeco@1.4.2: + resolution: {integrity: sha512-kMoa37m2g0JJT3VNiESLVZabq5zP/SwJ1Ds0eZIr48P+6J0mTtHdNSYlzA5MWFejeknhrCRJlRl5z+yc9Z1Y5g==} collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} @@ -3460,38 +3479,38 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - turbo-darwin-64@2.0.14: - resolution: {integrity: sha512-kwfDmjNwlNfvtrvT29+ZBg5n1Wvxl891bFHchMJyzMoR0HOE9N1NSNdSZb9wG3e7sYNIu4uDkNk+VBEqJW0HzQ==} + turbo-darwin-64@2.1.0: + resolution: {integrity: sha512-gHwpDk2gyB7qZ57gUUwDIS/IkglqEjjVtPZCTxmCRg28Tiwjui0azsLVKrnHP9UZHllozwbi28x8HXLXLEFF1w==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@2.0.14: - resolution: {integrity: sha512-m3LXYEshCx3wc4ZClM6gb01KYpFmtjQ9IBF3A7ofjb6ahux3xlYZJZ3uFCLAGHuvGLuJ3htfiPbwlDPTdknqqw==} + turbo-darwin-arm64@2.1.0: + resolution: {integrity: sha512-GLaqGetNC6eS4eqXgsheLOHic/OcnGCGDi5boVf+TFZTXYH6YE15L4ugZha4xHXCr1KouCLILHh+f8EHEmWylg==} cpu: [arm64] os: [darwin] - turbo-linux-64@2.0.14: - resolution: {integrity: sha512-7vBzCPdoTtR92SNn2JMgj1FlMmyonGmpMaQdgAB1OVYtuQ6NVGoh7/lODfaILqXjpvmFSVbpBIDrKOT6EvcprQ==} + turbo-linux-64@2.1.0: + resolution: {integrity: sha512-VzBOsj7JyGoZtiNZZ6brjnY7UehRnClluw7pwznuLPzClkqOOPMd2jOcgkWxnP/xW4NBmOoFANXXrtvKBD4f2w==} cpu: [x64] os: [linux] - turbo-linux-arm64@2.0.14: - resolution: {integrity: sha512-jwH+c0bfjpBf26K/tdEFatmnYyXwGROjbr6bZmNcL8R+IkGAc/cglL+OToqJnQZTgZvH7uDGbeSyUo7IsHyjuA==} + turbo-linux-arm64@2.1.0: + resolution: {integrity: sha512-St7svJnOO5g4F6R7Z32e10I/0M3e6qpNjEYybXwPNul9NSfnUXeky4WoKaALwqNhyJ7nYemoFpZ1d+i8hFQTHg==} cpu: [arm64] os: [linux] - turbo-windows-64@2.0.14: - resolution: {integrity: sha512-w9/XwkHSzvLjmioo6cl3S1yRfI6swxsV1j1eJwtl66JM4/pn0H2rBa855R0n7hZnmI6H5ywLt/nLt6Ae8RTDmw==} + turbo-windows-64@2.1.0: + resolution: {integrity: sha512-iSobNud2MrJ1SZ1upVPlErT8xexsr0MQtKapdfq6z0M0rBnrDGEq5bUCSScWyGu+O4+glB4br9xkTAkGFqaxqQ==} cpu: [x64] os: [win32] - turbo-windows-arm64@2.0.14: - resolution: {integrity: sha512-XaQlyYk+Rf4xS5XWCo8XCMIpssgGGy8blzLfolN6YBp4baElIWMlkLZHDbGyiFmCbNf9I9gJI64XGRG+LVyyjA==} + turbo-windows-arm64@2.1.0: + resolution: {integrity: sha512-d61jN4rjE5PnUfF66GKrKoj8S8Ql4FGXzFFzZz4kjsHpZZzCTtqlzPZBmd1byzGYhDPTorTqG3G1USohbdyohA==} cpu: [arm64] os: [win32] - turbo@2.0.14: - resolution: {integrity: sha512-00JjdCMD/cpsjP0Izkjcm8Oaor5yUCfDwODtaLb+WyblyadkaDEisGhy3Dbd5az9n+5iLSPiUgf+WjPbns6MRg==} + turbo@2.1.0: + resolution: {integrity: sha512-A969/LO/sPHKlapIarY2VVzqQ5JnnW2/1kksZlnMEpsRD6gwOELvVL+ozfMiO7av9RILt3UeN02L17efr6HUCA==} hasBin: true type-detect@4.0.8: @@ -3510,6 +3529,10 @@ packages: resolution: {integrity: sha512-bRkIGlXsnGBRBQRAY56UXBm//9qH4bmJfFvq83gSz41N282df+fjy8ofcEgc1sM8geNt5cl6mC2g9Fht1cs8Aw==} engines: {node: '>=16'} + type-fest@4.26.0: + resolution: {integrity: sha512-OduNjVJsFbifKb57UqZ2EMP1i4u64Xwow3NYXUtBbD4vIwJdQd4+xl8YDou1dlm4DVrtwT/7Ky8z8WyCULVfxw==} + engines: {node: '>=16'} + typescript@5.5.4: resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} engines: {node: '>=14.17'} @@ -4043,7 +4066,7 @@ snapshots: '@didtools/codecs@3.0.0': dependencies: - codeco: 1.4.1 + codeco: 1.4.2 multiformats: 13.2.2 uint8arrays: 5.1.0 @@ -4058,6 +4081,22 @@ snapshots: - utf-8-validate - zod + '@didtools/key-webauthn@2.0.2(typescript@5.5.4)(zod@3.23.8)': + dependencies: + '@didtools/cacao': 3.0.1(typescript@5.5.4)(zod@3.23.8) + '@ipld/dag-cbor': 9.2.1 + '@noble/curves': 1.5.0 + caip: 1.1.1 + cborg: 4.2.3 + multiformats: 13.2.2 + uint8arrays: 5.1.0 + varint: 6.0.0 + transitivePeerDependencies: + - bufferutil + - typescript + - utf-8-validate + - zod + '@didtools/key-webcrypto@0.2.0': dependencies: fast-json-stable-stringify: 2.1.0 @@ -4068,7 +4107,7 @@ snapshots: '@didtools/pkh-ethereum@0.5.0(typescript@5.5.4)(zod@3.23.8)': dependencies: '@didtools/cacao': 3.0.1(typescript@5.5.4)(zod@3.23.8) - '@noble/curves': 1.4.2 + '@noble/curves': 1.5.0 '@noble/hashes': 1.4.0 '@stablelib/random': 1.0.2 caip: 1.1.1 @@ -4081,7 +4120,7 @@ snapshots: '@didtools/pkh-ethereum@0.6.0(typescript@5.5.4)(zod@3.23.8)': dependencies: '@didtools/cacao': 3.0.1(typescript@5.5.4)(zod@3.23.8) - '@noble/curves': 1.4.2 + '@noble/curves': 1.5.0 '@noble/hashes': 1.4.0 '@stablelib/random': 1.0.2 caip: 1.1.1 @@ -4094,7 +4133,7 @@ snapshots: '@didtools/pkh-solana@0.2.0(typescript@5.5.4)(zod@3.23.8)': dependencies: '@didtools/cacao': 3.0.1(typescript@5.5.4)(zod@3.23.8) - '@noble/curves': 1.4.2 + '@noble/curves': 1.5.0 '@stablelib/random': 1.0.2 caip: 1.1.1 uint8arrays: 5.1.0 @@ -4106,7 +4145,7 @@ snapshots: '@didtools/siwx@2.0.0': dependencies: - codeco: 1.4.1 + codeco: 1.4.2 '@esbuild/aix-ppc64@0.21.5': optional: true @@ -4522,6 +4561,10 @@ snapshots: dependencies: '@noble/hashes': 1.4.0 + '@noble/curves@1.5.0': + dependencies: + '@noble/hashes': 1.4.0 + '@noble/hashes@1.3.2': {} '@noble/hashes@1.4.0': {} @@ -4622,7 +4665,7 @@ snapshots: '@scure/bip32@1.4.0': dependencies: - '@noble/curves': 1.4.0 + '@noble/curves': 1.4.2 '@noble/hashes': 1.4.0 '@scure/base': 1.1.7 @@ -4860,12 +4903,12 @@ snapshots: dependencies: defer-to-connect: 2.0.1 - '@tabler/icons-react@3.13.0(react@18.3.1)': + '@tabler/icons-react@3.14.0(react@18.3.1)': dependencies: - '@tabler/icons': 3.13.0 + '@tabler/icons': 3.14.0 react: 18.3.1 - '@tabler/icons@3.13.0': {} + '@tabler/icons@3.14.0': {} '@tanstack/history@1.49.7': {} @@ -4876,7 +4919,7 @@ snapshots: '@tanstack/query-core': 5.52.2 react: 18.3.1 - '@tanstack/react-router@1.51.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@tanstack/react-router@1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@tanstack/history': 1.49.7 '@tanstack/react-store': 0.5.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -4892,9 +4935,9 @@ snapshots: react-dom: 18.3.1(react@18.3.1) use-sync-external-store: 1.2.2(react@18.3.1) - '@tanstack/router-devtools@1.51.0(@tanstack/react-router@1.51.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@tanstack/router-devtools@1.51.2(@tanstack/react-router@1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@tanstack/react-router': 1.51.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@tanstack/react-router': 1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) clsx: 2.1.1 goober: 2.1.14(csstype@3.1.3) react: 18.3.1 @@ -4907,7 +4950,7 @@ snapshots: prettier: 3.3.3 zod: 3.23.8 - '@tanstack/router-plugin@1.51.0(vite@5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41)))': + '@tanstack/router-plugin@1.51.0(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)))': dependencies: '@babel/core': 7.25.2 '@babel/generator': 7.25.5 @@ -4927,7 +4970,7 @@ snapshots: unplugin: 1.12.2 zod: 3.23.8 optionalDependencies: - vite: 5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41)) + vite: 5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)) transitivePeerDependencies: - supports-color @@ -5006,7 +5049,7 @@ snapshots: dependencies: undici-types: 5.26.5 - '@types/node@22.5.0': + '@types/node@22.5.1': dependencies: undici-types: 6.19.8 optional: true @@ -5040,10 +5083,10 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@vitejs/plugin-react-swc@3.7.0(vite@5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41)))': + '@vitejs/plugin-react-swc@3.7.0(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)))': dependencies: '@swc/core': 1.7.18 - vite: 5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41)) + vite: 5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)) transitivePeerDependencies: - '@swc/helpers' @@ -5321,7 +5364,7 @@ snapshots: co@4.6.0: {} - codeco@1.4.1: {} + codeco@1.4.2: {} collect-v8-coverage@1.0.2: {} @@ -5455,7 +5498,7 @@ snapshots: did-jwt@7.4.7: dependencies: '@noble/ciphers': 0.4.1 - '@noble/curves': 1.4.2 + '@noble/curves': 1.5.0 '@noble/hashes': 1.4.0 '@scure/base': 1.1.7 canonicalize: 2.0.0 @@ -5487,7 +5530,7 @@ snapshots: '@didtools/codecs': 3.0.0 '@didtools/pkh-ethereum': 0.5.0(typescript@5.5.4)(zod@3.23.8) '@stablelib/random': 1.0.2 - codeco: 1.4.1 + codeco: 1.4.2 dag-jose-utils: 4.0.0 did-jwt: 7.4.7 did-resolver: 4.1.0 @@ -6241,7 +6284,7 @@ snapshots: key-did-provider-ed25519@4.0.2(typescript@5.5.4)(zod@3.23.8): dependencies: - '@noble/curves': 1.4.2 + '@noble/curves': 1.5.0 did-jwt: 7.4.7 dids: 5.0.2(typescript@5.5.4)(zod@3.23.8) fast-json-stable-stringify: 2.1.0 @@ -6255,7 +6298,7 @@ snapshots: key-did-resolver@4.0.0: dependencies: - '@noble/curves': 1.4.2 + '@noble/curves': 1.5.0 multiformats: 13.2.2 uint8arrays: 5.1.0 varint: 6.0.0 @@ -6505,7 +6548,7 @@ snapshots: dependencies: '@babel/code-frame': 7.24.7 index-to-position: 0.1.2 - type-fest: 4.25.0 + type-fest: 4.26.0 path-exists@4.0.0: {} @@ -6937,32 +6980,32 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - turbo-darwin-64@2.0.14: + turbo-darwin-64@2.1.0: optional: true - turbo-darwin-arm64@2.0.14: + turbo-darwin-arm64@2.1.0: optional: true - turbo-linux-64@2.0.14: + turbo-linux-64@2.1.0: optional: true - turbo-linux-arm64@2.0.14: + turbo-linux-arm64@2.1.0: optional: true - turbo-windows-64@2.0.14: + turbo-windows-64@2.1.0: optional: true - turbo-windows-arm64@2.0.14: + turbo-windows-arm64@2.1.0: optional: true - turbo@2.0.14: + turbo@2.1.0: optionalDependencies: - turbo-darwin-64: 2.0.14 - turbo-darwin-arm64: 2.0.14 - turbo-linux-64: 2.0.14 - turbo-linux-arm64: 2.0.14 - turbo-windows-64: 2.0.14 - turbo-windows-arm64: 2.0.14 + turbo-darwin-64: 2.1.0 + turbo-darwin-arm64: 2.1.0 + turbo-linux-64: 2.1.0 + turbo-linux-arm64: 2.1.0 + turbo-windows-64: 2.1.0 + turbo-windows-arm64: 2.1.0 type-detect@4.0.8: {} @@ -6972,6 +7015,8 @@ snapshots: type-fest@4.25.0: {} + type-fest@4.26.0: {} + typescript@5.5.4: {} uint8arrays@3.1.1: @@ -7092,13 +7137,13 @@ snapshots: - utf-8-validate - zod - vite@5.4.2(@types/node@22.5.0)(sugarss@4.0.1(postcss@8.4.41)): + vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)): dependencies: esbuild: 0.21.5 postcss: 8.4.41 rollup: 4.21.1 optionalDependencies: - '@types/node': 22.5.0 + '@types/node': 22.5.1 fsevents: 2.3.3 sugarss: 4.0.1(postcss@8.4.41) @@ -7108,7 +7153,7 @@ snapshots: webauthn-p256@0.0.5: dependencies: - '@noble/curves': 1.4.0 + '@noble/curves': 1.4.2 '@noble/hashes': 1.4.0 webidl-conversions@3.0.1: {} From 97ba08162510b1baac4ad56d22b0af2bdfc9de3f Mon Sep 17 00:00:00 2001 From: Paul Le Cam Date: Fri, 30 Aug 2024 14:56:59 +0100 Subject: [PATCH 2/2] Move test vector utils to test-utils package --- apps/explorer/package.json | 12 +- package.json | 2 +- packages/events/package.json | 2 +- packages/http-client/package.json | 6 +- packages/identifiers/package.json | 2 +- packages/model-client/test/lib.test.ts | 19 +- packages/model-handler/test/handler.test.ts | 23 +- packages/model-instance-handler/package.json | 2 +- packages/model-instance-protocol/package.json | 2 +- packages/model-protocol/package.json | 2 +- packages/test-utils/package.json | 11 +- .../scripts/utils => test-utils/src}/did.ts | 23 +- packages/test-utils/src/ethereum.ts | 39 ++ .../test-utils/src/{ => ethereum}/provider.ts | 0 .../test-utils/src/{ => ethereum}/siwe.ts | 30 +- packages/test-utils/src/index.ts | 80 +--- packages/test-utils/src/session.ts | 16 + .../utils => test-utils/src}/solana.ts | 2 +- packages/test-utils/src/types.ts | 4 +- .../utils => test-utils/src}/webauthn.ts | 28 +- .../utils => test-utils/src}/webcrypto.ts | 9 +- packages/test-utils/test/lib.test.ts | 88 +--- .../test-vectors/assets/key-ecdsa-p256.car | Bin 2467 -> 2467 bytes packages/test-vectors/assets/pkh-ethereum.car | Bin 10772 -> 10772 bytes packages/test-vectors/assets/pkh-solana.car | Bin 10694 -> 10693 bytes packages/test-vectors/assets/pkh-webauthn.car | Bin 11655 -> 11612 bytes packages/test-vectors/package.json | 9 +- .../scripts/create-test-vectors.ts | 126 +---- .../test-vectors/scripts/utils/controllers.ts | 92 ++++ .../test-vectors/scripts/utils/ethereum.ts | 16 - .../test-vectors/scripts/utils/signatures.ts | 25 + .../test-vectors/scripts/utils/streams.ts | 6 + packages/test-vectors/test/vectors.test.ts | 3 +- pnpm-lock.yaml | 440 +++++++++--------- 34 files changed, 562 insertions(+), 557 deletions(-) rename packages/{test-vectors/scripts/utils => test-utils/src}/did.ts (86%) create mode 100644 packages/test-utils/src/ethereum.ts rename packages/test-utils/src/{ => ethereum}/provider.ts (100%) rename packages/test-utils/src/{ => ethereum}/siwe.ts (70%) create mode 100644 packages/test-utils/src/session.ts rename packages/{test-vectors/scripts/utils => test-utils/src}/solana.ts (96%) rename packages/{test-vectors/scripts/utils => test-utils/src}/webauthn.ts (90%) rename packages/{test-vectors/scripts/utils => test-utils/src}/webcrypto.ts (92%) create mode 100644 packages/test-vectors/scripts/utils/controllers.ts delete mode 100644 packages/test-vectors/scripts/utils/ethereum.ts create mode 100644 packages/test-vectors/scripts/utils/signatures.ts create mode 100644 packages/test-vectors/scripts/utils/streams.ts diff --git a/apps/explorer/package.json b/apps/explorer/package.json index 933450e..c6f6905 100644 --- a/apps/explorer/package.json +++ b/apps/explorer/package.json @@ -21,9 +21,9 @@ "@mantine/core": "^7.11.2", "@mantine/hooks": "^7.11.2", "@tabler/icons-react": "^3.14.0", - "@tanstack/react-query": "^5.52.2", - "@tanstack/react-router": "^1.51.2", - "codeco": "^1.4.2", + "@tanstack/react-query": "^5.52.3", + "@tanstack/react-router": "^1.51.6", + "codeco": "^1.4.3", "jotai": "^2.9.2", "multiformats": "^13.2.2", "react": "^18.3.1", @@ -32,9 +32,9 @@ "devDependencies": { "@ceramic-sdk/model-client": "workspace:^", "@ceramic-sdk/model-instance-client": "workspace:^", - "@tanstack/router-devtools": "^1.51.2", - "@tanstack/router-plugin": "^1.51.0", - "@types/react": "^18.3.3", + "@tanstack/router-devtools": "^1.51.6", + "@tanstack/router-plugin": "^1.51.6", + "@types/react": "^18.3.5", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react-swc": "^3.5.0", "postcss": "^8.4.40", diff --git a/package.json b/package.json index 49a1e6c..0ac23b3 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "@biomejs/biome": "1.8.3", "@jest/globals": "^29.7.0", "@swc/cli": "^0.4.0", - "@swc/core": "^1.7.11", + "@swc/core": "^1.7.22", "@swc/jest": "^0.2.36", "@types/jest": "^29.5.12", "@types/node": "^20.14.12", diff --git a/packages/events/package.json b/packages/events/package.json index 2234e01..11c1f9f 100644 --- a/packages/events/package.json +++ b/packages/events/package.json @@ -37,7 +37,7 @@ "@ipld/dag-cbor": "^9.2.1", "@ipld/dag-json": "^10.2.2", "cartonne": "^3.0.1", - "codeco": "^1.4.2", + "codeco": "^1.4.3", "dag-jose": "^5.1.1", "multiformats": "^13.2.2", "multihashes-sync": "^2.0.0", diff --git a/packages/http-client/package.json b/packages/http-client/package.json index e377703..42f6c4b 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -34,13 +34,13 @@ }, "dependencies": { "@ceramic-sdk/events": "workspace:^", - "openapi-fetch": "^0.11.1" + "openapi-fetch": "^0.11.2" }, "devDependencies": { "cartonne": "^3.0.1", - "codeco": "^1.4.2", + "codeco": "^1.4.3", "multiformats": "^13.2.2", - "openapi-typescript": "^7.3.0", + "openapi-typescript": "^7.3.2", "type-fest": "^4.26.0" }, "jest": { diff --git a/packages/identifiers/package.json b/packages/identifiers/package.json index 3f06823..2a4f3b2 100644 --- a/packages/identifiers/package.json +++ b/packages/identifiers/package.json @@ -33,7 +33,7 @@ }, "dependencies": { "@ipld/dag-cbor": "^9.2.1", - "codeco": "^1.4.2", + "codeco": "^1.4.3", "mapmoize": "^1.2.1", "multiformats": "^13.2.2", "uint8arrays": "^5.1.0", diff --git a/packages/model-client/test/lib.test.ts b/packages/model-client/test/lib.test.ts index 606befa..75a790a 100644 --- a/packages/model-client/test/lib.test.ts +++ b/packages/model-client/test/lib.test.ts @@ -3,7 +3,7 @@ import { MODEL_RESOURCE_URI, type ModelDefinition, } from '@ceramic-sdk/model-protocol' -import { EthereumDID } from '@ceramic-sdk/test-utils' +import { createSession, ethereum } from '@ceramic-sdk/test-utils' import { getAuthenticatedDID } from '@didtools/key-did' import { createInitEvent } from '../src/index.js' @@ -42,14 +42,19 @@ describe('createInitEvent()', () => { }) test('supports did:pkh', async () => { - const did = await EthereumDID.random({ - domain: 'test', - resources: [MODEL_RESOURCE_URI], - }) + const authMethod = await ethereum.authMethodFromRandomKey() const [validSession, invalidSession] = await Promise.all([ - did.createSession({ expirationTime: null }), - did.createSession({ expiresInSecs: 60 }), + createSession(authMethod, { + domain: 'test', + resources: [MODEL_RESOURCE_URI], + expirationTime: null, + }), + createSession(authMethod, { + domain: 'test', + resources: [MODEL_RESOURCE_URI], + expiresInSecs: 60, + }), ]) await expect(async () => { diff --git a/packages/model-handler/test/handler.test.ts b/packages/model-handler/test/handler.test.ts index 971cc11..3eafcfb 100644 --- a/packages/model-handler/test/handler.test.ts +++ b/packages/model-handler/test/handler.test.ts @@ -14,7 +14,7 @@ import { type ModelEvent, ModelInitEventPayload, } from '@ceramic-sdk/model-protocol' -import { EthereumDID } from '@ceramic-sdk/test-utils' +import { createSession, ethereum } from '@ceramic-sdk/test-utils' import { asDIDString } from '@didtools/codecs' import { createDID, getAuthenticatedDID } from '@didtools/key-did' import { jest } from '@jest/globals' @@ -105,18 +105,19 @@ describe('handleInitEvent()', () => { }) test('supports did:pkh', async () => { - const did = await EthereumDID.random({ - domain: 'test', - resources: [MODEL_RESOURCE_URI], - }) + const authMethod = await ethereum.authMethodFromRandomKey() const [validEvent, invalidEvent] = await Promise.all([ - did - .createSession({ expirationTime: null }) - .then((session) => createModelEvent(session.did)), - did - .createSession({ expiresInSecs: 60 }) - .then((session) => createModelEvent(session.did)), + createSession(authMethod, { + domain: 'test', + resources: [MODEL_RESOURCE_URI], + expirationTime: null, + }).then((session) => createModelEvent(session.did)), + createSession(authMethod, { + domain: 'test', + resources: [MODEL_RESOURCE_URI], + expiresInSecs: 60, + }).then((session) => createModelEvent(session.did)), ]) await expect(async () => { diff --git a/packages/model-instance-handler/package.json b/packages/model-instance-handler/package.json index d77b20e..6fe1d12 100644 --- a/packages/model-instance-handler/package.json +++ b/packages/model-instance-handler/package.json @@ -37,7 +37,7 @@ "@ceramic-sdk/model-instance-protocol": "workspace:^", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", - "codeco": "^1.4.2", + "codeco": "^1.4.3", "fast-json-patch": "^3.1.1", "uint8arrays": "^5.1.0" }, diff --git a/packages/model-instance-protocol/package.json b/packages/model-instance-protocol/package.json index d3e6dae..505753f 100644 --- a/packages/model-instance-protocol/package.json +++ b/packages/model-instance-protocol/package.json @@ -35,7 +35,7 @@ "@ceramic-sdk/events": "workspace:^", "@ceramic-sdk/identifiers": "workspace:^", "@didtools/codecs": "^3.0.0", - "codeco": "^1.4.2", + "codeco": "^1.4.3", "object-sizeof": "^2.6.4" }, "devDependencies": { diff --git a/packages/model-protocol/package.json b/packages/model-protocol/package.json index 06d84d1..11ee94e 100644 --- a/packages/model-protocol/package.json +++ b/packages/model-protocol/package.json @@ -38,7 +38,7 @@ "@didtools/codecs": "^3.0.0", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", - "codeco": "^1.4.2", + "codeco": "^1.4.3", "json-ptr": "^3.1.1" }, "devDependencies": { diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index f9d99bc..717eca0 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -34,11 +34,20 @@ }, "dependencies": { "@didtools/cacao": "^3.0.1", + "@didtools/key-webauthn": "^2.0.2", + "@didtools/key-webcrypto": "^0.2.0", + "@didtools/pkh-solana": "^0.2.0", + "@noble/curves": "^1.5.0", "@noble/hashes": "^1.4.0", + "@solana/signers": "^2.0.0-rc.1", "caip": "^1.1.1", + "cborg": "^4.2.3", "did-session": "^4.0.0", "dids": "^5.0.2", - "viem": "^2.20.1" + "key-did-resolver": "^4.0.0", + "multiformats": "^13.2.2", + "uint8arrays": "^5.1.0", + "viem": "^2.21.0" }, "devDependencies": { "@didtools/pkh-ethereum": "^0.6.0" diff --git a/packages/test-vectors/scripts/utils/did.ts b/packages/test-utils/src/did.ts similarity index 86% rename from packages/test-vectors/scripts/utils/did.ts rename to packages/test-utils/src/did.ts index f334a5a..cbc1c26 100644 --- a/packages/test-vectors/scripts/utils/did.ts +++ b/packages/test-utils/src/did.ts @@ -4,7 +4,6 @@ import { type Cacao, CacaoBlock, } from '@didtools/cacao' -import { getAuthenticatedDID } from '@didtools/key-did' import { type CreateJWSOptions, DID, @@ -16,14 +15,13 @@ import { CID } from 'multiformats/cid' const VALID_EXPIRATION_TIME = new Date(9999, 0).toISOString() const INVALID_EXPIRATION_TIME = new Date(2000, 0).toISOString() -export const keyDID = await getAuthenticatedDID(new Uint8Array(32)) - export type CustomCreateJWSOptions = CreateJWSOptions & { capability?: Cacao } export class CustomCapabilityDID extends DID { get capability(): Cacao { + // @ts-ignore private field return this._capability } @@ -32,9 +30,12 @@ export class CustomCapabilityDID extends DID { payload: T, options: CustomCreateJWSOptions = {}, ): Promise { + // @ts-ignore private field if (this._client == null) throw new Error('No provider available') + // @ts-ignore private field if (this._id == null) throw new Error('DID is not authenticated') // Use capability from options when provided + // @ts-ignore private field const capability = options.capability ?? this._capability if (capability) { const cacaoBlock = await CacaoBlock.fromCacao(capability) @@ -47,7 +48,9 @@ export class CustomCapabilityDID extends DID { options.protected = options.protected || {} options.protected.cap = `ipfs://${capCID?.toString()}` } + // @ts-ignore private field const { jws } = await this._client.request('did_createJWS', { + // @ts-ignore private field did: this._id, ...options, payload, @@ -70,6 +73,7 @@ export class CustomCapabilityDID extends DID { } export async function createCapabilityDID( + keyDID: DID, authMethod: AuthMethod, authParams: AuthMethodOpts = {}, ): Promise { @@ -80,9 +84,12 @@ export async function createCapabilityDID( ...authParams, }) const did = new CustomCapabilityDID({ + // @ts-ignore private field provider: keyDID._client?.connection, + // @ts-ignore private field resolver: keyDID._resolver, capability, + // @ts-ignore private field parent: keyDID._parentId, }) await did.authenticate() @@ -95,9 +102,13 @@ export class ExpiredCapabilityDID extends DID { payload: T, options: CreateJWSOptions = {}, ): Promise { + // @ts-ignore private field if (this._client == null) throw new Error('No provider available') + // @ts-ignore private field if (this._id == null) throw new Error('DID is not authenticated') + // @ts-ignore private field if (this._capability) { + // @ts-ignore private field const cacaoBlock = await CacaoBlock.fromCacao(this._capability) const capCID = CID.asCID(cacaoBlock.cid) if (!capCID) { @@ -108,7 +119,9 @@ export class ExpiredCapabilityDID extends DID { options.protected = options.protected || {} options.protected.cap = `ipfs://${capCID?.toString()}` } + // @ts-ignore private field const { jws } = await this._client.request('did_createJWS', { + // @ts-ignore private field did: this._id, ...options, payload, @@ -118,6 +131,7 @@ export class ExpiredCapabilityDID extends DID { } export async function createExpiredCapabilityDID( + keyDID: DID, authMethod: AuthMethod, authParams: AuthMethodOpts = {}, ): Promise { @@ -128,9 +142,12 @@ export async function createExpiredCapabilityDID( ...authParams, }) const did = new ExpiredCapabilityDID({ + // @ts-ignore private field provider: keyDID._client?.connection, + // @ts-ignore private field resolver: keyDID._resolver, capability, + // @ts-ignore private field parent: keyDID._parentId, }) await did.authenticate() diff --git a/packages/test-utils/src/ethereum.ts b/packages/test-utils/src/ethereum.ts new file mode 100644 index 0000000..31da3ee --- /dev/null +++ b/packages/test-utils/src/ethereum.ts @@ -0,0 +1,39 @@ +import type { AuthMethod } from '@didtools/cacao' +import type { EIP1193Provider, Hex } from 'viem' +import { generatePrivateKey } from 'viem/accounts' + +import { createProvider, getAccount } from './ethereum/provider.js' +import { createAuthMethod } from './ethereum/siwe.js' + +// Default private key used for tests +const PRIVATE_KEY = + '0xe50df915de22bad5bf1abf43f78b55d64640afdcdfa6b1699a514d97662b23f7' as Hex + +// Re-exports from viem +export { generatePrivateKey } +export type { EIP1193Provider, Hex } + +// Re-exports useful internals +export { createAuthMethod, createProvider, getAccount } + +export async function authMethodFromProvider( + provider: EIP1193Provider, +): Promise { + const accountId = await getAccount(provider) + return createAuthMethod(provider, accountId) as AuthMethod +} + +export async function authMethodFromPrivateKey( + privateKey: Hex, +): Promise { + const provider = createProvider(privateKey) + return await authMethodFromProvider(provider) +} + +export async function authMethodFromRandomKey(): Promise { + return await authMethodFromPrivateKey(generatePrivateKey()) +} + +export async function getAuthMethod(): Promise { + return await authMethodFromPrivateKey(PRIVATE_KEY) +} diff --git a/packages/test-utils/src/provider.ts b/packages/test-utils/src/ethereum/provider.ts similarity index 100% rename from packages/test-utils/src/provider.ts rename to packages/test-utils/src/ethereum/provider.ts diff --git a/packages/test-utils/src/siwe.ts b/packages/test-utils/src/ethereum/siwe.ts similarity index 70% rename from packages/test-utils/src/siwe.ts rename to packages/test-utils/src/ethereum/siwe.ts index d387a35..6aede01 100644 --- a/packages/test-utils/src/siwe.ts +++ b/packages/test-utils/src/ethereum/siwe.ts @@ -1,10 +1,14 @@ -import { Cacao, SiweMessage, type SiwxMessage } from '@didtools/cacao' +import { + type AuthMethod, + type AuthMethodOpts, + Cacao, + SiweMessage, + type SiwxMessage, +} from '@didtools/cacao' import { bytesToHex } from '@noble/hashes/utils' import type { AccountId } from 'caip' import type { Address, EIP1193Provider, Hex } from 'viem' -import type { AuthMethod, AuthParams } from './types.js' - /** * SIWX Version */ @@ -19,27 +23,27 @@ function randomNonce(): string { export async function createCACAO( provider: EIP1193Provider, account: AccountId, - params: AuthParams, + options: AuthMethodOpts, ): Promise { const now = new Date() const message: Partial = { - domain: params.domain, + domain: options.domain, address: account.address, statement: - params.statement ?? + options.statement ?? 'Give this application access to some of your data on Ceramic', - uri: params.uri, + uri: options.uri, version: VERSION, - nonce: params.nonce ?? randomNonce(), + nonce: options.nonce ?? randomNonce(), issuedAt: now.toISOString(), chainId: account.chainId.reference, - resources: params.resources, + resources: options.resources, } // Only add expirationTime if not explicitly set to null - if (params.expirationTime !== null) { + if (options.expirationTime !== null) { message.expirationTime = - params.expirationTime ?? new Date(now.getTime() + ONE_WEEK).toISOString() + options.expirationTime ?? new Date(now.getTime() + ONE_WEEK).toISOString() } const siweMessage = new SiweMessage(message) @@ -59,7 +63,7 @@ export function createAuthMethod( provider: EIP1193Provider, account: AccountId, ): AuthMethod { - return (params) => { - return createCACAO(provider, account, params as unknown as AuthParams) + return (options: AuthMethodOpts) => { + return createCACAO(provider, account, options) } } diff --git a/packages/test-utils/src/index.ts b/packages/test-utils/src/index.ts index 4460bf8..dfebad9 100644 --- a/packages/test-utils/src/index.ts +++ b/packages/test-utils/src/index.ts @@ -1,73 +1,7 @@ -import type { AccountId } from 'caip' -import { DIDSession } from 'did-session' -import type { EIP1193Provider, Hex } from 'viem' -import { generatePrivateKey } from 'viem/accounts' - -import { createProvider, getAccount } from './provider.js' -import { createAuthMethod } from './siwe.js' -import type { AuthMethod, AuthOptions } from './types.js' - -// Re-exports from viem -export { generatePrivateKey } -export type { EIP1193Provider, Hex } - -// Re-exports useful internals -export { createAuthMethod, createProvider, getAccount } - -export type EthereumDIDParams = { - accountId: AccountId - authMethod: AuthMethod - authOptions: AuthOptions -} - -export class EthereumDID { - static async fromProvider( - provider: EIP1193Provider, - authOptions: AuthOptions, - ): Promise { - const accountId = await getAccount(provider) - const authMethod = createAuthMethod(provider, accountId) - return new EthereumDID({ accountId, authMethod, authOptions }) - } - - static async fromPrivateKey( - privateKey: Hex, - authOptions: AuthOptions, - ): Promise { - return await EthereumDID.fromProvider( - createProvider(privateKey), - authOptions, - ) - } - - static async random(authOptions: AuthOptions): Promise { - return await EthereumDID.fromPrivateKey(generatePrivateKey(), authOptions) - } - - #authMethod: AuthMethod - #authOptions: AuthOptions - #id: string - - constructor(params: EthereumDIDParams) { - if (params.authOptions.resources.length === 0) { - throw new Error( - `The "resources" array of the authorization options must contain at least one item`, - ) - } - this.#authMethod = params.authMethod - this.#authOptions = params.authOptions - this.#id = `did:pkh:${params.accountId.toString()}` - } - - get id(): string { - return this.#id - } - - async createSession(options: Partial = {}): Promise { - return await DIDSession.authorize(this.#authMethod, { - ...this.#authOptions, - ...options, - // biome-ignore lint/suspicious/noExplicitAny: AuthOpts handling - } as any) - } -} +export * from './did.js' +export * as ethereum from './ethereum.js' +export * from './session.js' +export * as solana from './solana.js' +export type * from './types.js' +export * as webauthn from './webauthn.js' +export * as webcrypto from './webcrypto.js' diff --git a/packages/test-utils/src/session.ts b/packages/test-utils/src/session.ts new file mode 100644 index 0000000..832430c --- /dev/null +++ b/packages/test-utils/src/session.ts @@ -0,0 +1,16 @@ +import type { AuthMethod } from '@didtools/cacao' +import { DIDSession } from 'did-session' + +import type { AuthOptions } from './types.js' + +export type { DIDSession } + +export async function createSession( + authMethod: AuthMethod, + options: AuthOptions, +): Promise { + return await DIDSession.authorize( + authMethod, + options as Omit, + ) +} diff --git a/packages/test-vectors/scripts/utils/solana.ts b/packages/test-utils/src/solana.ts similarity index 96% rename from packages/test-vectors/scripts/utils/solana.ts rename to packages/test-utils/src/solana.ts index e1d120b..5b687bf 100644 --- a/packages/test-vectors/scripts/utils/solana.ts +++ b/packages/test-utils/src/solana.ts @@ -7,7 +7,7 @@ import { } from '@solana/signers' import { AccountId } from 'caip' -import { getEd25519KeyPair } from './webcrypto.ts' +import { getEd25519KeyPair } from './webcrypto.js' // Value from RPC call - https://solana.com/docs/rpc/http/getgenesishash#code-sample // Sliced to only keep the first 32 characters diff --git a/packages/test-utils/src/types.ts b/packages/test-utils/src/types.ts index 4d142de..b130945 100644 --- a/packages/test-utils/src/types.ts +++ b/packages/test-utils/src/types.ts @@ -1,5 +1,6 @@ import type { Cacao } from '@didtools/cacao' +// DIDSession creation options export type AuthOptions = { domain: string expirationTime?: string | null @@ -10,6 +11,7 @@ export type AuthOptions = { statement?: string } +// AuthMethod parameters export type AuthParams = { domain: string expirationTime?: string | null @@ -20,4 +22,4 @@ export type AuthParams = { uri: string } -export type AuthMethod = (options: Partial) => Promise +export type AuthMethod = (params: AuthParams) => Promise diff --git a/packages/test-vectors/scripts/utils/webauthn.ts b/packages/test-utils/src/webauthn.ts similarity index 90% rename from packages/test-vectors/scripts/utils/webauthn.ts rename to packages/test-utils/src/webauthn.ts index 0c74404..cf2f28d 100644 --- a/packages/test-vectors/scripts/utils/webauthn.ts +++ b/packages/test-utils/src/webauthn.ts @@ -32,6 +32,7 @@ export class MockAuthenticator { const rawId = u8a.concat([pk.slice(1, 14), u8a.fromString('STUB', 'utf8')]) const id = u8a.toString(rawId, 'base64url') const userHandle = hash( + // @ts-ignore opts.publicKey?.user?.id || p256.CURVE.randomBytes(32), ) const authData = mkAuthData(pk) @@ -76,6 +77,7 @@ export class MockAuthenticator { return out } + // @ts-ignore unknow opts type async get(opts) { const { secret, id, rawId, userHandle } = this.credentials[0] // pick first const challenge = u8a.toString( @@ -116,7 +118,7 @@ export class MockAuthenticator { // assuming that the encode does not either. // The offset in authenticator data is static, // so we use a live sample and inject the test-key to satisfy utils.js#decodeAuthenticatorData(). -function mkAuthData(pk) { +function mkAuthData(pk: Uint8Array) { const authDataCreate = 'f689f6b7489197aacf01172f02a82e0715f72aff70d5f758b9b0f7d3999978d2c5000000020000000000000000000000000000000000309face7743395482aefb4e1a67134641cdea3529c5752594090f26252e2198e4a0c547a4b0bd2fa346500e47cdf9c58f6a50102032620012158209face7743395482aefb4e1a671aafbf1566cc099f7647db230952bc169f43f9c2258203462f7968f7824f955570f3453280452948cccf132f03f369a2e834546649a78a16b6372656450726f7465637402' const buffer = u8a.fromString(authDataCreate, 'hex') @@ -132,23 +134,25 @@ function mkAuthData(pk) { } // node:Buffer to Uint8Array -function bufToU8(b) { +function bufToU8(b: Buffer | Uint8Array | ArrayBuffer) { if (b instanceof Uint8Array || b instanceof ArrayBuffer) return b // no conversion needed + // @ts-ignore Buffer check return new Uint8Array(b.buffer.slice(b.offset, b.offset + b.length)) } -function hash(m) { +function hash(m: Uint8Array | string) { return p256.CURVE.hash(m) } -// Stub navigator.credentials for nodeJS -// @ts-ignore -globalThis.location ??= {} -// @ts-ignore -globalThis.location.hostname = 'http://localhost' -// @ts-ignore -globalThis.navigator ??= {} -// @ts-ignore -globalThis.navigator.credentials = new MockAuthenticator() +export function injectMockBrowserGlobals(hostname = 'localhost') { + // @ts-ignore + globalThis.location ??= {} + // @ts-ignore + globalThis.location.hostname = hostname + // @ts-ignore + globalThis.navigator ??= {} + // @ts-ignore + globalThis.navigator.credentials = new MockAuthenticator() +} export async function getAuthMethod(): Promise { const did = await WebauthnAuth.createDID('test') diff --git a/packages/test-vectors/scripts/utils/webcrypto.ts b/packages/test-utils/src/webcrypto.ts similarity index 92% rename from packages/test-vectors/scripts/utils/webcrypto.ts rename to packages/test-utils/src/webcrypto.ts index 54252d6..43c05be 100644 --- a/packages/test-vectors/scripts/utils/webcrypto.ts +++ b/packages/test-utils/src/webcrypto.ts @@ -2,6 +2,8 @@ import { WebcryptoProvider } from '@didtools/key-webcrypto' import { DID } from 'dids' import { getResolver } from 'key-did-resolver' +// Key pairs used for tests + const PUBLIC_ED25519_JWK = { key_ops: ['verify'], ext: true, @@ -34,7 +36,7 @@ const P256_IMPORT_PARAMS: EcKeyImportParams = { namedCurve: 'P-256', } -async function importKey( +export async function importKey( jwk: JsonWebKey, algorithm: AlgorithmIdentifier | EcKeyImportParams, usage: KeyUsage, @@ -58,8 +60,9 @@ export async function getP256KeyPair(): Promise { return { privateKey, publicKey } } -export async function getP256KeyDID(): Promise { - const keyPair = await getP256KeyPair() +export async function getAuthenticatedDID( + keyPair: CryptoKeyPair, +): Promise { const did = new DID({ provider: new WebcryptoProvider(keyPair), resolver: getResolver(), diff --git a/packages/test-utils/test/lib.test.ts b/packages/test-utils/test/lib.test.ts index 72eadca..af78948 100644 --- a/packages/test-utils/test/lib.test.ts +++ b/packages/test-utils/test/lib.test.ts @@ -1,11 +1,8 @@ import { Cacao } from '@didtools/cacao' import { getEIP191Verifier } from '@didtools/pkh-ethereum' import { DIDSession } from 'did-session' -import { privateKeyToAccount } from 'viem/accounts' -import { EthereumDID, generatePrivateKey } from '../src/index.js' -import { createProvider, getAccount } from '../src/provider.js' -import { createAuthMethod } from '../src/siwe.js' +import { createSession, ethereum } from '../src/index.js' import type { AuthOptions } from '../src/types.js' const defaultOptions: AuthOptions = { @@ -13,74 +10,29 @@ const defaultOptions: AuthOptions = { resources: ['test'], } -test('EthereumDID.fromProvider() creates the EthereumDID instance using the provider', async () => { - const privateKey = generatePrivateKey() - const did = await EthereumDID.fromProvider( - createProvider(privateKey), - defaultOptions, - ) - expect(did).toBeInstanceOf(EthereumDID) - const address = privateKeyToAccount(privateKey).address.toLowerCase() - expect(did.id).toBe(`did:pkh:eip155:1:${address}`) -}) - -test('EthereumDID.fromPrivateKey() creates the EthereumDID instance using the private key', async () => { - const privateKey = generatePrivateKey() - const did = await EthereumDID.fromPrivateKey(privateKey, defaultOptions) - expect(did).toBeInstanceOf(EthereumDID) - const address = privateKeyToAccount(privateKey).address.toLowerCase() - expect(did.id).toBe(`did:pkh:eip155:1:${address}`) -}) - -describe('EthereumDID', () => { - test('constructor throws if no resource is provided', async () => { - const provider = createProvider(generatePrivateKey()) - const accountId = await getAccount(provider) - const authMethod = await createAuthMethod(provider, accountId) - expect(() => { - new EthereumDID({ - accountId, - authMethod, - authOptions: { domain: 'test', resources: [] }, - }) - }).toThrow( - 'The "resources" array of the authorization options must contain at least one item', - ) - }) - +describe('Sessions', () => { test('createSession() method creates a DIDSession', async () => { - const factory = await EthereumDID.random(defaultOptions) - const session1 = await factory.createSession() + const authMethod = await ethereum.authMethodFromRandomKey() + const session1 = await createSession(authMethod, defaultOptions) expect(session1).toBeInstanceOf(DIDSession) - expect(session1.id).toBe(factory.id) - const session2 = await factory.createSession() - expect(session2.id).toBe(factory.id) + const session2 = await createSession(authMethod, defaultOptions) + expect(session2.id).toBe(session1.id) expect(session2.did.id).not.toBe(session1.did.id) }) -}) - -test('Session signing can be verified', async () => { - const verifiers = getEIP191Verifier() - const provider = createProvider(generatePrivateKey()) - const accountId = await getAccount(provider) - const authMethod = await createAuthMethod(provider, accountId) - - const eth = new EthereumDID({ - accountId, - authMethod, - authOptions: defaultOptions, - }) - const session = await eth.createSession() - expect(session.id).toBe(session.did.parent) - expect(session.id).toBe(eth.id) - const result = await session.did.createDagJWS({ test: true }) - // biome-ignore lint/style/noNonNullAssertion: existing value - const capability = await Cacao.fromBlockBytes(result.cacaoBlock!) - const verified = await session.did.verifyJWS(result.jws, { - capability, - issuer: session.id, - verifiers, + test('Session signing can be verified', async () => { + const authMethod = await ethereum.authMethodFromRandomKey() + const session = await createSession(authMethod, defaultOptions) + expect(session.id).toBe(session.did.parent) + + const result = await session.did.createDagJWS({ test: true }) + // biome-ignore lint/style/noNonNullAssertion: existing value + const capability = await Cacao.fromBlockBytes(result.cacaoBlock!) + const verified = await session.did.verifyJWS(result.jws, { + capability, + issuer: session.id, + verifiers: getEIP191Verifier(), + }) + expect(verified).toBeDefined() }) - expect(verified).toBeDefined() }) diff --git a/packages/test-vectors/assets/key-ecdsa-p256.car b/packages/test-vectors/assets/key-ecdsa-p256.car index c5cee3027fb6c5c00ca805f4ead6a70bf8bc5de5..61ca86d1f68930bb0fdafacfe83ec788b6a714b4 100644 GIT binary patch literal 2467 zcmcColvmwZjjNKH&hEn1RXoLZ2Yo1c=J10f^S&oMHAOq(cqHeX_e{i44S#(!%s zd}`juUm`o#t9O%?l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M)4wX&JU|*nz7ECpEFfR$MzIj z=n*OyhDzvBmO&U8prKbD@a9Y8kvWsZv{)Y0A2Q!0DY#=YgU`NY7w^B5-0MHj3oZ0U z(;hJG6)-St0T(Z;yrmS`4lsO-dp~*IEPm-NS<$BJLL*`(EX^ouaq>>Bf>bi!pw-J_ zva1(rRVk-gh^a|el34j=Au2oys=GX337VPW0<4r>%Tn`75QQkA(h;K3GcU6QO(UV2 zvjA>m0Hg+mw>1c*a)?flmFPMNl`iEFJ5x(ii*hsbGK)(xlVPrgG;;_gsS3$Vw2%sh VRp^KyBb2G(hQLD&iy?%{RRBLC-lYHl diff --git a/packages/test-vectors/assets/pkh-ethereum.car b/packages/test-vectors/assets/pkh-ethereum.car index fdbd9a35d4b66c07c68b28e725835c5278bdb3c5..7f4a46ee8be745ec3c5aa44261ba422a952089ab 100644 GIT binary patch literal 10772 zcmeHN2Ut{B+6HWEi7^@sww0ifSkT+c*bo7`V8e)Q?7%{K%@&bapHrmwcTvrCTXaiTb{&P!h<6(06a%L0a# zK-D8zp-2V?N;U*e(anjns52su&dUrk%EKePxX0{7O0OYQ->AN$hehLkIh(T&-Dlv) zkwb=(VuBb)nj@{&Q3^zE#T~?JpD+y9zQZw0SNiRYVc2U>2C6%Vzz8Y~xe2z!?TgqSXv!i>M-p`tu3_T(%>J)oF*wkz$0%4$Lyt zb?MSUcBnu_W@J&_-TKHb6s#I#M=($nlMI2Xt!*%X+C7e7)f()uno+P-3ifDrf<>T$ zVC{78GF!lr2^{Xpn41s@S`bJ*Dk|Yf+lDRBRNij zJb?>9l}Z+r$M^V`M1`e8*7?|L&F^Qpv(Fb0b?-0vI!_t1$C%&Pgq99VO{2eiG1_VT8Uj-dVL1wFnOl5!LLJRx@O03OocE}p^m!6pq;>ZWdN4`(p`MlaHqyMZ; zy5>zLyaj)3C^;>%&50uY`~zwjq1B?=ttOKer76EZ&eCf5r};MyZZ(!W(m{<5i;Ilu z-Js=~?>k(Gk9^(TBB#-}T_fh8Z5K233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(5IlFZ?pjLT>^gpmv7-5B4)oNRhq^z0lnB(#%>R zUav?i*xYVWkd4|ThLTM(;V{uwJu8`^8O_CWFMPm6^6-Hx|Qn6B^eZo!Zxt>QDUB#gP|T~gG3f2YU6x6{`z+zwAOi@e|&N&br}$g1$IvdEeI4*PQL@ zI<~pTg`U3|q$Qpi(o!6WhP48n0f>h=^D{?UOFbYhkO7O*S014si_nlJ zNLHxmUg8{-0fpM5B#$v@WDjJzVw5d17`iOu6v}@|MxZH~l?a|-A&X|-A_I^x9H#-A zWpj)`@(86V7V9$-=plEdY6Gm6GwW;A9}pL(~h-hHm785yNIu_ ztxXMKkJ1X&9p9I2zf;Q$^@_AFq8YwU%b1*!+;-bv_8(Y6l*P)ew@qG<+&3(LS@E?g z3C7QT+Ahy%+Vt%QjS5csP3_l)-PB~Ub7kuZcRDp;;wCr8J2zinIc>j}^Y}{ihBx0i zd3DmP<>{B2pGeq;jqyK!F4L8KWbfXEhAQsH-D=iG?yqKTJR_#Y{$>@-3s0=2^}mo( zqI*gs`Sm0c6QUC+QVe3cyyZY-pQnrhPgH@bg#%2Az1Bicd=$0jiSJbLQfg>jo`R)n zWyK?Fuk?g=Nmb8;c4##!CiJ#Y#3#G1Vw8DuD5t+tOH(7B&}5#f%+ox%Mo5j;>JZ|I z8{q7K=w*ns_0(o>0u=~~L9x4@ZpG8srbbH5R_c=CX$I#Esj+3HI-kmT%LzpL;0m79 z(>-~D&T46O?5Hkjp5BMf&b2M}ba!>A-BS;@MqC}+t3#Zp&b%}9|KHsZ^YCg)-c#Lq mYNh-uc|+}5Xsu-nPX$AbygH6s*Zw?p-2Roky7uR(uKZt>Lh_sd diff --git a/packages/test-vectors/assets/pkh-solana.car b/packages/test-vectors/assets/pkh-solana.car index d16669b50e5aa2d4c842fea58b1182e7240a45ff..362c6fbf3995e661cede2d3091684fc540bd5462 100644 GIT binary patch literal 10693 zcmeHN30MKNoJz8Xg$_@ zyRFqK9tGRteQVWKtgcwGDpI_y>rpRMJX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uLS^fXWnW|U)bLD%ZrOo%9JG1g|RajNr-4&&CT1BUDjvsBOG_+n*<0iRT zeE+=c(1PSGRVWWeN&Y%(Uk!DE%1z0g0WBiYX5^4#sE=t`{8j2EXJ(rEG)3PR=k7CGK z0A$qFKEOv~3Wd(vXbp_0p=hD*hitF^;q)X#cODMp{Bb30$j~C`v3p{ diff --git a/packages/test-vectors/package.json b/packages/test-vectors/package.json index 3b3a488..c7f9eb3 100644 --- a/packages/test-vectors/package.json +++ b/packages/test-vectors/package.json @@ -52,15 +52,8 @@ "@didtools/key-webcrypto": "^0.2.0", "@didtools/pkh-ethereum": "^0.6.0", "@didtools/pkh-solana": "^0.2.0", - "@noble/curves": "^1.5.0", - "@solana/signers": "^2.0.0-rc.1", - "caip": "^1.1.1", - "cborg": "^4.2.3", - "did-session": "^4.0.0", "dids": "^5.0.2", - "key-did-resolver": "^4.0.0", - "multiformats": "^13.1.1", - "uint8arrays": "^5.1.0" + "multiformats": "^13.1.1" }, "jest": { "extensionsToTreatAsEsm": [".ts"], diff --git a/packages/test-vectors/scripts/create-test-vectors.ts b/packages/test-vectors/scripts/create-test-vectors.ts index 36f1db2..1238e3f 100644 --- a/packages/test-vectors/scripts/create-test-vectors.ts +++ b/packages/test-vectors/scripts/create-test-vectors.ts @@ -1,132 +1,32 @@ import { InitEventPayload, - type SignedEvent, signEvent, signedEventToCAR, } from '@ceramic-sdk/events' -import { CommitID, StreamID } from '@ceramic-sdk/identifiers' +import { CommitID } from '@ceramic-sdk/identifiers' import { createDataEventPayload, createInitHeader, getDeterministicInitEvent, } from '@ceramic-sdk/model-instance-client' import { getStreamID } from '@ceramic-sdk/model-instance-protocol' -import type { AuthMethod, Cacao } from '@didtools/cacao' +import { webauthn } from '@ceramic-sdk/test-utils' import type { IBlock } from 'cartonne' import type { CreateJWSOptions, DID } from 'dids' import type { ControllerType } from '../src/index.ts' import { createCAR } from './utils/car.ts' -import { - createCapabilityDID, - createExpiredCapabilityDID, - keyDID, -} from './utils/did.ts' -import { getAuthMethod as getEthereumAuth } from './utils/ethereum.ts' +import { controllerFactories } from './utils/controllers.ts' import { writeCARFile } from './utils/fs.ts' -import { getAuthMethod as getSolanaAuth } from './utils/solana.ts' -import { getAuthMethod as getWebAuthnAuth } from './utils/webauthn.ts' -import { getP256KeyDID } from './utils/webcrypto.ts' - -function changeEventSignature(event: SignedEvent): SignedEvent { - const [firstSignature, ...otherSignatures] = event.jws.signatures - return { - ...event, - jws: { - ...event.jws, - signatures: [ - { - ...firstSignature, - signature: `${firstSignature.signature.slice(0, -4)}AAAA`, - }, - ...otherSignatures, - ], - }, - } -} - -function changeCapabilitySignature(cacao: Cacao): Cacao { - // biome-ignore lint/style/noNonNullAssertion: existing value - const signature = cacao.s! - return { ...cacao, s: { ...signature, s: `${signature.s.slice(0, -4)}AAAA` } } -} - -const MODEL_ID = - 'k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lq' -const model = StreamID.fromString(MODEL_ID) - -type ControllerCommon = { - id: string - signer: DID -} - -type ControllerWithoutCapability = ControllerCommon & { withCapability: false } - -type ControllerWithCapability = ControllerCommon & { - withCapability: true - expiredSigner: DID - noResourceSigner: DID - expectedModelSigner: DID - otherModelSigner: DID -} - -type Controller = ControllerWithoutCapability | ControllerWithCapability - -async function createCapabilityController( - authMethod: AuthMethod, -): Promise { - const [ - signer, - expiredSigner, - noResourceSigner, - expectedModelSigner, - otherModelSigner, - ] = await Promise.all([ - createCapabilityDID(authMethod, { resources: ['ceramic://*'] }), - createExpiredCapabilityDID(authMethod, { resources: ['ceramic://*'] }), - createCapabilityDID(authMethod, { resources: [] }), - createCapabilityDID(authMethod, { - resources: [`ceramic://*?model=${MODEL_ID}`], - }), - createCapabilityDID(authMethod, { - resources: [ - 'ceramic://*?model=k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lr', - ], - }), - ]) - return { - withCapability: true, - id: signer.id, - signer, - expiredSigner, - noResourceSigner, - expectedModelSigner, - otherModelSigner, - } -} +import { + changeCapabilitySignature, + changeEventSignature, +} from './utils/signatures.ts' +import { testModel } from './utils/streams.ts' -const controllerFactories = { - 'key-ecdsa-p256': async () => { - const signer = await getP256KeyDID() - return { withCapability: false, id: signer.id, signer } - }, - 'key-ed25519': () => { - return { withCapability: false, id: keyDID.id, signer: keyDID } - }, - 'pkh-ethereum': async () => { - const authMethod = await getEthereumAuth() - return await createCapabilityController(authMethod) - }, - 'pkh-solana': async () => { - const authMethod = await getSolanaAuth() - return await createCapabilityController(authMethod) - }, - 'pkh-webauthn': async () => { - const authMethod = await getWebAuthnAuth() - return await createCapabilityController(authMethod) - }, -} satisfies Record Controller | Promise> +// Inject mock WebAuthn authenticator +webauthn.injectMockBrowserGlobals() for (const [controllerType, createController] of Object.entries( controllerFactories, @@ -136,7 +36,7 @@ for (const [controllerType, createController] of Object.entries( // Deterministic (init) event const validDeterministicEvent = getDeterministicInitEvent( - model, + testModel, controller.id, ) @@ -145,7 +45,7 @@ for (const [controllerType, createController] of Object.entries( data: { test: true }, header: createInitHeader({ controller: controller.id, - model, + model: testModel, unique: new Uint8Array([0, 1, 2, 3]), }), }) @@ -177,7 +77,7 @@ for (const [controllerType, createController] of Object.entries( ] const carMeta: Record = { controller: controller.id, - model: model.bytes, + model: testModel.bytes, validInitEvent: validInitCAR.roots[0], validDataEvent: validDataCAR.roots[0], invalidInitEventSignature: invalidInitSignatureCAR.roots[0], diff --git a/packages/test-vectors/scripts/utils/controllers.ts b/packages/test-vectors/scripts/utils/controllers.ts new file mode 100644 index 0000000..0afd1a3 --- /dev/null +++ b/packages/test-vectors/scripts/utils/controllers.ts @@ -0,0 +1,92 @@ +import { + createCapabilityDID, + createExpiredCapabilityDID, + ethereum, + solana, + webauthn, + webcrypto, +} from '@ceramic-sdk/test-utils' +import type { AuthMethod } from '@didtools/cacao' +import { getAuthenticatedDID } from '@didtools/key-did' +import type { DID } from 'dids' + +import type { ControllerType } from '../../src/index.ts' + +import { TEST_MODEL_ID } from './streams.js' + +const keyDID = await getAuthenticatedDID(new Uint8Array(32)) + +type ControllerCommon = { + id: string + signer: DID +} + +type ControllerWithoutCapability = ControllerCommon & { withCapability: false } + +type ControllerWithCapability = ControllerCommon & { + withCapability: true + expiredSigner: DID + noResourceSigner: DID + expectedModelSigner: DID + otherModelSigner: DID +} + +type Controller = ControllerWithoutCapability | ControllerWithCapability + +async function createCapabilityController( + authMethod: AuthMethod, +): Promise { + const [ + signer, + expiredSigner, + noResourceSigner, + expectedModelSigner, + otherModelSigner, + ] = await Promise.all([ + createCapabilityDID(keyDID, authMethod, { resources: ['ceramic://*'] }), + createExpiredCapabilityDID(keyDID, authMethod, { + resources: ['ceramic://*'], + }), + createCapabilityDID(keyDID, authMethod, { resources: [] }), + createCapabilityDID(keyDID, authMethod, { + resources: [`ceramic://*?model=${TEST_MODEL_ID}`], + }), + createCapabilityDID(keyDID, authMethod, { + resources: [ + 'ceramic://*?model=k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lr', + ], + }), + ]) + return { + withCapability: true, + id: signer.id, + signer, + expiredSigner, + noResourceSigner, + expectedModelSigner, + otherModelSigner, + } +} + +export const controllerFactories = { + 'key-ecdsa-p256': async () => { + const keyPair = await webcrypto.getP256KeyPair() + const signer = await webcrypto.getAuthenticatedDID(keyPair) + return { withCapability: false, id: signer.id, signer } + }, + 'key-ed25519': () => { + return { withCapability: false, id: keyDID.id, signer: keyDID } + }, + 'pkh-ethereum': async () => { + const authMethod = await ethereum.getAuthMethod() + return await createCapabilityController(authMethod) + }, + 'pkh-solana': async () => { + const authMethod = await solana.getAuthMethod() + return await createCapabilityController(authMethod) + }, + 'pkh-webauthn': async () => { + const authMethod = await webauthn.getAuthMethod() + return await createCapabilityController(authMethod) + }, +} satisfies Record Controller | Promise> diff --git a/packages/test-vectors/scripts/utils/ethereum.ts b/packages/test-vectors/scripts/utils/ethereum.ts deleted file mode 100644 index 2902023..0000000 --- a/packages/test-vectors/scripts/utils/ethereum.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { - type Hex, - createAuthMethod, - createProvider, - getAccount, -} from '@ceramic-sdk/test-utils' -import type { AuthMethod } from '@didtools/cacao' - -const PRIVATE_KEY = - '0xe50df915de22bad5bf1abf43f78b55d64640afdcdfa6b1699a514d97662b23f7' as Hex - -export async function getAuthMethod(): Promise { - const provider = createProvider(PRIVATE_KEY) - const accountId = await getAccount(provider) - return createAuthMethod(provider, accountId) -} diff --git a/packages/test-vectors/scripts/utils/signatures.ts b/packages/test-vectors/scripts/utils/signatures.ts new file mode 100644 index 0000000..db9598f --- /dev/null +++ b/packages/test-vectors/scripts/utils/signatures.ts @@ -0,0 +1,25 @@ +import type { SignedEvent } from '@ceramic-sdk/events' +import type { Cacao } from '@didtools/cacao' + +export function changeEventSignature(event: SignedEvent): SignedEvent { + const [firstSignature, ...otherSignatures] = event.jws.signatures + return { + ...event, + jws: { + ...event.jws, + signatures: [ + { + ...firstSignature, + signature: `${firstSignature.signature.slice(0, -4)}AAAA`, + }, + ...otherSignatures, + ], + }, + } +} + +export function changeCapabilitySignature(cacao: Cacao): Cacao { + // biome-ignore lint/style/noNonNullAssertion: existing value + const signature = cacao.s! + return { ...cacao, s: { ...signature, s: `${signature.s.slice(0, -4)}AAAA` } } +} diff --git a/packages/test-vectors/scripts/utils/streams.ts b/packages/test-vectors/scripts/utils/streams.ts new file mode 100644 index 0000000..882de88 --- /dev/null +++ b/packages/test-vectors/scripts/utils/streams.ts @@ -0,0 +1,6 @@ +import { StreamID } from '@ceramic-sdk/identifiers' + +export const TEST_MODEL_ID = + 'k2t6wz4z9kggqqnbn3vqggh2z4fe9jctr9vvbc1em2yho0qnzzrtzz1n2hr4lq' + +export const testModel = StreamID.fromString(TEST_MODEL_ID) diff --git a/packages/test-vectors/test/vectors.test.ts b/packages/test-vectors/test/vectors.test.ts index ac84f3e..f790b26 100644 --- a/packages/test-vectors/test/vectors.test.ts +++ b/packages/test-vectors/test/vectors.test.ts @@ -9,6 +9,7 @@ import { DocumentDataEventPayload, DocumentInitEventPayload, } from '@ceramic-sdk/model-instance-protocol' +import { webauthn } from '@ceramic-sdk/test-utils' import { Cacao } from '@didtools/cacao' import { createDID } from '@didtools/key-did' import { WebauthnAuth } from '@didtools/key-webauthn' @@ -17,7 +18,7 @@ import { getSolanaVerifier } from '@didtools/pkh-solana' import type { CAR } from 'cartonne' // Inject mock WebAuthn authenticator -import '../scripts/utils/webauthn.ts' +webauthn.injectMockBrowserGlobals() import { type ArchiveRootContentCommon, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58109c6..823103b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,13 +16,13 @@ importers: version: 29.7.0 '@swc/cli': specifier: ^0.4.0 - version: 0.4.0(@swc/core@1.7.18)(chokidar@3.6.0) + version: 0.4.0(@swc/core@1.7.22)(chokidar@3.6.0) '@swc/core': - specifier: ^1.7.11 - version: 1.7.18 + specifier: ^1.7.22 + version: 1.7.22 '@swc/jest': specifier: ^0.2.36 - version: 0.2.36(@swc/core@1.7.18) + version: 0.2.36(@swc/core@1.7.22) '@types/jest': specifier: ^29.5.12 version: 29.5.12 @@ -67,7 +67,7 @@ importers: version: 1.0.0(typescript@5.5.4)(zod@3.23.8) '@mantine/core': specifier: ^7.11.2 - version: 7.12.1(@mantine/hooks@7.12.1(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 7.12.1(@mantine/hooks@7.12.1(react@18.3.1))(@types/react@18.3.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mantine/hooks': specifier: ^7.11.2 version: 7.12.1(react@18.3.1) @@ -75,17 +75,17 @@ importers: specifier: ^3.14.0 version: 3.14.0(react@18.3.1) '@tanstack/react-query': - specifier: ^5.52.2 - version: 5.52.2(react@18.3.1) + specifier: ^5.52.3 + version: 5.52.3(react@18.3.1) '@tanstack/react-router': - specifier: ^1.51.2 - version: 1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.51.6 + version: 1.51.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) codeco: - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.3 + version: 1.4.3 jotai: specifier: ^2.9.2 - version: 2.9.3(@types/react@18.3.4)(react@18.3.1) + version: 2.9.3(@types/react@18.3.5)(react@18.3.1) multiformats: specifier: ^13.2.2 version: 13.2.2 @@ -103,14 +103,14 @@ importers: specifier: workspace:^ version: link:../../packages/model-instance-client '@tanstack/router-devtools': - specifier: ^1.51.2 - version: 1.51.2(@tanstack/react-router@1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.51.6 + version: 1.51.6(@tanstack/react-router@1.51.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/router-plugin': - specifier: ^1.51.0 - version: 1.51.0(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41))) + specifier: ^1.51.6 + version: 1.51.6(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41))) '@types/react': - specifier: ^18.3.3 - version: 18.3.4 + specifier: ^18.3.5 + version: 18.3.5 '@types/react-dom': specifier: ^18.3.0 version: 18.3.0 @@ -154,8 +154,8 @@ importers: specifier: ^3.0.1 version: 3.0.1 codeco: - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.3 + version: 1.4.3 dag-jose: specifier: ^5.1.1 version: 5.1.1 @@ -185,21 +185,21 @@ importers: specifier: workspace:^ version: link:../events openapi-fetch: - specifier: ^0.11.1 - version: 0.11.1 + specifier: ^0.11.2 + version: 0.11.2 devDependencies: cartonne: specifier: ^3.0.1 version: 3.0.1 codeco: - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.3 + version: 1.4.3 multiformats: specifier: ^13.2.2 version: 13.2.2 openapi-typescript: - specifier: ^7.3.0 - version: 7.3.0(typescript@5.5.4) + specifier: ^7.3.2 + version: 7.3.2(typescript@5.5.4) type-fest: specifier: ^4.26.0 version: 4.26.0 @@ -210,8 +210,8 @@ importers: specifier: ^9.2.1 version: 9.2.1 codeco: - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.3 + version: 1.4.3 mapmoize: specifier: ^1.2.1 version: 1.2.1 @@ -350,8 +350,8 @@ importers: specifier: ^3.0.1 version: 3.0.1(ajv@8.17.1) codeco: - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.3 + version: 1.4.3 fast-json-patch: specifier: ^3.1.1 version: 3.1.1 @@ -390,8 +390,8 @@ importers: specifier: ^3.0.0 version: 3.0.0 codeco: - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.3 + version: 1.4.3 object-sizeof: specifier: ^2.6.4 version: 2.6.5 @@ -424,8 +424,8 @@ importers: specifier: ^3.0.1 version: 3.0.1(ajv@8.17.1) codeco: - specifier: ^1.4.2 - version: 1.4.2 + specifier: ^1.4.3 + version: 1.4.3 json-ptr: specifier: ^3.1.1 version: 3.1.1 @@ -448,21 +448,48 @@ importers: '@didtools/cacao': specifier: ^3.0.1 version: 3.0.1(typescript@5.5.4)(zod@3.23.8) + '@didtools/key-webauthn': + specifier: ^2.0.2 + version: 2.0.2(typescript@5.5.4)(zod@3.23.8) + '@didtools/key-webcrypto': + specifier: ^0.2.0 + version: 0.2.0 + '@didtools/pkh-solana': + specifier: ^0.2.0 + version: 0.2.0(typescript@5.5.4)(zod@3.23.8) + '@noble/curves': + specifier: ^1.5.0 + version: 1.5.0 '@noble/hashes': specifier: ^1.4.0 version: 1.4.0 + '@solana/signers': + specifier: ^2.0.0-rc.1 + version: 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.4) caip: specifier: ^1.1.1 version: 1.1.1 + cborg: + specifier: ^4.2.3 + version: 4.2.3 did-session: specifier: ^4.0.0 version: 4.0.0(typescript@5.5.4)(zod@3.23.8) dids: specifier: ^5.0.2 version: 5.0.2(typescript@5.5.4)(zod@3.23.8) + key-did-resolver: + specifier: ^4.0.0 + version: 4.0.0 + multiformats: + specifier: ^13.2.2 + version: 13.2.2 + uint8arrays: + specifier: ^5.1.0 + version: 5.1.0 viem: - specifier: ^2.20.1 - version: 2.20.1(typescript@5.5.4)(zod@3.23.8) + specifier: ^2.21.0 + version: 2.21.0(typescript@5.5.4)(zod@3.23.8) devDependencies: '@didtools/pkh-ethereum': specifier: ^0.6.0 @@ -519,33 +546,12 @@ importers: '@didtools/pkh-solana': specifier: ^0.2.0 version: 0.2.0(typescript@5.5.4)(zod@3.23.8) - '@noble/curves': - specifier: ^1.5.0 - version: 1.5.0 - '@solana/signers': - specifier: ^2.0.0-rc.1 - version: 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.4) - caip: - specifier: ^1.1.1 - version: 1.1.1 - cborg: - specifier: ^4.2.3 - version: 4.2.3 - did-session: - specifier: ^4.0.0 - version: 4.0.0(typescript@5.5.4)(zod@3.23.8) dids: specifier: ^5.0.2 version: 5.0.2(typescript@5.5.4)(zod@3.23.8) - key-did-resolver: - specifier: ^4.0.0 - version: 4.0.0 multiformats: specifier: ^13.1.1 version: 13.2.2 - uint8arrays: - specifier: ^5.1.0 - version: 5.1.0 tests/c1-integration: dependencies: @@ -606,8 +612,8 @@ packages: resolution: {integrity: sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==} engines: {node: '>=6.9.0'} - '@babel/generator@7.25.5': - resolution: {integrity: sha512-abd43wyLfbWoxC6ahM8xTkqLpGB2iWBVyuKC9/srhFunCd1SDNrV1s72bBpK4hLj8KLzHBBcOblvLQZBNw9r3w==} + '@babel/generator@7.25.6': + resolution: {integrity: sha512-VPC82gr1seXOpkjAAKoLhP50vx4vGNlF4msF64dSFq1P8RfB+QAuJWGHPXXPc8QyfVWwwB/TNNU4+ayZmHNbZw==} engines: {node: '>=6.9.0'} '@babel/helper-compilation-targets@7.25.2': @@ -662,6 +668,11 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@7.25.6': + resolution: {integrity: sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==} + engines: {node: '>=6.0.0'} + hasBin: true + '@babel/plugin-syntax-async-generators@7.8.4': resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: @@ -753,8 +764,8 @@ packages: resolution: {integrity: sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.25.4': - resolution: {integrity: sha512-VJ4XsrD+nOvlXyLzmLzUs/0qjFS4sK30te5yEFlvbbUNEgKaVb2BHZUpAL+ttLPQAHNrsI3zZisbfha5Cvr8vg==} + '@babel/traverse@7.25.6': + resolution: {integrity: sha512-9Vrcx5ZW6UwK5tvqsj0nGpp/XzqthkT0dqIc9g1AdtygFToNtTF67XzYS//dm+SAK9cp3B9R4ZO/46p63SCjlQ==} engines: {node: '>=6.9.0'} '@babel/types@7.25.2': @@ -765,6 +776,10 @@ packages: resolution: {integrity: sha512-zQ1ijeeCXVEh+aNL0RlmkPkG8HUiDcU2pzQQFjtbntgAczRASFzj4H+6+bV+dy1ntKR14I/DypeuRG1uma98iQ==} engines: {node: '>=6.9.0'} + '@babel/types@7.25.6': + resolution: {integrity: sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==} + engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} @@ -1295,9 +1310,6 @@ packages: '@noble/curves@1.4.0': resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} - '@noble/curves@1.4.2': - resolution: {integrity: sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==} - '@noble/curves@1.5.0': resolution: {integrity: sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A==} @@ -1324,11 +1336,11 @@ packages: '@redocly/ajv@8.11.0': resolution: {integrity: sha512-9GWx27t7xWhDIR02PA18nzBdLcKQRgc46xNQvjFkrYk4UOmvKhJ/dawwiX0cCOeetN5LcaaiqQbVOWYK62SGHw==} - '@redocly/config@0.7.0': - resolution: {integrity: sha512-6GKxTo/9df0654Mtivvr4lQnMOp+pRj9neVywmI5+BwfZLTtkJnj2qB3D6d8FHTr4apsNOf6zTa5FojX0Evh4g==} + '@redocly/config@0.10.1': + resolution: {integrity: sha512-H3LnKVGzOaxskwJu8pmJYwBOWjP61qOK7TuTrbafqArDVckE06fhA6l0nO4KvBbjLPjy1Al7UnlxOu23V4Nl0w==} - '@redocly/openapi-core@1.19.0': - resolution: {integrity: sha512-ezK6qr80sXvjDgHNrk/zmRs9vwpIAeHa0T/qmo96S+ib4ThQ5a8f3qjwEqxMeVxkxCTbkaY9sYSJKOxv4ejg5w==} + '@redocly/openapi-core@1.22.0': + resolution: {integrity: sha512-IXazrCCUwRkwgVGlaWghFEyyLrz5EM1VM+Kn3/By4QGaNVd04oxC1c92h3kbt1StAxtrTfxBAGwS7bqqCF7nsw==} engines: {node: '>=14.19.0', npm: '>=7.0.0'} '@rollup/rollup-android-arm-eabi@4.21.1': @@ -1534,68 +1546,68 @@ packages: chokidar: optional: true - '@swc/core-darwin-arm64@1.7.18': - resolution: {integrity: sha512-MwLc5U+VGPMZm8MjlFBjEB2wyT1EK0NNJ3tn+ps9fmxdFP+PL8EpMiY1O1F2t1ydy2OzBtZz81sycjM9RieFBg==} + '@swc/core-darwin-arm64@1.7.22': + resolution: {integrity: sha512-B2Bh2W+C7ALdGwDxRWAJ+UtNExfozvwyayGiNkbR3wmDKXXeQfhGM5MK+QYUWKu7UQ6ATq69OyZrxofDobKUug==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.7.18': - resolution: {integrity: sha512-IkukOQUw7/14VkHp446OkYGCZEHqZg9pTmTdBawlUyz2JwZMSn2VodCl7aFSdGCsU4Cwni8zKA8CCgkCCAELhw==} + '@swc/core-darwin-x64@1.7.22': + resolution: {integrity: sha512-s34UQntnQ6tL9hS9aX3xG7OfGhpmy05FEEndbHaooGO8O+L5k8uWxhE5KhYCOC0N803sGdZg6YZmKtYrWN/YxA==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.7.18': - resolution: {integrity: sha512-ATnb6jJaBeXCqrTUawWdoOy7eP9SCI7UMcfXlYIMxX4otKKspLPAEuGA5RaNxlCcj9ObyO0J3YGbtZ6hhD2pjg==} + '@swc/core-linux-arm-gnueabihf@1.7.22': + resolution: {integrity: sha512-SE69+oos1jLOXx5YdMH//Qc5zQc2xYukajB+0BWmkcFd/S/cCanGWYtdSzYausm8af2Fw1hPJMNIfndJLnBDFw==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.7.18': - resolution: {integrity: sha512-poHtH7zL7lEp9K2inY90lGHJABWxURAOgWNeZqrcR5+jwIe7q5KBisysH09Zf/JNF9+6iNns+U0xgWTNJzBuGA==} + '@swc/core-linux-arm64-gnu@1.7.22': + resolution: {integrity: sha512-59FzDW/ojgiTj4dlnv3Z3ESuVlzhSAq9X12CNYh4/WTCNA8BoJqOnWMRQKspWtoNlnVviFLMvpek0pGXHndEBA==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.7.18': - resolution: {integrity: sha512-qnNI1WmcOV7Wz1ZDyK6WrOlzLvJ01rnni8ec950mMHWkLRMP53QvCvhF3S+7gFplWBwWJTOOPPUqJp/PlSxWyQ==} + '@swc/core-linux-arm64-musl@1.7.22': + resolution: {integrity: sha512-cMQMI8YRO/XR3OrYuiUlWksNsJOZSkA6gSLNyH6eHTw+FOAzv05oJ4SFYe6s1WesrOqRwhpez6y5H6OIP/EKzg==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.7.18': - resolution: {integrity: sha512-x9SCqCLzwtlqtD5At3I1a7Gco+EuXnzrJGoucmkpeQohshHuwa+cskqsXO6u1Dz0jXJEuHbBZB9va1wYYfjgFg==} + '@swc/core-linux-x64-gnu@1.7.22': + resolution: {integrity: sha512-639kA7MXrWqWYfwuSJ+XTg21VYb/5o99R1zJrndoEjEX6m7Wza/sXssQKU5jbbkPoSEKVKNP3n/gazLWiUKgiQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.7.18': - resolution: {integrity: sha512-qtj8iOpMMgKjzxTv+islmEY0JBsbd93nka0gzcTTmGZxKtL5jSUsYQvkxwNPZr5M9NU1fgaR3n1vE6lFmtY0IQ==} + '@swc/core-linux-x64-musl@1.7.22': + resolution: {integrity: sha512-f3zfGgY8EJQUOk3ve25ZTkNkhB/kHo9QlN2r+0exaE1g9W7X8IS6J8pWzF3hJrV2P9dBi6ofMOt+opVA89JKHA==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.7.18': - resolution: {integrity: sha512-ltX/Ol9+Qu4SXmISCeuwVgAjSa8nzHTymknpozzVMgjXUoZMoz6lcynfKL1nCh5XLgqh0XNHUKLti5YFF8LrrA==} + '@swc/core-win32-arm64-msvc@1.7.22': + resolution: {integrity: sha512-p/Fav5U+LtTJD/tbbS0dKK8SVVAhXo5Jdm1TDeBPJ4BEIVguYBZEXgD3CW9wY4K34g1hscpiz2Q2rktfhFj1+A==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.7.18': - resolution: {integrity: sha512-RgTcFP3wgyxnQbTCJrlgBJmgpeTXo8t807GU9GxApAXfpLZJ3swJ2GgFUmIJVdLWyffSHF5BEkF3FmF6mtH5AQ==} + '@swc/core-win32-ia32-msvc@1.7.22': + resolution: {integrity: sha512-HbmfasaCNTqeCTvDjleYj+jJZQ6MlraiVOdhW55KtbA9mAVQdPBq6DDAvR7VOero3wUNYUM/e36otFKgEJI5Rg==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.7.18': - resolution: {integrity: sha512-XbZ0wAgzR757+DhQcnv60Y/bK9yuWPhDNRQVFFQVRsowvK3+c6EblyfUSytIidpXgyYFzlprq/9A9ZlO/wvDWw==} + '@swc/core-win32-x64-msvc@1.7.22': + resolution: {integrity: sha512-lppIveE+hpe7WXny/9cUT+T6sBM/ND0E+dviKWJ5jFBISj2KWomlSJGUjYEsRGJVPnTEc8uOlKK7etmXBhQx9A==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.7.18': - resolution: {integrity: sha512-qL9v5N5S38ijmqiQRvCFUUx2vmxWT/JJ2rswElnyaHkOHuVoAFhBB90Ywj4RKjh3R0zOjhEcemENTyF3q3G6WQ==} + '@swc/core@1.7.22': + resolution: {integrity: sha512-Asn79WKqyjEuO2VEeSnVjn2YiRMToRhFJwOsQeqftBvwWMn1FGUuzVcXtkQFBk37si8Gh2Vkk/+p0u4K5NxDig==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -1627,20 +1639,20 @@ packages: '@tabler/icons@3.14.0': resolution: {integrity: sha512-OakKjK1kuDWKoNwdnHHVMt11kTZAC10iZpN/8o/CSYdeBH7S3v5n8IyqAYynFxLI8yBGTyBvljtvWdmWh57zSg==} - '@tanstack/history@1.49.7': - resolution: {integrity: sha512-9e9e+QFeWve6rB5BWK9MR8/1BmQYd1LFmM5BYh1Ht15yLcyU0FoiPG4Iun9Coc3Obo1mA+NbYCoOYoSZ+h+9yw==} + '@tanstack/history@1.51.6': + resolution: {integrity: sha512-qx6HpTSDI8X6fQauiaAIHmCAEfK2m0nkED6A3WoLs0AUcnDhFiAlJ/0KGJjYnjWtiLL35LAVsHqL9ofpsm9yHA==} engines: {node: '>=12'} - '@tanstack/query-core@5.52.2': - resolution: {integrity: sha512-9vvbFecK4A0nDnrc/ks41e3UHONF1DAnGz8Tgbxkl59QcvKWmc0ewhYuIKRh8NC4ja5LTHT9EH16KHbn2AIYWA==} + '@tanstack/query-core@5.52.3': + resolution: {integrity: sha512-+Gh7lXn+eoAsarvvnndgqBeJ5lOjup8qgQnrTsFuhNTEAo0H934DxEPro4s3TlmvITfDTJ3UDCy7kY8Azm0qsA==} - '@tanstack/react-query@5.52.2': - resolution: {integrity: sha512-d4OwmobpP+6+SvuAxW1RzAY95Pv87Gu+0GjtErzFOUXo+n0FGcwxKvzhswCsXKxsgnAr3bU2eJ2u+GXQAutkCQ==} + '@tanstack/react-query@5.52.3': + resolution: {integrity: sha512-1K7l2hkqlWuh5SdaTYPSwMmHJF5dDk5INK+EtiEwUZW4+usWTXZx7QeHuk078oSzTzaVkEFyT3VquK7F0hYkUw==} peerDependencies: react: ^18 || ^19 - '@tanstack/react-router@1.51.2': - resolution: {integrity: sha512-m4eIS4h8tGLtYJ6C75nKZe32yB8SjL23LUKlsJiEIMHkpkYMfsCI09qqEiPxL/5vEqVNNNS13LbAIzMiX8Yu3A==} + '@tanstack/react-router@1.51.6': + resolution: {integrity: sha512-Z/y8RD50vxZUnsKHJ1VP6U9fKRKwDBmJcM8eHsIbhM7fbhK2mKvYZsSWZNsNWxRT+nnzEXCF+6tU7FIq0EGhBg==} engines: {node: '>=12'} peerDependencies: react: '>=18' @@ -1652,20 +1664,20 @@ packages: react: ^17.0.0 || ^18.0.0 react-dom: ^17.0.0 || ^18.0.0 - '@tanstack/router-devtools@1.51.2': - resolution: {integrity: sha512-5ZE44al1dkluTdhL0YNh7aGpesM5Xc2XYKqOXMnyQ6qO+kMl/P/mgh/hRzycbKNC0zU5ywse3nt7QGEstNfTPw==} + '@tanstack/router-devtools@1.51.6': + resolution: {integrity: sha512-YWE5lpnkXqM1t8846rwOu1OpfUwO1uayvUgTCeAmlDX0OpBWVFupHjlRP0GZ3HMZpzPGmYOwqbd+QorWraYMMQ==} engines: {node: '>=12'} peerDependencies: - '@tanstack/react-router': ^1.51.2 + '@tanstack/react-router': ^1.51.6 react: '>=18' react-dom: '>=18' - '@tanstack/router-generator@1.51.0': - resolution: {integrity: sha512-X8bAXEhDnJ/NQuT8uqXj8URDKXi9FBPhnaxNcejmihVBNv81NrQ14nYzNdaS94esmc3hUFcARrpQLoX8hXgN0Q==} + '@tanstack/router-generator@1.51.6': + resolution: {integrity: sha512-iAzan/Z5pF/CAX1g6Ouc4QixRK77nlvSJECqeqzpYMkAzz07m2IybVN/piQzw4Vje0UMKfkO3GgBAHc1CG18vg==} engines: {node: '>=12'} - '@tanstack/router-plugin@1.51.0': - resolution: {integrity: sha512-Nck6r547pF4V1RZJcI9QmAsT6jAMsK1SxwCkHuyCIRQiTSO57CSOqDYNBf6gFin2EyGkbqhwLPSTl+DUhY6O0w==} + '@tanstack/router-plugin@1.51.6': + resolution: {integrity: sha512-wKtgsofslYDm4WCy9x7Fwm91Qtkznwvf1lAWvhO3115J6J3RXssf5Df28gW6HVeNxVLlK3yn32DBp6pIO24A/A==} engines: {node: '>=12'} peerDependencies: '@rsbuild/core': '>=1.0.0' @@ -1751,8 +1763,8 @@ packages: '@types/react-dom@18.3.0': resolution: {integrity: sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==} - '@types/react@18.3.4': - resolution: {integrity: sha512-J7W30FTdfCxDDjmfRM+/JqLHBIyl7xUIp9kwK637FGmY7+mkSFSe6L4jpZzhj5QMfLssSDP4/i75AKkrdC7/Jw==} + '@types/react@18.3.5': + resolution: {integrity: sha512-WeqMfGJLGuLCqHGYRGHxnKrXcTitc6L/nBUWfWPcTarG3t9PsquqUMuVeXZeca+mglY4Vo5GZjCi0A3Or2lnxA==} '@types/responselike@1.0.3': resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} @@ -2029,8 +2041,8 @@ packages: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} - codeco@1.4.2: - resolution: {integrity: sha512-kMoa37m2g0JJT3VNiESLVZabq5zP/SwJ1Ds0eZIr48P+6J0mTtHdNSYlzA5MWFejeknhrCRJlRl5z+yc9Z1Y5g==} + codeco@1.4.3: + resolution: {integrity: sha512-NG2kuhCtCNVKWYEwhVb6yg1QU/hYbMUIsaJkxXGEypHQIBClAvMGQhiheEX6c4C9Dwi9L/UuzeO66Us3KrK1rA==} collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} @@ -2942,14 +2954,14 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} - openapi-fetch@0.11.1: - resolution: {integrity: sha512-WtDQsrvxjXuCmo6u6WMQPfUaya8cLfL+ZCaXorPo9MMumqlU/Km/SrCXsEcJH234D4iykOkvJ6Q/iWBzK7+3rA==} + openapi-fetch@0.11.2: + resolution: {integrity: sha512-zc37VvX9vHJjJxNY3JLhg5Ks3J3KSL56NJrIAp2QRt/fdkOhGQHBTVY+Zz7tEOdqocS/1xfRTzWC6NguCGjUnA==} openapi-typescript-helpers@0.0.12: resolution: {integrity: sha512-FO+5kTWO6KDutigamr2MRwciYkAUYhqdctlyVRrQOe2uxif2/O2+GcS07jNnP36AUK6ubSsGu3GeBiYIc6eQzA==} - openapi-typescript@7.3.0: - resolution: {integrity: sha512-EkljRjYWOPwGXiK++uI9MkGv2Y7uhbkZbi9V1z3r3EpmWVO6aFTHXSLNvxIWo6UT6LCTYgEYkUB3BWQjwwXthg==} + openapi-typescript@7.3.2: + resolution: {integrity: sha512-bNHPVlTrzRRD+7RBARjcbRrLDvNOLMNV6uHXDCneH9iQsm7WUoccvBtMaG8Y8eZ1GeFsQvnXZteNXt46snBJZQ==} hasBin: true peerDependencies: typescript: ^5.x @@ -3635,8 +3647,8 @@ packages: typescript: optional: true - viem@2.20.1: - resolution: {integrity: sha512-a/BSe25TSfkc423GTSKYl1O0ON2J5huoQeOLkylHT1WS8wh3JFqb8nfAq7vg+aZ+W06BCTn36bbi47yp4D92Cg==} + viem@2.21.0: + resolution: {integrity: sha512-9g3Gw2nOU6t4bNuoDI5vwVExzIxseU0J7Jjx10gA2RNQVrytIrLxggW++tWEe3w4mnnm/pS1WgZFjQ/QKf/nHw==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -3815,9 +3827,9 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 - '@babel/generator@7.25.5': + '@babel/generator@7.25.6': dependencies: - '@babel/types': 7.25.4 + '@babel/types': 7.25.6 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 @@ -3882,6 +3894,10 @@ snapshots: dependencies: '@babel/types': 7.25.4 + '@babel/parser@7.25.6': + dependencies: + '@babel/types': 7.25.6 + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 @@ -3979,13 +3995,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/traverse@7.25.4': + '@babel/traverse@7.25.6': dependencies: '@babel/code-frame': 7.24.7 - '@babel/generator': 7.25.5 - '@babel/parser': 7.25.4 + '@babel/generator': 7.25.6 + '@babel/parser': 7.25.6 '@babel/template': 7.25.0 - '@babel/types': 7.25.4 + '@babel/types': 7.25.6 debug: 4.3.6(supports-color@9.4.0) globals: 11.12.0 transitivePeerDependencies: @@ -4003,6 +4019,12 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + '@babel/types@7.25.6': + dependencies: + '@babel/helper-string-parser': 7.24.8 + '@babel/helper-validator-identifier': 7.24.7 + to-fast-properties: 2.0.0 + '@bcoe/v8-coverage@0.2.3': {} '@biomejs/biome@1.8.3': @@ -4066,7 +4088,7 @@ snapshots: '@didtools/codecs@3.0.0': dependencies: - codeco: 1.4.2 + codeco: 1.4.3 multiformats: 13.2.2 uint8arrays: 5.1.0 @@ -4145,7 +4167,7 @@ snapshots: '@didtools/siwx@2.0.0': dependencies: - codeco: 1.4.2 + codeco: 1.4.3 '@esbuild/aix-ppc64@0.21.5': optional: true @@ -4516,7 +4538,7 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@mantine/core@7.12.1(@mantine/hooks@7.12.1(react@18.3.1))(@types/react@18.3.4)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@mantine/core@7.12.1(@mantine/hooks@7.12.1(react@18.3.1))(@types/react@18.3.5)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@floating-ui/react': 0.26.23(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@mantine/hooks': 7.12.1(react@18.3.1) @@ -4524,8 +4546,8 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) react-number-format: 5.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react-remove-scroll: 2.5.10(@types/react@18.3.4)(react@18.3.1) - react-textarea-autosize: 8.5.3(@types/react@18.3.4)(react@18.3.1) + react-remove-scroll: 2.5.10(@types/react@18.3.5)(react@18.3.1) + react-textarea-autosize: 8.5.3(@types/react@18.3.5)(react@18.3.1) type-fest: 4.25.0 transitivePeerDependencies: - '@types/react' @@ -4557,10 +4579,6 @@ snapshots: dependencies: '@noble/hashes': 1.4.0 - '@noble/curves@1.4.2': - dependencies: - '@noble/hashes': 1.4.0 - '@noble/curves@1.5.0': dependencies: '@noble/hashes': 1.4.0 @@ -4588,12 +4606,12 @@ snapshots: require-from-string: 2.0.2 uri-js: 4.4.1 - '@redocly/config@0.7.0': {} + '@redocly/config@0.10.1': {} - '@redocly/openapi-core@1.19.0(supports-color@9.4.0)': + '@redocly/openapi-core@1.22.0(supports-color@9.4.0)': dependencies: '@redocly/ajv': 8.11.0 - '@redocly/config': 0.7.0 + '@redocly/config': 0.10.1 colorette: 1.4.0 https-proxy-agent: 7.0.5(supports-color@9.4.0) js-levenshtein: 1.1.6 @@ -4665,7 +4683,7 @@ snapshots: '@scure/bip32@1.4.0': dependencies: - '@noble/curves': 1.4.2 + '@noble/curves': 1.4.0 '@noble/hashes': 1.4.0 '@scure/base': 1.1.7 @@ -4825,10 +4843,10 @@ snapshots: '@stablelib/wipe@1.0.1': {} - '@swc/cli@0.4.0(@swc/core@1.7.18)(chokidar@3.6.0)': + '@swc/cli@0.4.0(@swc/core@1.7.22)(chokidar@3.6.0)': dependencies: '@mole-inc/bin-wrapper': 8.0.1 - '@swc/core': 1.7.18 + '@swc/core': 1.7.22 '@swc/counter': 0.1.3 commander: 8.3.0 fast-glob: 3.3.2 @@ -4840,58 +4858,58 @@ snapshots: optionalDependencies: chokidar: 3.6.0 - '@swc/core-darwin-arm64@1.7.18': + '@swc/core-darwin-arm64@1.7.22': optional: true - '@swc/core-darwin-x64@1.7.18': + '@swc/core-darwin-x64@1.7.22': optional: true - '@swc/core-linux-arm-gnueabihf@1.7.18': + '@swc/core-linux-arm-gnueabihf@1.7.22': optional: true - '@swc/core-linux-arm64-gnu@1.7.18': + '@swc/core-linux-arm64-gnu@1.7.22': optional: true - '@swc/core-linux-arm64-musl@1.7.18': + '@swc/core-linux-arm64-musl@1.7.22': optional: true - '@swc/core-linux-x64-gnu@1.7.18': + '@swc/core-linux-x64-gnu@1.7.22': optional: true - '@swc/core-linux-x64-musl@1.7.18': + '@swc/core-linux-x64-musl@1.7.22': optional: true - '@swc/core-win32-arm64-msvc@1.7.18': + '@swc/core-win32-arm64-msvc@1.7.22': optional: true - '@swc/core-win32-ia32-msvc@1.7.18': + '@swc/core-win32-ia32-msvc@1.7.22': optional: true - '@swc/core-win32-x64-msvc@1.7.18': + '@swc/core-win32-x64-msvc@1.7.22': optional: true - '@swc/core@1.7.18': + '@swc/core@1.7.22': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.12 optionalDependencies: - '@swc/core-darwin-arm64': 1.7.18 - '@swc/core-darwin-x64': 1.7.18 - '@swc/core-linux-arm-gnueabihf': 1.7.18 - '@swc/core-linux-arm64-gnu': 1.7.18 - '@swc/core-linux-arm64-musl': 1.7.18 - '@swc/core-linux-x64-gnu': 1.7.18 - '@swc/core-linux-x64-musl': 1.7.18 - '@swc/core-win32-arm64-msvc': 1.7.18 - '@swc/core-win32-ia32-msvc': 1.7.18 - '@swc/core-win32-x64-msvc': 1.7.18 + '@swc/core-darwin-arm64': 1.7.22 + '@swc/core-darwin-x64': 1.7.22 + '@swc/core-linux-arm-gnueabihf': 1.7.22 + '@swc/core-linux-arm64-gnu': 1.7.22 + '@swc/core-linux-arm64-musl': 1.7.22 + '@swc/core-linux-x64-gnu': 1.7.22 + '@swc/core-linux-x64-musl': 1.7.22 + '@swc/core-win32-arm64-msvc': 1.7.22 + '@swc/core-win32-ia32-msvc': 1.7.22 + '@swc/core-win32-x64-msvc': 1.7.22 '@swc/counter@0.1.3': {} - '@swc/jest@0.2.36(@swc/core@1.7.18)': + '@swc/jest@0.2.36(@swc/core@1.7.22)': dependencies: '@jest/create-cache-key-function': 29.7.0 - '@swc/core': 1.7.18 + '@swc/core': 1.7.22 '@swc/counter': 0.1.3 jsonc-parser: 3.3.1 @@ -4910,18 +4928,18 @@ snapshots: '@tabler/icons@3.14.0': {} - '@tanstack/history@1.49.7': {} + '@tanstack/history@1.51.6': {} - '@tanstack/query-core@5.52.2': {} + '@tanstack/query-core@5.52.3': {} - '@tanstack/react-query@5.52.2(react@18.3.1)': + '@tanstack/react-query@5.52.3(react@18.3.1)': dependencies: - '@tanstack/query-core': 5.52.2 + '@tanstack/query-core': 5.52.3 react: 18.3.1 - '@tanstack/react-router@1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@tanstack/react-router@1.51.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@tanstack/history': 1.49.7 + '@tanstack/history': 1.51.6 '@tanstack/react-store': 0.5.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -4935,9 +4953,9 @@ snapshots: react-dom: 18.3.1(react@18.3.1) use-sync-external-store: 1.2.2(react@18.3.1) - '@tanstack/router-devtools@1.51.2(@tanstack/react-router@1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@tanstack/router-devtools@1.51.6(@tanstack/react-router@1.51.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(csstype@3.1.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@tanstack/react-router': 1.51.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@tanstack/react-router': 1.51.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) clsx: 2.1.1 goober: 2.1.14(csstype@3.1.3) react: 18.3.1 @@ -4945,22 +4963,22 @@ snapshots: transitivePeerDependencies: - csstype - '@tanstack/router-generator@1.51.0': + '@tanstack/router-generator@1.51.6': dependencies: prettier: 3.3.3 zod: 3.23.8 - '@tanstack/router-plugin@1.51.0(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)))': + '@tanstack/router-plugin@1.51.6(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)))': dependencies: '@babel/core': 7.25.2 - '@babel/generator': 7.25.5 - '@babel/parser': 7.25.4 + '@babel/generator': 7.25.6 + '@babel/parser': 7.25.6 '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.2) '@babel/plugin-syntax-typescript': 7.25.4(@babel/core@7.25.2) '@babel/template': 7.25.0 - '@babel/traverse': 7.25.4 - '@babel/types': 7.25.4 - '@tanstack/router-generator': 1.51.0 + '@babel/traverse': 7.25.6 + '@babel/types': 7.25.6 + '@tanstack/router-generator': 1.51.6 '@types/babel__core': 7.20.5 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 @@ -5060,9 +5078,9 @@ snapshots: '@types/react-dom@18.3.0': dependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 - '@types/react@18.3.4': + '@types/react@18.3.5': dependencies: '@types/prop-types': 15.7.12 csstype: 3.1.3 @@ -5085,7 +5103,7 @@ snapshots: '@vitejs/plugin-react-swc@3.7.0(vite@5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)))': dependencies: - '@swc/core': 1.7.18 + '@swc/core': 1.7.22 vite: 5.4.2(@types/node@22.5.1)(sugarss@4.0.1(postcss@8.4.41)) transitivePeerDependencies: - '@swc/helpers' @@ -5162,9 +5180,9 @@ snapshots: babel-dead-code-elimination@1.0.6: dependencies: '@babel/core': 7.25.2 - '@babel/parser': 7.25.4 - '@babel/traverse': 7.25.4 - '@babel/types': 7.25.4 + '@babel/parser': 7.25.6 + '@babel/traverse': 7.25.6 + '@babel/types': 7.25.6 transitivePeerDependencies: - supports-color @@ -5364,7 +5382,7 @@ snapshots: co@4.6.0: {} - codeco@1.4.2: {} + codeco@1.4.3: {} collect-v8-coverage@1.0.2: {} @@ -5530,7 +5548,7 @@ snapshots: '@didtools/codecs': 3.0.0 '@didtools/pkh-ethereum': 0.5.0(typescript@5.5.4)(zod@3.23.8) '@stablelib/random': 1.0.2 - codeco: 1.4.2 + codeco: 1.4.3 dag-jose-utils: 4.0.0 did-jwt: 7.4.7 did-resolver: 4.1.0 @@ -6248,9 +6266,9 @@ snapshots: - supports-color - ts-node - jotai@2.9.3(@types/react@18.3.4)(react@18.3.1): + jotai@2.9.3(@types/react@18.3.5)(react@18.3.1): optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 react: 18.3.1 js-levenshtein@1.1.6: {} @@ -6490,15 +6508,15 @@ snapshots: dependencies: mimic-fn: 2.1.0 - openapi-fetch@0.11.1: + openapi-fetch@0.11.2: dependencies: openapi-typescript-helpers: 0.0.12 openapi-typescript-helpers@0.0.12: {} - openapi-typescript@7.3.0(typescript@5.5.4): + openapi-typescript@7.3.2(typescript@5.5.4): dependencies: - '@redocly/openapi-core': 1.19.0(supports-color@9.4.0) + '@redocly/openapi-core': 1.22.0(supports-color@9.4.0) ansi-colors: 4.1.3 parse-json: 8.1.0 supports-color: 9.4.0 @@ -6662,40 +6680,40 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-remove-scroll-bar@2.3.6(@types/react@18.3.4)(react@18.3.1): + react-remove-scroll-bar@2.3.6(@types/react@18.3.5)(react@18.3.1): dependencies: react: 18.3.1 - react-style-singleton: 2.2.1(@types/react@18.3.4)(react@18.3.1) + react-style-singleton: 2.2.1(@types/react@18.3.5)(react@18.3.1) tslib: 2.7.0 optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 - react-remove-scroll@2.5.10(@types/react@18.3.4)(react@18.3.1): + react-remove-scroll@2.5.10(@types/react@18.3.5)(react@18.3.1): dependencies: react: 18.3.1 - react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@18.3.1) - react-style-singleton: 2.2.1(@types/react@18.3.4)(react@18.3.1) + react-remove-scroll-bar: 2.3.6(@types/react@18.3.5)(react@18.3.1) + react-style-singleton: 2.2.1(@types/react@18.3.5)(react@18.3.1) tslib: 2.7.0 - use-callback-ref: 1.3.2(@types/react@18.3.4)(react@18.3.1) - use-sidecar: 1.1.2(@types/react@18.3.4)(react@18.3.1) + use-callback-ref: 1.3.2(@types/react@18.3.5)(react@18.3.1) + use-sidecar: 1.1.2(@types/react@18.3.5)(react@18.3.1) optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 - react-style-singleton@2.2.1(@types/react@18.3.4)(react@18.3.1): + react-style-singleton@2.2.1(@types/react@18.3.5)(react@18.3.1): dependencies: get-nonce: 1.0.1 invariant: 2.2.4 react: 18.3.1 tslib: 2.7.0 optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 - react-textarea-autosize@8.5.3(@types/react@18.3.4)(react@18.3.1): + react-textarea-autosize@8.5.3(@types/react@18.3.5)(react@18.3.1): dependencies: '@babel/runtime': 7.25.4 react: 18.3.1 use-composed-ref: 1.3.0(react@18.3.1) - use-latest: 1.2.1(@types/react@18.3.4)(react@18.3.1) + use-latest: 1.2.1(@types/react@18.3.5)(react@18.3.1) transitivePeerDependencies: - '@types/react' @@ -7049,37 +7067,37 @@ snapshots: dependencies: punycode: 2.3.1 - use-callback-ref@1.3.2(@types/react@18.3.4)(react@18.3.1): + use-callback-ref@1.3.2(@types/react@18.3.5)(react@18.3.1): dependencies: react: 18.3.1 tslib: 2.7.0 optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 use-composed-ref@1.3.0(react@18.3.1): dependencies: react: 18.3.1 - use-isomorphic-layout-effect@1.1.2(@types/react@18.3.4)(react@18.3.1): + use-isomorphic-layout-effect@1.1.2(@types/react@18.3.5)(react@18.3.1): dependencies: react: 18.3.1 optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 - use-latest@1.2.1(@types/react@18.3.4)(react@18.3.1): + use-latest@1.2.1(@types/react@18.3.5)(react@18.3.1): dependencies: react: 18.3.1 - use-isomorphic-layout-effect: 1.1.2(@types/react@18.3.4)(react@18.3.1) + use-isomorphic-layout-effect: 1.1.2(@types/react@18.3.5)(react@18.3.1) optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 - use-sidecar@1.1.2(@types/react@18.3.4)(react@18.3.1): + use-sidecar@1.1.2(@types/react@18.3.5)(react@18.3.1): dependencies: detect-node-es: 1.1.0 react: 18.3.1 tslib: 2.7.0 optionalDependencies: - '@types/react': 18.3.4 + '@types/react': 18.3.5 use-sync-external-store@1.2.2(react@18.3.1): dependencies: @@ -7119,7 +7137,7 @@ snapshots: - utf-8-validate - zod - viem@2.20.1(typescript@5.5.4)(zod@3.23.8): + viem@2.21.0(typescript@5.5.4)(zod@3.23.8): dependencies: '@adraffy/ens-normalize': 1.10.0 '@noble/curves': 1.4.0 @@ -7153,7 +7171,7 @@ snapshots: webauthn-p256@0.0.5: dependencies: - '@noble/curves': 1.4.2 + '@noble/curves': 1.5.0 '@noble/hashes': 1.4.0 webidl-conversions@3.0.1: {}