diff --git a/.changeset/real-schools-enjoy.md b/.changeset/real-schools-enjoy.md new file mode 100644 index 00000000..d953487d --- /dev/null +++ b/.changeset/real-schools-enjoy.md @@ -0,0 +1,6 @@ +--- +"@tbdex/http-client": minor +"@tbdex/protocol": minor +--- + +Upgrading web5 versions in protocol and http-client diff --git a/packages/http-client/package.json b/packages/http-client/package.json index 7ed7b278..2e94af7f 100644 --- a/packages/http-client/package.json +++ b/packages/http-client/package.json @@ -50,17 +50,21 @@ }, "dependencies": { "@tbdex/protocol": "workspace:*", - "@web5/common": "0.2.1", - "@web5/crypto": "0.2.2", - "@web5/dids": "0.2.2", - "query-string": "8.1.0" + "@web5/common": "0.2.2", + "@web5/credentials": "0.4.1", + "@web5/crypto": "0.2.4", + "@web5/dids": "0.2.4", + "ms": "2.1.3", + "query-string": "8.1.0", + "typeid-js": "0.3.0" }, "devDependencies": { "@playwright/test": "1.34.3", "@types/chai": "4.3.5", "@types/eslint": "8.37.0", "@types/mocha": "10.0.1", - "@types/sinon": "^17.0.2", + "@types/ms": "0.7.34", + "@types/sinon": "17.0.1", "@typescript-eslint/eslint-plugin": "5.59.0", "@typescript-eslint/parser": "5.59.0", "chai": "4.3.10", @@ -78,7 +82,7 @@ "mkdirp": "3.0.1", "mocha": "10.2.0", "rimraf": "4.4.0", - "sinon": "15.0.2", + "sinon": "17.0.1", "typedoc": "0.25.0", "typedoc-plugin-markdown": "3.16.0", "typescript": "5.2.2" diff --git a/packages/protocol/package.json b/packages/protocol/package.json index 24a31fc8..404bdb3b 100644 --- a/packages/protocol/package.json +++ b/packages/protocol/package.json @@ -50,10 +50,10 @@ }, "dependencies": { "@noble/hashes": "1.3.2", - "@web5/common": "0.2.1", - "@web5/credentials": "0.3.2", - "@web5/crypto": "0.2.2", - "@web5/dids": "0.2.2", + "@web5/common": "0.2.2", + "@web5/credentials": "0.4.1", + "@web5/crypto": "0.2.4", + "@web5/dids": "0.2.4", "ajv": "8.12.0", "bignumber.js": "^9.1.2", "canonicalize": "2.0.0", @@ -61,6 +61,7 @@ }, "devDependencies": { "@playwright/test": "1.34.3", + "@types/sinon": "17.0.2", "chai": "4.3.10", "esbuild": "0.16.17", "karma": "6.4.1", @@ -75,7 +76,7 @@ "mocha": "10.2.0", "node-stdlib-browser": "1.2.0", "rimraf": "4.4.0", - "sinon": "15.0.2", + "sinon": "17.0.1", "typedoc": "0.25.0", "typedoc-plugin-markdown": "3.16.0", "typescript": "5.2.2" diff --git a/packages/protocol/src/crypto.ts b/packages/protocol/src/crypto.ts index c5a1e091..25582eb9 100644 --- a/packages/protocol/src/crypto.ts +++ b/packages/protocol/src/crypto.ts @@ -1,19 +1,22 @@ import type { - PrivateKeyJwk as Web5PrivateKeyJwk, CryptoAlgorithm, Web5Crypto, JwsHeaderParams, + JwkParamsEcPrivate, + JwkParamsOkpPrivate, + JwkParamsEcPublic, + JwkParamsOkpPublic, PrivateKeyJwk, PublicKeyJwk } from '@web5/crypto' import { sha256 } from '@noble/hashes/sha256' import { Convert } from '@web5/common' -import { EcdsaAlgorithm, EdDsaAlgorithm, Jose } from '@web5/crypto' -import { deferenceDidUrl, isVerificationMethod } from './did-resolver.js' +import { EcdsaAlgorithm, EdDsaAlgorithm } from '@web5/crypto' +import { DidResolver, isVerificationMethod } from './did-resolver.js' import canonicalize from 'canonicalize' -import { PortableDid } from '@web5/dids' +import { PortableDid, VerificationMethod } from '@web5/dids' /** * Options passed to {@link Crypto.sign} @@ -51,7 +54,7 @@ type SignerValue = { const secp256k1Signer: SignerValue = { signer : new EcdsaAlgorithm(), - options : { name: 'ECDSA', hash: 'SHA-256' }, + options : { name: 'ECDSA' }, alg : 'ES256K', crv : 'secp256k1' } @@ -101,7 +104,7 @@ export class Crypto { static async sign(opts: SignOptions) { const { did, payload, detached } = opts - const privateKeyJwk = did.keySet.verificationMethodKeys?.[0]?.privateKeyJwk + const privateKeyJwk = did.keySet.verificationMethodKeys?.[0]?.privateKeyJwk as JwkParamsEcPrivate | JwkParamsOkpPrivate const algorithmName = privateKeyJwk?.['alg'] || '' let namedCurve = Crypto.extractNamedCurve(privateKeyJwk) @@ -114,19 +117,17 @@ export class Crypto { let verificationMethodId = did.document.verificationMethod?.[0]?.id || '' if (verificationMethodId.startsWith('#')) { - verificationMethodId = `${did.did}#${verificationMethodId}` + verificationMethodId = `${did.did}${verificationMethodId}` } const jwsHeader: JwsHeader = { alg: algorithm.alg, kid: verificationMethodId } const base64UrlEncodedJwsHeader = Convert.object(jwsHeader).toBase64Url() const base64urlEncodedJwsPayload = Convert.uint8Array(payload).toBase64Url() - const key = await Jose.jwkToCryptoKey({ key: privateKeyJwk as Web5PrivateKeyJwk }) - const toSign = `${base64UrlEncodedJwsHeader}.${base64urlEncodedJwsPayload}` const toSignBytes = Convert.string(toSign).toUint8Array() - const signatureBytes = await algorithm.signer.sign({ key, data: toSignBytes, algorithm: algorithm.options }) + const signatureBytes = await algorithm.signer.sign({ key: privateKeyJwk, data: toSignBytes, algorithm: algorithm.options }) const base64UrlEncodedSignature = Convert.uint8Array(signatureBytes).toBase64Url() if (detached) { @@ -170,13 +171,16 @@ export class Crypto { throw new Error('Signature verification failed: Expected JWS header to contain alg and kid') } - const verificationMethod = await deferenceDidUrl(jwsHeader.kid) + const dereferenceResult = await DidResolver.dereference({ didUrl: jwsHeader.kid }) + + const verificationMethod = dereferenceResult.contentStream as VerificationMethod if (!isVerificationMethod(verificationMethod)) { // ensure that appropriate verification method was found throw new Error('Signature verification failed: Expected kid in JWS header to dereference to a DID Document Verification Method') } // will be used to verify signature - const { publicKeyJwk } = verificationMethod + const publicKeyJwk = verificationMethod.publicKeyJwk as JwkParamsEcPublic | JwkParamsOkpPublic + if (!publicKeyJwk) { // ensure that Verification Method includes public key as a JWK. throw new Error('Signature verification failed: Expected kid in JWS header to dereference to a DID Document Verification Method with publicKeyJwk') } @@ -189,15 +193,7 @@ export class Crypto { const algorithmId = `${jwsHeader['alg']}:${Crypto.extractNamedCurve(publicKeyJwk)}` const { signer, options } = Crypto.algorithms[algorithmId] - // TODO: remove this monkeypatch once 'ext' is no longer a required property within a jwk passed to `jwkToCryptoKey` - const monkeyPatchPublicKeyJwk = { - ...publicKeyJwk, - ext : 'true' as const, - key_ops : ['verify'] - } - - const key = await Jose.jwkToCryptoKey({ key: monkeyPatchPublicKeyJwk }) - const isLegit = await signer.verify({ algorithm: options, key, data: signedDataBytes, signature: signatureBytes }) + const isLegit = await signer.verify({ algorithm: options, key: publicKeyJwk, data: signedDataBytes, signature: signatureBytes }) if (!isLegit) { throw new Error('Signature verification failed: Integrity mismatch') diff --git a/packages/protocol/src/dev-tools.ts b/packages/protocol/src/dev-tools.ts index 285bba12..eb7e089a 100644 --- a/packages/protocol/src/dev-tools.ts +++ b/packages/protocol/src/dev-tools.ts @@ -1,13 +1,9 @@ import type { OfferingData, QuoteData, RfqData } from './types.js' import type { PortableDid } from '@web5/dids' - -import { DidIonMethod, DidKeyMethod } from '@web5/dids' -import { utils as vcUtils } from '@web5/credentials' +import { DidDhtMethod, DidIonMethod, DidKeyMethod } from '@web5/dids' +import { VerifiableCredential } from '@web5/credentials' import { Offering } from './resource-kinds/index.js' -import { Convert } from '@web5/common' -import { Crypto } from './crypto.js' -import { Jose } from '@web5/crypto' import { Rfq } from './message-kinds/index.js' import { Resource } from './resource.js' @@ -69,9 +65,11 @@ export class DevTools { */ static async createDid(didMethod: DidMethodOptions = 'key') { if (didMethod === 'key') { - return DidKeyMethod.create() + return await DidKeyMethod.create() } else if (didMethod === 'ion') { - return DidIonMethod.create() + return await DidIonMethod.create() + } else if (didMethod === 'dht') { + return await DidDhtMethod.create() } else { throw new Error(`${didMethod} method not implemented.`) } @@ -219,9 +217,9 @@ export class DevTools { let credential: any = '' if (opts?.sender) { - const { signedCredential } = await DevTools.createCredential({ + const signedCredential = VerifiableCredential.create({ type : 'YoloCredential', - issuer : opts.sender, + issuer : opts.sender.did, subject : opts.sender.did, data : { 'beep': 'boop' @@ -251,84 +249,4 @@ export class DevTools { claims : [credential] } } - - /** - * creates a verifiable credential using the options provided. This method is intended for testing purposes - * @param opts - options used to create the credential - * @returns - */ - static async createCredential(opts: CreateCredentialOptions) { - const credential = { - '@context' : ['https://www.w3.org/2018/credentials/v1'], - 'id' : Date.now().toString(), - 'type' : ['VerifiableCredential', opts.type], - 'issuer' : opts.issuer.did, - 'issuanceDate' : vcUtils.getCurrentXmlSchema112Timestamp(), - 'credentialSubject' : { id: opts.subject, ...opts.data } - } - - const signedCredential = await DevTools.createJwt({ - issuer : opts.issuer, - subject : credential.credentialSubject.id, - payload : { vc: credential } - }) - - return { credential, signedCredential } - } - - /** - * Creates a JWT using the options provided. - * It's signed with the issuer's first verification method private key JWK - * - * @param opts - options used to create the JWT - * @returns a compact JWT - */ - static async createJwt(opts: CreateJwtOptions) { - const { issuer, subject, payload } = opts - const privateKeyJwk = issuer.keySet.verificationMethodKeys?.[0].privateKeyJwk - if (!privateKeyJwk) { - throw Error('Could not get private key JWK from issuer') - } - - // build jwt header - const algorithmName = privateKeyJwk['alg'] || '' - let namedCurve = Crypto.extractNamedCurve(privateKeyJwk) - const algorithmId = `${algorithmName}:${namedCurve}` - const algorithm = Crypto.algorithms[algorithmId] - const jwtHeader = { alg: algorithm.alg, kid: issuer.document.verificationMethod?.[0]?.id } - const base64urlEncodedJwtHeader = Convert.object(jwtHeader).toBase64Url() - - // build jwt payload - const jwtPayload = { iss: issuer.did, sub: subject, ...payload } - const base64urlEncodedJwtPayload = Convert.object(jwtPayload).toBase64Url() - - // build what will be signed - const toSign = `${base64urlEncodedJwtHeader}.${base64urlEncodedJwtPayload}` - const bytesToSign = Convert.string(toSign).toUint8Array() - - // select signer based on the provided key's named curve - const { signer, options } = algorithm - const signingKey = await Jose.jwkToCryptoKey({ key: privateKeyJwk }) - - // generate signature - const signatureBytes = await signer.sign({ key: signingKey, data: bytesToSign, algorithm: options }) - const base64UrlEncodedSignature = Convert.uint8Array(signatureBytes).toBase64Url() - - return `${base64urlEncodedJwtHeader}.${base64urlEncodedJwtPayload}.${base64UrlEncodedSignature}` - } - - /** - * convenience method that can be used to decode a COMPACT JWT - * @param compactJwt - the JWT to decode - * @returns - */ - static decodeJwt(compactJwt: string) { - const [base64urlEncodedJwtHeader, base64urlEncodedJwtPayload, base64urlEncodedSignature] = compactJwt.split('.') - - return { - header : Convert.base64Url(base64urlEncodedJwtHeader).toObject(), - payload : Convert.base64Url(base64urlEncodedJwtPayload).toObject(), - base64urlEncodedSignature - } - } } \ No newline at end of file diff --git a/packages/protocol/src/did-resolver.ts b/packages/protocol/src/did-resolver.ts index 8ec30fd0..ddb960a7 100644 --- a/packages/protocol/src/did-resolver.ts +++ b/packages/protocol/src/did-resolver.ts @@ -1,6 +1,6 @@ import type { DidDocument, DidService, VerificationMethod } from '@web5/dids' -import { DidResolver as Web5DidResolver, DidKeyMethod, DidIonMethod, DidDhtMethod, utils as didUtils } from '@web5/dids' +import { DidResolver as Web5DidResolver, DidKeyMethod, DidIonMethod, DidDhtMethod } from '@web5/dids' /** * Can be used to resolve did:ion and did:key DIDs @@ -36,58 +36,12 @@ export async function resolveDid(did: string): Promise { */ export type DidResource = DidDocument | VerificationMethod | DidService -// TODO https://github.com/TBD54566975/tbdex-js/issues/147 Remove deferenceDidUrl with web5/dids DidResolver#dereference -/** - * Dereferences a DID URL according to [specification](https://www.w3.org/TR/did-core/#did-url-dereferencing). - * See also: [DID URL Syntax](https://www.w3.org/TR/did-core/#did-url-syntax) - * - * **Note**: Support is limited to did#fragment within [Verification Method](https://www.w3.org/TR/did-core/#verification-methods) - * and [Service](https://www.w3.org/TR/did-core/#services) only - * @param didUrl - the did url to dereference - * @returns the dereferenced resource - * @throws if DID URL cannot be parsed - * @throws if DID cannot be resolved - * @beta - */ -export async function deferenceDidUrl(didUrl: string): Promise { - const parsedDid = didUtils.parseDid({ didUrl }) - if (!parsedDid) { - throw new Error('failed to parse did') - } - - const didDocument = await resolveDid(didUrl) - - // return the entire DID Document if no fragment is present on the did url - if (!parsedDid.fragment) { - return didDocument - } - - const { service, verificationMethod } = didDocument - - // create a set of possible id matches. the DID spec allows for an id to be the entire did#fragment or just #fragment. - // See: https://www.w3.org/TR/did-core/#relative-did-urls - // using a set for fast string comparison. DIDs can be lonnng. - const idSet = new Set([didUrl, parsedDid.fragment, `#${parsedDid.fragment}`]) - - for (let vm of verificationMethod || []) { - if (idSet.has(vm.id)) { - return vm - } - } - - for (let svc of service || []) { - if (idSet.has(svc.id)) { - return svc - } - } -} - /** * type guard for {@link @web5/dids#VerificationMethod} * @param didResource - the resource to check * @returns true if the didResource is a `VerificationMethod` * @beta */ -export function isVerificationMethod(didResource: DidResource | undefined): didResource is VerificationMethod { +export function isVerificationMethod(didResource: DidResource | null): didResource is VerificationMethod { return !!didResource && 'id' in didResource && 'type' in didResource && 'controller' in didResource } \ No newline at end of file diff --git a/packages/protocol/src/message-kinds/rfq.ts b/packages/protocol/src/message-kinds/rfq.ts index 2073a9ab..47f90765 100644 --- a/packages/protocol/src/message-kinds/rfq.ts +++ b/packages/protocol/src/message-kinds/rfq.ts @@ -12,7 +12,7 @@ import Ajv from 'ajv' */ export type CreateRfqOptions = { data: MessageKindModel<'rfq'> - metadata: Omit, 'id' |'kind' | 'createdAt' | 'exchangeId'> + metadata: Omit, 'id' | 'kind' | 'createdAt' | 'exchangeId'> private?: Record } @@ -61,7 +61,7 @@ export class Rfq extends Message<'rfq'> { * @throws if {@link Rfq.payoutMethod} property `paymentDetails` cannot be validated against the provided offering's payoutMethod requiredPaymentDetails */ async verifyOfferingRequirements(offering: Offering | ResourceModel<'offering'>) { - if (offering.metadata.id !== this.offeringId) { + if (offering.metadata.id !== this.offeringId) { throw new Error(`offering id mismatch. (rfq) ${this.offeringId} !== ${offering.metadata.id} (offering)`) } @@ -146,14 +146,14 @@ export class Rfq extends Message<'rfq'> { return } - const credentials = PresentationExchange.selectCredentials(this.claims, offering.data.requiredClaims) + const credentials = PresentationExchange.selectCredentials({ vcJwts: this.claims, presentationDefinition: offering.data.requiredClaims }) if (!credentials.length) { throw new Error(`claims do not fulfill the offering's requirements`) } for (let credential of credentials) { - await VerifiableCredential.verify(credential) + await VerifiableCredential.verify({ vcJwt: credential }) } } diff --git a/packages/protocol/src/resource-kinds/offering.ts b/packages/protocol/src/resource-kinds/offering.ts index 516d53f9..199d9606 100644 --- a/packages/protocol/src/resource-kinds/offering.ts +++ b/packages/protocol/src/resource-kinds/offering.ts @@ -1,6 +1,5 @@ import type { ResourceKindModel, ResourceMetadata } from '../types.js' import { Resource } from '../resource.js' -import type { PresentationDefinitionV2 } from '@web5/credentials' /** * Options passed to {@link Offering.create} @@ -66,9 +65,7 @@ export class Offering extends Resource<'offering'> { } /** Articulates the claim(s) required when submitting an RFQ for this offering. */ - // TODO: Remove type annotation once type alias replaced with direct export in @web5/credentials - // [Link to the PR](https://github.com/TBD54566975/web5-js/pull/336) - get requiredClaims(): PresentationDefinitionV2 | undefined { + get requiredClaims() { return this.data.requiredClaims } } \ No newline at end of file diff --git a/packages/protocol/tests/crypto.spec.ts b/packages/protocol/tests/crypto.spec.ts index 47008aa5..678a1f8c 100644 --- a/packages/protocol/tests/crypto.spec.ts +++ b/packages/protocol/tests/crypto.spec.ts @@ -1,7 +1,7 @@ import { expect } from 'chai' -import { DevTools, Crypto } from '../src/main.js' import { Convert } from '@web5/common' +import { Crypto, DevTools } from '../src/main.js' describe('Crypto', () => { describe('sign / verify', () => { diff --git a/packages/protocol/tests/rfq.spec.ts b/packages/protocol/tests/rfq.spec.ts index 7e2c5a16..2ce8ab03 100644 --- a/packages/protocol/tests/rfq.spec.ts +++ b/packages/protocol/tests/rfq.spec.ts @@ -1,3 +1,4 @@ +import { VerifiableCredential } from '@web5/credentials' import type { CreateRfqOptions, Offering } from '../src/main.js' import { Rfq, DevTools } from '../src/main.js' @@ -142,9 +143,9 @@ describe('Rfq', () => { beforeEach(async () => { const did = await DevTools.createDid() - const { signedCredential } = await DevTools.createCredential({ // this credential fulfills the offering's required claims + const vc = await VerifiableCredential.create({ // this credential fulfills the offering's required claims type : 'SanctionsCredential', - issuer : did, + issuer : did.did, subject : did.did, data : { 'beep': 'boop' @@ -152,6 +153,7 @@ describe('Rfq', () => { }) offering = DevTools.createOffering() + const vcJwt = await vc.sign({ did }) rfqOptions = { metadata: { @@ -164,7 +166,7 @@ describe('Rfq', () => { } } rfqOptions.metadata.from = did.did - rfqOptions.data.claims = [signedCredential] + rfqOptions.data.claims = [vcJwt] }) it('throws an error if offeringId doesn\'t match the provided offering\'s id', async () => { @@ -287,17 +289,19 @@ describe('Rfq', () => { it(`does not throw an exception if an rfq's claims fulfill the provided offering's requirements`, async () => { const did = await DevTools.createDid() const offering = DevTools.createOffering() - const { signedCredential } = await DevTools.createCredential({ // this credential fulfills the offering's required claims + const vc = await VerifiableCredential.create({ // this credential fulfills the offering's required claims type : 'SanctionsCredential', - issuer : did, + issuer : did.did, subject : did.did, data : { 'beep': 'boop' } }) + const vcJwt = await vc.sign({ did }) + const rfqData = await DevTools.createRfqData() - rfqData.claims = [signedCredential] + rfqData.claims = [vcJwt] const rfq = Rfq.create({ metadata : { from: did.did, to: 'did:ex:pfi' }, @@ -310,17 +314,19 @@ describe('Rfq', () => { it(`throws an exception if an rfq's claims dont fulfill the provided offering's requirements`, async () => { const did = await DevTools.createDid() const offering = DevTools.createOffering() - const { signedCredential } = await DevTools.createCredential({ + const vc = await VerifiableCredential.create({ type : 'PuupuuCredential', - issuer : did, + issuer : did.did, subject : did.did, data : { 'beep': 'boop' } }) + const vcJwt = await vc.sign({ did}) + const rfqData = await DevTools.createRfqData() - rfqData.claims = [signedCredential] + rfqData.claims = [vcJwt] const rfq = Rfq.create({ metadata : { from: did.did, to: 'did:ex:pfi' }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 16458550..8dbb4117 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -55,17 +55,26 @@ importers: specifier: workspace:* version: link:../protocol '@web5/common': - specifier: 0.2.1 - version: 0.2.1 - '@web5/crypto': specifier: 0.2.2 version: 0.2.2 + '@web5/credentials': + specifier: 0.4.1 + version: 0.4.1 + '@web5/crypto': + specifier: 0.2.4 + version: 0.2.4 '@web5/dids': - specifier: 0.2.2 - version: 0.2.2 + specifier: 0.2.4 + version: 0.2.4 + ms: + specifier: 2.1.3 + version: 2.1.3 query-string: specifier: 8.1.0 version: 8.1.0 + typeid-js: + specifier: 0.3.0 + version: 0.3.0 devDependencies: '@playwright/test': specifier: 1.34.3 @@ -79,9 +88,12 @@ importers: '@types/mocha': specifier: 10.0.1 version: 10.0.1 + '@types/ms': + specifier: 0.7.34 + version: 0.7.34 '@types/sinon': - specifier: ^17.0.2 - version: 17.0.2 + specifier: 17.0.1 + version: 17.0.1 '@typescript-eslint/eslint-plugin': specifier: 5.59.0 version: 5.59.0(@typescript-eslint/parser@5.59.0)(eslint@8.43.0)(typescript@5.2.2) @@ -134,8 +146,8 @@ importers: specifier: 4.4.0 version: 4.4.0 sinon: - specifier: 15.0.2 - version: 15.0.2 + specifier: 17.0.1 + version: 17.0.1 typedoc: specifier: 0.25.0 version: 0.25.0(typescript@5.2.2) @@ -198,17 +210,17 @@ importers: specifier: 1.3.2 version: 1.3.2 '@web5/common': - specifier: 0.2.1 - version: 0.2.1 - '@web5/credentials': - specifier: 0.3.2 - version: 0.3.2 - '@web5/crypto': specifier: 0.2.2 version: 0.2.2 + '@web5/credentials': + specifier: 0.4.1 + version: 0.4.1 + '@web5/crypto': + specifier: 0.2.4 + version: 0.2.4 '@web5/dids': - specifier: 0.2.2 - version: 0.2.2 + specifier: 0.2.4 + version: 0.2.4 ajv: specifier: 8.12.0 version: 8.12.0 @@ -225,6 +237,9 @@ importers: '@playwright/test': specifier: 1.34.3 version: 1.34.3 + '@types/sinon': + specifier: 17.0.2 + version: 17.0.2 chai: specifier: 4.3.10 version: 4.3.10 @@ -268,8 +283,8 @@ importers: specifier: 4.4.0 version: 4.4.0 sinon: - specifier: 15.0.2 - version: 15.0.2 + specifier: 17.0.1 + version: 17.0.1 typedoc: specifier: 0.25.0 version: 0.25.0(typescript@5.2.2) @@ -957,10 +972,6 @@ packages: fsevents: 2.3.2 dev: true - /@scure/base@1.1.3: - resolution: {integrity: sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==} - dev: false - /@sinonjs/commons@2.0.0: resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} dependencies: @@ -979,8 +990,14 @@ packages: '@sinonjs/commons': 3.0.0 dev: true - /@sinonjs/samsam@7.0.1: - resolution: {integrity: sha512-zsAk2Jkiq89mhZovB2LLOdTCxJF4hqqTToGP0ASWlhp4I1hqOjcfmZGafXntCN7MDC6yySH0mFHrYtHceOeLmw==} + /@sinonjs/fake-timers@11.2.2: + resolution: {integrity: sha512-G2piCSxQ7oWOxwGSAyFHfPIsyeJGXYtc6mFbnFA+kRXkiEnTl8c/8jul2S329iFBnDI9HGoeWWAZvuvOkZccgw==} + dependencies: + '@sinonjs/commons': 3.0.0 + dev: true + + /@sinonjs/samsam@8.0.0: + resolution: {integrity: sha512-Bp8KUVlLp8ibJZrnvq2foVhP0IVX2CIprMJPK0vqGqgrDa0OHVKeZyBykqskkrdxV6yKBPmGasO8LVjAKR3Gew==} dependencies: '@sinonjs/commons': 2.0.0 lodash.get: 4.4.2 @@ -1116,6 +1133,10 @@ packages: resolution: {integrity: sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==} dev: true + /@types/ms@0.7.34: + resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} + dev: true + /@types/node@12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true @@ -1157,6 +1178,12 @@ packages: '@types/node': 20.9.4 dev: true + /@types/sinon@17.0.1: + resolution: {integrity: sha512-Q2Go6TJetYn5Za1+RJA1Aik61Oa2FS8SuJ0juIqUuJ5dZR4wvhKfmSdIqWtQ3P6gljKWjW0/R7FZkA4oXVL6OA==} + dependencies: + '@types/sinonjs__fake-timers': 8.1.5 + dev: true + /@types/sinon@17.0.2: resolution: {integrity: sha512-Zt6heIGsdqERkxctIpvN5Pv3edgBrhoeb3yHyxffd4InN0AX2SVNKSrhdDZKGQICVOxWP/q4DyhpfPNMSrpIiA==} dependencies: @@ -1436,13 +1463,26 @@ packages: multiformats: 11.0.2 dev: false - /@web5/credentials@0.3.2: - resolution: {integrity: sha512-hxLJfmOngglgHvIzVtxlKYFHn2atnxhH6RZCCruoHGCNVEVcKG5wXZl6D4FJ/BMlIr8SwUg8RW/I0ns0O31vqw==} + /@web5/common@0.2.2: + resolution: {integrity: sha512-dRn6SmALExeTLMTK/W5ozGarfaddK+Lraf5OjuIGLAaLfcX1RWx3oDMoY5Hr9LjfxHJC8mGXB8DnKflbeYJRgA==} + engines: {node: '>=18.0.0'} + dependencies: + level: 8.0.0 + multiformats: 11.0.2 + readable-stream: 4.4.2 + dev: false + + /@web5/credentials@0.4.1: + resolution: {integrity: sha512-GMbS/N9AqAURjH6+Mvo49AJJxe9uli5mU+dzXtGgFJhiwD4FfqRPxdO1C3R0Tj2aCY3OAQVcCKQgmLRm2hHZlw==} engines: {node: '>=18.0.0'} dependencies: '@sphereon/pex': 2.1.0 - did-jwt: 7.4.5 - uuid: 9.0.1 + '@web5/common': 0.2.2 + '@web5/crypto': 0.2.4 + '@web5/dids': 0.2.4 + transitivePeerDependencies: + - encoding + - supports-color dev: false /@web5/crypto@0.2.2: @@ -1455,6 +1495,16 @@ packages: '@web5/common': 0.2.1 dev: false + /@web5/crypto@0.2.4: + resolution: {integrity: sha512-heRUuV10mZ04dWp1C2mNF/EEPw8nnRe+yAXvmclJ+4XUHL6+mY7j+hjYOTKUAQzd4ouvbHrpJM0uYcUntA3AeA==} + engines: {node: '>=18.0.0'} + dependencies: + '@noble/ciphers': 0.4.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + '@web5/common': 0.2.2 + dev: false + /@web5/dids@0.2.2: resolution: {integrity: sha512-dARcpQIMzmayINWFemxP+shhfHLtYB+ZXoSZ1TKKnjF7qzraL30KwBSDwaNEPYaAzgo0x/1rvyv+zAgfa5MeNw==} engines: {node: '>=18.0.0'} @@ -1474,6 +1524,32 @@ packages: - supports-color dev: false + /@web5/dids@0.2.4: + resolution: {integrity: sha512-e+m+xgpiM8ydTJgWcPdwmjILLMZYdl2kwahlO22mK0azSKVrg1klpGrUODzqkrWrQ5O0tnOyqEy39FcD5Sy11w==} + engines: {node: '>=18.0.0'} + dependencies: + '@decentralized-identity/ion-pow-sdk': 1.0.17 + '@decentralized-identity/ion-sdk': 1.0.1 + '@web5/common': 0.2.2 + '@web5/crypto': 0.2.2 + did-resolver: 4.1.0 + dns-packet: 5.6.1 + level: 8.0.0 + ms: 2.1.3 + pkarr: 1.1.1 + z32: 1.0.1 + transitivePeerDependencies: + - encoding + - supports-color + dev: false + + /abort-controller@3.0.0: + resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} + engines: {node: '>=6.5'} + dependencies: + event-target-shim: 5.0.1 + dev: false + /abstract-level@1.0.3: resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} engines: {node: '>=12'} @@ -2458,20 +2534,6 @@ packages: resolution: {integrity: sha512-uJaamHkagcZtHPqCIHZxnFrXlunQXgBOsZSUOWwFw31QJCAbyTBoHMW75YOTur5ZNx8pIeAKgf6GWIgaqqiLhA==} dev: true - /did-jwt@7.4.5: - resolution: {integrity: sha512-PjUFy/yhYeivNrQI5EaqYvF+cRL0itARQlXPfAnUUcj4tm40fzCU/0yWkhAoAPfM41e8O+QVRqOXwg0cZjlVeg==} - dependencies: - '@noble/ciphers': 0.4.0 - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.2 - '@scure/base': 1.1.3 - canonicalize: 2.0.0 - did-resolver: 4.1.0 - multibase: 4.0.6 - multiformats: 9.9.0 - uint8arrays: 3.1.1 - dev: false - /did-resolver@4.1.0: resolution: {integrity: sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA==} dev: false @@ -2895,6 +2957,11 @@ packages: engines: {node: '>= 0.6'} dev: false + /event-target-shim@5.0.1: + resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} + engines: {node: '>=6'} + dev: false + /eventemitter3@4.0.7: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: true @@ -2902,7 +2969,6 @@ packages: /events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - dev: true /evp_bytestokey@1.0.3: resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} @@ -4855,7 +4921,6 @@ packages: /process@0.11.10: resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} engines: {node: '>= 0.6.0'} - dev: true /promise-inflight@1.0.1: resolution: {integrity: sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==} @@ -5019,6 +5084,17 @@ packages: util-deprecate: 1.0.2 dev: true + /readable-stream@4.4.2: + resolution: {integrity: sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + abort-controller: 3.0.0 + buffer: 6.0.3 + events: 3.3.0 + process: 0.11.10 + string_decoder: 1.3.0 + dev: false + /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -5346,13 +5422,12 @@ packages: engines: {node: '>=14'} dev: true - /sinon@15.0.2: - resolution: {integrity: sha512-PCVP63XZkg0/LOqQH5rEU4LILuvTFMb5tNxTHfs6VUMNnZz2XrnGSTZbAGITjzwQWbl/Bl/8hi4G3zZWjyBwHg==} - deprecated: 16.1.1 + /sinon@17.0.1: + resolution: {integrity: sha512-wmwE19Lie0MLT+ZYNpDymasPHUKTaZHUH/pKEubRXIzySv9Atnlw+BUMGCzWgV7b7wO+Hw6f1TEOr0IUnmU8/g==} dependencies: '@sinonjs/commons': 3.0.0 - '@sinonjs/fake-timers': 10.3.0 - '@sinonjs/samsam': 7.0.1 + '@sinonjs/fake-timers': 11.2.2 + '@sinonjs/samsam': 8.0.0 diff: 5.1.0 nise: 5.1.5 supports-color: 7.2.0 @@ -5599,7 +5674,6 @@ packages: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} dependencies: safe-buffer: 5.2.1 - dev: true /strip-ansi@4.0.0: resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} @@ -5989,6 +6063,7 @@ packages: /uuid@9.0.1: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true + dev: true /uuidv7@0.4.4: resolution: {integrity: sha512-jjRGChg03uGp9f6wQYSO8qXkweJwRbA5WRuEQE8xLIiehIzIIi23qZSzsyvZPCPoFqkeLtZuz7Plt1LGukAInA==}