From 99dc87d3748cb1f71aa67237b28b6c4bb667eb29 Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Fri, 5 Jan 2024 12:55:32 +0100 Subject: [PATCH 1/5] feat: Add deferred support --- packages/client/lib/AccessTokenClient.ts | 2 +- .../client/lib/CredentialRequestClient.ts | 71 +++++++++++++-- .../lib/CredentialRequestClientBuilder.ts | 39 ++++++-- packages/client/lib/MetadataClient.ts | 14 ++- packages/client/lib/OpenID4VCIClient.ts | 12 +++ .../client/lib/__tests__/EBSIE2E.spec.test.ts | 11 ++- .../lib/__tests__/MetadataClient.spec.ts | 3 +- .../lib/functions/CredentialResponseUtil.ts | 90 +++++++++++++++++++ packages/common/lib/functions/index.ts | 1 + .../lib/types/CredentialIssuance.types.ts | 3 +- packages/common/lib/types/ServerMetadata.ts | 2 + 11 files changed, 228 insertions(+), 20 deletions(-) create mode 100644 packages/common/lib/functions/CredentialResponseUtil.ts diff --git a/packages/client/lib/AccessTokenClient.ts b/packages/client/lib/AccessTokenClient.ts index 47fb7a39..d085089d 100644 --- a/packages/client/lib/AccessTokenClient.ts +++ b/packages/client/lib/AccessTokenClient.ts @@ -195,7 +195,7 @@ export class AccessTokenClient { this.assertNonEmptyCode(accessTokenRequest); this.assertNonEmptyRedirectUri(accessTokenRequest); } else { - this.throwNotSupportedFlow; + this.throwNotSupportedFlow(); } } diff --git a/packages/client/lib/CredentialRequestClient.ts b/packages/client/lib/CredentialRequestClient.ts index fe2966c7..5d2f7afd 100644 --- a/packages/client/lib/CredentialRequestClient.ts +++ b/packages/client/lib/CredentialRequestClient.ts @@ -1,7 +1,9 @@ import { + acquireDeferredCredential, CredentialResponse, getCredentialRequestForVersion, getUniformFormat, + isDeferredCredentialResponse, OID4VCICredentialFormat, OpenId4VCIVersion, OpenIDResponse, @@ -19,7 +21,10 @@ import { isValidURL, post } from './functions'; const debug = Debug('sphereon:oid4vci:credential'); export interface CredentialRequestOpts { + deferredCredentialAwait?: boolean; + deferredCredentialIntervalInMS?: number; credentialEndpoint: string; + deferredCredentialEndpoint?: string; credentialTypes: string[]; format?: CredentialFormat | OID4VCICredentialFormat; proof: ProofOfPossession; @@ -27,17 +32,46 @@ export interface CredentialRequestOpts { version: OpenId4VCIVersion; } +export async function buildProof( + proofInput: ProofOfPossessionBuilder | ProofOfPossession, + opts: { + version: OpenId4VCIVersion; + cNonce?: string; + }, +) { + if ('proof_type' in proofInput) { + if (opts.cNonce) { + throw Error(`Cnonce param is only supported when using a Proof of Posession builder`); + //decodeJwt(proofInput.jwt). + } + return await ProofOfPossessionBuilder.fromProof(proofInput as ProofOfPossession, opts.version).build(); + } + if (opts.cNonce) { + proofInput.withAccessTokenNonce(opts.cNonce); + } + return await proofInput.build(); +} + export class CredentialRequestClient { private readonly _credentialRequestOpts: Partial; + private _isDeferred = false; get credentialRequestOpts(): CredentialRequestOpts { return this._credentialRequestOpts as CredentialRequestOpts; } + public isDeferred(): boolean { + return this._isDeferred; + } + public getCredentialEndpoint(): string { return this.credentialRequestOpts.credentialEndpoint; } + public getDeferredCredentialEndpoint(): string | undefined { + return this.credentialRequestOpts.deferredCredentialEndpoint; + } + public constructor(builder: CredentialRequestClientBuilder) { this._credentialRequestOpts = { ...builder }; } @@ -63,11 +97,40 @@ export class CredentialRequestClient { debug(`Acquiring credential(s) from: ${credentialEndpoint}`); debug(`request\n: ${JSON.stringify(request, null, 2)}`); const requestToken: string = this.credentialRequestOpts.token; - const response: OpenIDResponse = await post(credentialEndpoint, JSON.stringify(request), { bearerToken: requestToken }); + let response: OpenIDResponse = await post(credentialEndpoint, JSON.stringify(request), { bearerToken: requestToken }); + this._isDeferred = isDeferredCredentialResponse(response); + if (this.isDeferred() && this.credentialRequestOpts.deferredCredentialAwait && response.successBody) { + response = await this.acquireDeferredCredential(response.successBody, { bearerToken: this.credentialRequestOpts.token }); + } + debug(`Credential endpoint ${credentialEndpoint} response:\r\n${JSON.stringify(response, null, 2)}`); return response; } + public async acquireDeferredCredential( + response: Pick, + opts?: { + bearerToken?: string; + }, + ): Promise> { + const transactionId = response.transaction_id; + const bearerToken = response.acceptance_token ?? opts?.bearerToken; + const deferredCredentialEndpoint = this.getDeferredCredentialEndpoint(); + if (!deferredCredentialEndpoint) { + throw Error(`No deferred credential endpoint supplied.`); + } else if (!bearerToken) { + throw Error(`No bearer token present and refresh for defered endpoint not supported yet`); + // todo updated bearer token with new c_nonce + } + return await acquireDeferredCredential({ + bearerToken, + transactionId, + deferredCredentialEndpoint, + deferredCredentialAwait: this.credentialRequestOpts.deferredCredentialAwait, + deferredCredentialIntervalInMS: this.credentialRequestOpts.deferredCredentialIntervalInMS, + }); + } + public async createCredentialRequest(opts: { proofInput: ProofOfPossessionBuilder | ProofOfPossession; credentialTypes?: string | string[]; @@ -93,11 +156,7 @@ export class CredentialRequestClient { else if (!this.isV11OrHigher() && types.length !== 1) { throw Error('Only a single credential type is supported for V8/V9'); } - - const proof = - 'proof_type' in proofInput - ? await ProofOfPossessionBuilder.fromProof(proofInput as ProofOfPossession, opts.version).build() - : await proofInput.build(); + const proof = await buildProof(proofInput, opts); // TODO: we should move format specific logic if (format === 'jwt_vc_json' || format === 'jwt_vc') { diff --git a/packages/client/lib/CredentialRequestClientBuilder.ts b/packages/client/lib/CredentialRequestClientBuilder.ts index 8d953825..a73205df 100644 --- a/packages/client/lib/CredentialRequestClientBuilder.ts +++ b/packages/client/lib/CredentialRequestClientBuilder.ts @@ -18,6 +18,9 @@ import { CredentialRequestClient } from './CredentialRequestClient'; export class CredentialRequestClientBuilder { credentialEndpoint?: string; + deferredCredentialEndpoint?: string; + deferredCredentialAwait = false; + deferredCredentialIntervalInMS = 5000; credentialTypes: string[] = []; format?: CredentialFormat | OID4VCICredentialFormat; token?: string; @@ -38,6 +41,9 @@ export class CredentialRequestClientBuilder { const builder = new CredentialRequestClientBuilder(); builder.withVersion(version ?? OpenId4VCIVersion.VER_1_0_11); builder.withCredentialEndpoint(metadata?.credential_endpoint ?? (issuer.endsWith('/') ? `${issuer}credential` : `${issuer}/credential`)); + if (metadata?.deferred_credential_endpoint) { + builder.withDeferredCredentialEndpoint(metadata.deferred_credential_endpoint); + } builder.withCredentialType(credentialTypes); return builder; } @@ -60,6 +66,9 @@ export class CredentialRequestClientBuilder { const issuer = getIssuerFromCredentialOfferPayload(request.credential_offer) ?? (metadata?.issuer as string); builder.withVersion(version); builder.withCredentialEndpoint(metadata?.credential_endpoint ?? (issuer.endsWith('/') ? `${issuer}credential` : `${issuer}/credential`)); + if (metadata?.deferred_credential_endpoint) { + builder.withDeferredCredentialEndpoint(metadata.deferred_credential_endpoint); + } if (version <= OpenId4VCIVersion.VER_1_0_08) { //todo: This basically sets all types available during initiation. Probably the user only wants a subset. So do we want to do this? @@ -86,37 +95,53 @@ export class CredentialRequestClientBuilder { }); } - public withCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadata): CredentialRequestClientBuilder { + public withCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadata): this { this.credentialEndpoint = metadata.credential_endpoint; return this; } - public withCredentialEndpoint(credentialEndpoint: string): CredentialRequestClientBuilder { + public withCredentialEndpoint(credentialEndpoint: string): this { this.credentialEndpoint = credentialEndpoint; return this; } - public withCredentialType(credentialTypes: string | string[]): CredentialRequestClientBuilder { + public withDeferredCredentialEndpointFromMetadata(metadata: CredentialIssuerMetadata): this { + this.deferredCredentialEndpoint = metadata.deferred_credential_endpoint; + return this; + } + + public withDeferredCredentialEndpoint(deferredCredentialEndpoint: string): this { + this.deferredCredentialEndpoint = deferredCredentialEndpoint; + return this; + } + + public withDeferredCredentialAwait(deferredCredentialAwait: boolean, deferredCredentialIntervalInMS?: number): this { + this.deferredCredentialAwait = deferredCredentialAwait; + this.deferredCredentialIntervalInMS = deferredCredentialIntervalInMS ?? 5000; + return this; + } + + public withCredentialType(credentialTypes: string | string[]): this { this.credentialTypes = Array.isArray(credentialTypes) ? credentialTypes : [credentialTypes]; return this; } - public withFormat(format: CredentialFormat | OID4VCICredentialFormat): CredentialRequestClientBuilder { + public withFormat(format: CredentialFormat | OID4VCICredentialFormat): this { this.format = format; return this; } - public withToken(accessToken: string): CredentialRequestClientBuilder { + public withToken(accessToken: string): this { this.token = accessToken; return this; } - public withTokenFromResponse(response: AccessTokenResponse): CredentialRequestClientBuilder { + public withTokenFromResponse(response: AccessTokenResponse): this { this.token = response.access_token; return this; } - public withVersion(version: OpenId4VCIVersion): CredentialRequestClientBuilder { + public withVersion(version: OpenId4VCIVersion): this { this.version = version; return this; } diff --git a/packages/client/lib/MetadataClient.ts b/packages/client/lib/MetadataClient.ts index 7679d207..1e58786e 100644 --- a/packages/client/lib/MetadataClient.ts +++ b/packages/client/lib/MetadataClient.ts @@ -45,6 +45,7 @@ export class MetadataClient { public static async retrieveAllMetadata(issuer: string, opts?: { errorOnNotFound: boolean }): Promise { let token_endpoint: string | undefined; let credential_endpoint: string | undefined; + let deferred_credential_endpoint: string | undefined; let authorization_endpoint: string | undefined; let authorizationServerType: AuthorizationServerType = 'OID4VCI'; let authorization_server: string = issuer; @@ -53,6 +54,7 @@ export class MetadataClient { if (credentialIssuerMetadata) { debug(`Issuer ${issuer} OID4VCI well-known server metadata\r\n${JSON.stringify(credentialIssuerMetadata)}`); credential_endpoint = credentialIssuerMetadata.credential_endpoint; + deferred_credential_endpoint = credentialIssuerMetadata.deferred_credential_endpoint; if (credentialIssuerMetadata.token_endpoint) { token_endpoint = credentialIssuerMetadata.token_endpoint; } @@ -111,12 +113,21 @@ export class MetadataClient { if (authMetadata.credential_endpoint) { if (credential_endpoint && authMetadata.credential_endpoint !== credential_endpoint) { debug( - `Credential issuer has a different credential_endpoint (${credential_endpoint}) from the Authorization Server (${authMetadata.token_endpoint}). Will use the issuer value`, + `Credential issuer has a different credential_endpoint (${credential_endpoint}) from the Authorization Server (${authMetadata.credential_endpoint}). Will use the issuer value`, ); } else { credential_endpoint = authMetadata.credential_endpoint; } } + if (authMetadata.deferred_credential_endpoint) { + if (deferred_credential_endpoint && authMetadata.deferred_credential_endpoint !== deferred_credential_endpoint) { + debug( + `Credential issuer has a different deferred_credential_endpoint (${deferred_credential_endpoint}) from the Authorization Server (${authMetadata.deferred_credential_endpoint}). Will use the issuer value`, + ); + } else { + deferred_credential_endpoint = authMetadata.deferred_credential_endpoint; + } + } } if (!authorization_endpoint) { @@ -148,6 +159,7 @@ export class MetadataClient { issuer, token_endpoint, credential_endpoint, + deferred_credential_endpoint, authorization_server, authorization_endpoint, authorizationServerType, diff --git a/packages/client/lib/OpenID4VCIClient.ts b/packages/client/lib/OpenID4VCIClient.ts index 2d7a8698..ce244aea 100644 --- a/packages/client/lib/OpenID4VCIClient.ts +++ b/packages/client/lib/OpenID4VCIClient.ts @@ -354,6 +354,8 @@ export class OpenID4VCIClient { kid, alg, jti, + deferredCredentialAwait, + deferredCredentialIntervalInMS, }: { credentialTypes: string | string[]; proofCallbacks: ProofOfPossessionCallbacks; @@ -361,6 +363,8 @@ export class OpenID4VCIClient { kid?: string; alg?: Alg | string; jti?: string; + deferredCredentialAwait?: boolean; + deferredCredentialIntervalInMS?: number; }): Promise { if (alg) { this._alg = alg; @@ -382,6 +386,7 @@ export class OpenID4VCIClient { }); requestBuilder.withTokenFromResponse(this.accessTokenResponse); + requestBuilder.withDeferredCredentialAwait(deferredCredentialAwait ?? false, deferredCredentialIntervalInMS); if (this.endpointMetadata?.credentialIssuerMetadata) { const metadata = this.endpointMetadata.credentialIssuerMetadata; const types = Array.isArray(credentialTypes) ? [...credentialTypes].sort() : [credentialTypes]; @@ -550,6 +555,13 @@ export class OpenID4VCIClient { return this.endpointMetadata ? this.endpointMetadata.credential_endpoint : `${this.getIssuer()}/credential`; } + public hasDeferredCredentialEndpoint(): boolean { + return !!this.getAccessTokenEndpoint(); + } + public getDeferredCredentialEndpoint(): string { + this.assertIssuerData(); + return this.endpointMetadata ? this.endpointMetadata.credential_endpoint : `${this.getIssuer()}/credential`; + } private assertIssuerData(): void { if (!this._credentialOffer && this.issuerSupportedFlowTypes().includes(AuthzFlowType.PRE_AUTHORIZED_CODE_FLOW)) { throw Error(`No issuance initiation or credential offer present`); diff --git a/packages/client/lib/__tests__/EBSIE2E.spec.test.ts b/packages/client/lib/__tests__/EBSIE2E.spec.test.ts index 400b2d1e..1d32a9dd 100644 --- a/packages/client/lib/__tests__/EBSIE2E.spec.test.ts +++ b/packages/client/lib/__tests__/EBSIE2E.spec.test.ts @@ -53,7 +53,7 @@ const kid = `${DID}#z2dmzD81cgPx8Vki7JbuuMmFYrWPgYoytykUZ3eyqht1j9Kbrm54tL4pRrDD // const jw = jose.importKey() describe('OID4VCI-Client using Sphereon issuer should', () => { - async function test(credentialType: 'CTWalletCrossPreAuthorisedInTime' | 'CTWalletCrossAuthorisedInTime') { + async function test(credentialType: 'CTWalletCrossPreAuthorisedInTime' | 'CTWalletCrossPreAuthorisedDeferred' | 'CTWalletCrossAuthorisedInTime') { debug.enable('*'); const offer = await getCredentialOffer(credentialType); const client = await OpenID4VCIClient.fromURI({ @@ -93,6 +93,8 @@ describe('OID4VCI-Client using Sphereon issuer should', () => { signCallback: proofOfPossessionCallbackFunction, }, kid, + deferredCredentialAwait: true, + deferredCredentialIntervalInMS: 5000, }); console.log(JSON.stringify(credentialResponse, null, 2)); expect(credentialResponse.credential).toBeDefined(); @@ -102,17 +104,20 @@ describe('OID4VCI-Client using Sphereon issuer should', () => { // Current conformance tests is not stable as changes are being applied it seems - it.skip( + it( 'succeed in a full flow with the client using OpenID4VCI version 11 and jwt_vc_json', async () => { await test('CTWalletCrossPreAuthorisedInTime'); + await test('CTWalletCrossPreAuthorisedDeferred'); // await test('CTWalletCrossAuthorisedInTime'); }, UNIT_TEST_TIMEOUT, ); }); -async function getCredentialOffer(credentialType: 'CTWalletCrossPreAuthorisedInTime' | 'CTWalletCrossAuthorisedInTime'): Promise { +async function getCredentialOffer( + credentialType: 'CTWalletCrossPreAuthorisedInTime' | 'CTWalletCrossAuthorisedInTime' | 'CTWalletCrossPreAuthorisedDeferred', +): Promise { const credentialOffer = await fetch( `https://conformance-test.ebsi.eu/conformance/v3/issuer-mock/initiate-credential-offer?credential_type=${credentialType}&client_id=${DID_URL_ENCODED}&credential_offer_endpoint=openid-credential-offer%3A%2F%2F`, { diff --git a/packages/client/lib/__tests__/MetadataClient.spec.ts b/packages/client/lib/__tests__/MetadataClient.spec.ts index e278a525..46b4910f 100644 --- a/packages/client/lib/__tests__/MetadataClient.spec.ts +++ b/packages/client/lib/__tests__/MetadataClient.spec.ts @@ -211,7 +211,8 @@ describe('Metadataclient with Walt-id should', () => { }); }); -describe('Metadataclient with SpruceId should', () => { +// Spruce gives back 404's these days, so test is disabled +describe.skip('Metadataclient with SpruceId should', () => { beforeAll(() => { nock.cleanAll(); }); diff --git a/packages/common/lib/functions/CredentialResponseUtil.ts b/packages/common/lib/functions/CredentialResponseUtil.ts new file mode 100644 index 00000000..8574f2a8 --- /dev/null +++ b/packages/common/lib/functions/CredentialResponseUtil.ts @@ -0,0 +1,90 @@ +import { CredentialResponse, OpenIDResponse } from '../types'; + +import { post } from './HttpUtils'; + +export function isDeferredCredentialResponse(credentialResponse: OpenIDResponse) { + const orig = credentialResponse.successBody; + // Specs mention 202, but some implementations like EBSI return 200 + return credentialResponse.origResponse.status % 200 <= 2 && !!orig && !orig.credential && (!!orig.acceptance_token || !!orig.transaction_id); +} +function assertNonFatalError(credentialResponse: OpenIDResponse) { + if (credentialResponse.origResponse.status === 400 && credentialResponse.errorBody?.error) { + if (credentialResponse.errorBody.error === 'invalid_transaction_id' || credentialResponse.errorBody.error.includes('acceptance_token')) { + throw Error('Invalid transaction id. Probably the deferred credential request expired'); + } + } +} + +export function isDeferredCredentialIssuancePending(credentialResponse: OpenIDResponse) { + if (isDeferredCredentialResponse(credentialResponse)) { + return !!credentialResponse?.successBody?.transaction_id ?? !!credentialResponse?.successBody?.acceptance_token; + } + if (credentialResponse.origResponse.status === 400 && credentialResponse.errorBody?.error) { + if (credentialResponse.errorBody.error === 'issuance_pending') { + return true; + } else if (credentialResponse.errorBody.error_description?.toLowerCase().includes('not available yet')) { + return true; + } + } + return false; +} + +function sleep(ms: number) { + return new Promise((resolve) => { + setTimeout(resolve, ms); + }); +} + +export async function acquireDeferredCredential({ + bearerToken, + transactionId, + deferredCredentialEndpoint, + deferredCredentialIntervalInMS, + deferredCredentialAwait, +}: { + bearerToken: string; + transactionId?: string; + deferredCredentialIntervalInMS?: number; + deferredCredentialAwait?: boolean; + deferredCredentialEndpoint: string; +}): Promise> { + let credentialResponse: OpenIDResponse = await acquireDeferredCredentialImpl({ + bearerToken, + transactionId, + deferredCredentialEndpoint, + }); + + const DEFAULT_SLEEP_IN_MS = 5000; + while (!credentialResponse.successBody?.credential && deferredCredentialAwait) { + assertNonFatalError(credentialResponse); + const pending = isDeferredCredentialIssuancePending(credentialResponse); + console.log(`Issuance still pending?: ${pending}`); + if (!pending) { + throw Error(`Issuance isn't pending anymore: ${credentialResponse}`); + } + + await sleep(deferredCredentialIntervalInMS ?? DEFAULT_SLEEP_IN_MS); + credentialResponse = await acquireDeferredCredentialImpl({ bearerToken, transactionId, deferredCredentialEndpoint }); + } + return credentialResponse; +} + +async function acquireDeferredCredentialImpl({ + bearerToken, + transactionId, + deferredCredentialEndpoint, +}: { + bearerToken: string; + transactionId?: string; + deferredCredentialEndpoint: string; +}): Promise> { + const response: OpenIDResponse = await post( + deferredCredentialEndpoint, + JSON.stringify(transactionId ? { transaction_id: transactionId } : ''), + { bearerToken }, + ); + console.log(JSON.stringify(response, null, 2)); + assertNonFatalError(response); + + return response; +} diff --git a/packages/common/lib/functions/index.ts b/packages/common/lib/functions/index.ts index 83f69014..92b097fa 100644 --- a/packages/common/lib/functions/index.ts +++ b/packages/common/lib/functions/index.ts @@ -1,4 +1,5 @@ export * from './CredentialRequestUtil'; +export * from './CredentialResponseUtil'; export * from './CredentialOfferUtil'; export * from './Encoding'; export * from './TypeConversionUtils'; diff --git a/packages/common/lib/types/CredentialIssuance.types.ts b/packages/common/lib/types/CredentialIssuance.types.ts index bf43a4cf..97bc51f6 100644 --- a/packages/common/lib/types/CredentialIssuance.types.ts +++ b/packages/common/lib/types/CredentialIssuance.types.ts @@ -10,7 +10,8 @@ import { CredentialOfferPayloadV1_0_11, CredentialOfferV1_0_11 } from './v1_0_11 export interface CredentialResponse { credential?: W3CVerifiableCredential; // OPTIONAL. Contains issued Credential. MUST be present when acceptance_token is not returned. MAY be a JSON string or a JSON object, depending on the Credential format. See Appendix E for the Credential format specific encoding requirements format: OID4VCICredentialFormat /* | OID4VCICredentialFormat[]*/; // REQUIRED. JSON string denoting the format of the issued Credential - acceptance_token?: string; // OPTIONAL. A JSON string containing a security token subsequently used to obtain a Credential. MUST be present when credential is not returned + transaction_id?: string; //OPTIONAL. A string identifying a Deferred Issuance transaction. This claim is contained in the response if the Credential Issuer was unable to immediately issue the credential. The value is subsequently used to obtain the respective Credential with the Deferred Credential Endpoint (see Section 9). It MUST be present when the credential parameter is not returned. It MUST be invalidated after the credential for which it was meant has been obtained by the Wallet. + acceptance_token?: string; //deprecated // OPTIONAL. A JSON string containing a security token subsequently used to obtain a Credential. MUST be present when credential is not returned c_nonce?: string; // OPTIONAL. JSON string containing a nonce to be used to create a proof of possession of key material when requesting a Credential (see Section 7.2). When received, the Wallet MUST use this nonce value for its subsequent credential requests until the Credential Issuer provides a fresh nonce c_nonce_expires_in?: number; // OPTIONAL. JSON integer denoting the lifetime in seconds of the c_nonce } diff --git a/packages/common/lib/types/ServerMetadata.ts b/packages/common/lib/types/ServerMetadata.ts index b2e01d3e..190b0031 100644 --- a/packages/common/lib/types/ServerMetadata.ts +++ b/packages/common/lib/types/ServerMetadata.ts @@ -49,6 +49,7 @@ export interface AuthorizationServerMetadata { // VCI values. In case an AS provides a credential_endpoint itself credential_endpoint?: string; + deferred_credential_endpoint?: string; // eslint-disable-next-line @typescript-eslint/no-explicit-any [x: string]: any; //We use any, so you can access properties if you know the structure @@ -66,6 +67,7 @@ export interface EndpointMetadata { issuer: string; token_endpoint: string; credential_endpoint: string; + deferred_credential_endpoint?: string; authorization_server?: string; authorization_endpoint?: string; // Can be undefined in pre-auth flow } From 5bfdb413d3be6a92403e050b37e0af0519e7d345 Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Wed, 10 Jan 2024 13:55:03 +0100 Subject: [PATCH 2/5] chore: update lock file --- pnpm-lock.yaml | 413 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 406 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ffc1e70b..daa77d7b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,9 +127,15 @@ importers: specifier: ^4.3.4 version: 4.3.4 devDependencies: + '@sphereon/ssi-sdk-ext.key-utils': + specifier: ^0.15.1-next.7 + version: 0.15.1-unstable.11(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1) '@transmute/did-key.js': specifier: ^0.3.0-unstable.10 version: 0.3.0-unstable.10 + '@trust/keyto': + specifier: ^2.0.0-alpha1 + version: 2.0.0-alpha1 '@types/jest': specifier: ^29.5.3 version: 29.5.5 @@ -1969,6 +1975,23 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true + /@ethersproject/bytes@5.7.0: + resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} + dependencies: + '@ethersproject/logger': 5.7.0 + dev: true + + /@ethersproject/logger@5.7.0: + resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} + dev: true + + /@ethersproject/random@5.7.0: + resolution: {integrity: sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==} + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/logger': 5.7.0 + dev: true + /@expo/bunyan@4.0.0: resolution: {integrity: sha512-Ydf4LidRB/EBI+YrB+cVLqIseiRfjUI/AeHBgjGMtq3GroraDu81OV7zqophRgupngoL3iS3JUMDMnxO7g39qA==} engines: {'0': node >=0.10.0} @@ -2770,10 +2793,29 @@ packages: dev: true optional: true + /@multiformats/base-x@4.0.1: + resolution: {integrity: sha512-eMk0b9ReBbV23xXU693TAIrLyeO5iTgBZGSJfpqriG8UkYvr/hC9u9pyMlAakDNHWmbhMZCDs6KQO0jzKD8OTw==} + dev: true + + /@noble/ciphers@0.4.1: + resolution: {integrity: sha512-QCOA9cgf3Rc33owG0AYBB9wszz+Ul2kramWN8tXG44Gyciud/tbkEqvxRF/IpqQaBpRBNi9f4jdNxqB2CQCIXg==} + dev: true + + /@noble/curves@1.3.0: + resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} + dependencies: + '@noble/hashes': 1.3.3 + dev: true + /@noble/ed25519@1.7.3: resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} dev: false + /@noble/hashes@1.3.3: + resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} + engines: {node: '>= 16'} + dev: true + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -3349,6 +3391,10 @@ packages: /@react-native/polyfills@2.0.0: resolution: {integrity: sha512-K0aGNn1TjalKj+65D7ycc1//H9roAQ51GJVk5ZJQFb2teECGmzd86bYDC0aYdbRf7gtovescq4Zt6FR0tgXiHQ==} + /@scure/base@1.1.5: + resolution: {integrity: sha512-Brj9FiG2W1MRQSTB212YVPRrcbjkv48FoZi/u4l/zds/ieRrqsh7aUf6CLwkAq61oKXr/ZlTzlY66gLIj3TFTQ==} + dev: true + /@sd-jwt/core@0.1.2-alpha.0: resolution: {integrity: sha512-x4MVXar6WmPauZDRJ3aHwaY8o/bHzN77Ts7o43JKuuqIBFjPgAcSlRtd/Xk1rWhazFai4MCIwJDSQ1OQRJtNug==} dependencies: @@ -3418,6 +3464,33 @@ packages: dependencies: '@sinonjs/commons': 3.0.0 + /@sphereon/isomorphic-webcrypto@2.4.0-unstable.4(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1): + resolution: {integrity: sha512-7i9GBta0yji3Z5ocyk82fXpqrV/swe7hXZVfVzOXRaGtTUNd+y8W/3cpHRQC2S4UEO/5N3lX7+B6qUunK9wS/Q==} + peerDependencies: + expo: '*' + expo-crypto: '*' + msrcrypto: ^1.5.8 + react-native-securerandom: ^1.0.1 + dependencies: + '@peculiar/webcrypto': 1.4.3 + asmcrypto.js: 2.3.2 + b64-lite: 1.4.0 + b64u-lite: 1.1.0 + cipher-base: 1.0.4 + create-hash: 1.2.0 + expo: 48.0.20(@babel/core@7.23.0) + expo-crypto: 12.6.0(expo@48.0.20) + inherits: 2.0.4 + md5.js: 1.3.5 + msrcrypto: 1.5.8 + randomfill: 1.0.4 + react-native-securerandom: 1.0.1(react-native@0.71.13) + ripemd160: 2.0.2 + sha.js: 2.4.11 + str2buf: 1.3.0 + webcrypto-shim: 0.1.7 + dev: true + /@sphereon/ssi-express-support@0.17.6-unstable.69: resolution: {integrity: sha512-IpiiW6KPv5zjvlCCxyw4S093WL4na6zvJjoWI26te04Y4T1yYF3FfaGdcA+BAQl4URvvcp09mzay2Z8RwmDLSA==} peerDependencies: @@ -3449,6 +3522,32 @@ packages: - supports-color dev: false + /@sphereon/ssi-sdk-ext.key-utils@0.15.1-unstable.11(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1): + resolution: {integrity: sha512-F0vR49mjSJ5Tm5sBvq6HduyAFoPbViTzRBG4J7NeUCubT3R35Jmjr2kWDrp8B1vbyQrCoBi5/TE5g30H2Hd4gA==} + dependencies: + '@ethersproject/random': 5.7.0 + '@sphereon/isomorphic-webcrypto': 2.4.0-unstable.4(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1) + '@stablelib/ed25519': 1.0.3 + '@stablelib/sha256': 1.0.1 + '@stablelib/sha512': 1.0.1 + '@veramo/core': 4.2.0 + base64url: 3.0.1 + debug: 4.3.4 + did-resolver: 4.1.0 + elliptic: 6.5.4 + lodash.isplainobject: 4.0.6 + multiformats: 9.9.0 + uint8arrays: 3.1.1 + varint: 6.0.0 + web-encoding: 1.1.5 + transitivePeerDependencies: + - expo + - expo-crypto + - msrcrypto + - react-native-securerandom + - supports-color + dev: true + /@sphereon/ssi-types@0.17.6-unstable.69: resolution: {integrity: sha512-VwjVd6XhoV5QecWcRh0RpBf5N324tfhYcQrVk9se3brqMNMauZTBbhUhk+QLdwFd+u/1+IfEWnS28HyIU7lXHQ==} dependencies: @@ -3456,6 +3555,10 @@ packages: jwt-decode: 3.1.2 dev: false + /@stablelib/aead@1.0.1: + resolution: {integrity: sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==} + dev: true + /@stablelib/binary@1.0.1: resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==} dependencies: @@ -3465,6 +3568,28 @@ packages: resolution: {integrity: sha512-Kre4Y4kdwuqL8BR2E9hV/R5sOrUj6NanZaZis0V6lX5yzqC3hBuVSDXUIBqQv/sCpmuWRiHLwqiT1pqqjuBXoQ==} dev: true + /@stablelib/chacha20poly1305@1.0.1: + resolution: {integrity: sha512-MmViqnqHd1ymwjOQfghRKw2R/jMIGT3wySN7cthjXCBdO+qErNPUBnRzqNpnvIwg7JBCg3LdeCZZO4de/yEhVA==} + dependencies: + '@stablelib/aead': 1.0.1 + '@stablelib/binary': 1.0.1 + '@stablelib/chacha': 1.0.1 + '@stablelib/constant-time': 1.0.1 + '@stablelib/poly1305': 1.0.1 + '@stablelib/wipe': 1.0.1 + dev: true + + /@stablelib/chacha@1.0.1: + resolution: {integrity: sha512-Pmlrswzr0pBzDofdFuVe1q7KdsHKhhU24e8gkEwnTGOmlC7PADzLVxGdn2PoNVBBabdg0l/IfLKg6sHAbTQugg==} + dependencies: + '@stablelib/binary': 1.0.1 + '@stablelib/wipe': 1.0.1 + dev: true + + /@stablelib/constant-time@1.0.1: + resolution: {integrity: sha512-tNOs3uD0vSJcK6z1fvef4Y+buN7DXhzHDPqRLSXUel1UfqMB1PWNsnnAezrKfEwTLpN0cGH2p9NNjs6IqeD0eg==} + dev: true + /@stablelib/ed25519@1.0.3: resolution: {integrity: sha512-puIMWaX9QlRsbhxfDc5i+mNPMY+0TmQEskunY1rZEBPi1acBCVQAhnsk/1Hk50DGPtVsZtAWQg4NHGlVaO9Hqg==} dependencies: @@ -3484,6 +3609,13 @@ packages: '@stablelib/bytes': 1.0.1 dev: true + /@stablelib/poly1305@1.0.1: + resolution: {integrity: sha512-1HlG3oTSuQDOhSnLwJRKeTRSAdFNVB/1djy2ZbS35rBSJ/PFqx9cf9qatinWghC2UbfOYD8AcrtbUQl8WoxabA==} + dependencies: + '@stablelib/constant-time': 1.0.1 + '@stablelib/wipe': 1.0.1 + dev: true + /@stablelib/random@1.0.0: resolution: {integrity: sha512-G9vwwKrNCGMI/uHL6XeWe2Nk4BuxkYyWZagGaDU9wrsuV+9hUwNI1lok2WVo8uJDa2zx7ahNwN7Ij983hOUFEw==} dependencies: @@ -3497,6 +3629,14 @@ packages: '@stablelib/binary': 1.0.1 '@stablelib/wipe': 1.0.1 + /@stablelib/sha256@1.0.1: + resolution: {integrity: sha512-GIIH3e6KH+91FqGV42Kcj71Uefd/QEe7Dy42sBTeqppXV95ggCcxLTk39bEr+lZfJmp+ghsR07J++ORkRELsBQ==} + dependencies: + '@stablelib/binary': 1.0.1 + '@stablelib/hash': 1.0.1 + '@stablelib/wipe': 1.0.1 + dev: true + /@stablelib/sha512@1.0.1: resolution: {integrity: sha512-13gl/iawHV9zvDKciLo1fQ8Bgn2Pvf7OV6amaRVKiq3pjQ3UmEpXxWiAfV8tYjUpeZroBxtyrwtdooQT/i3hzw==} dependencies: @@ -3515,6 +3655,24 @@ packages: '@stablelib/wipe': 1.0.1 dev: true + /@stablelib/xchacha20@1.0.1: + resolution: {integrity: sha512-1YkiZnFF4veUwBVhDnDYwo6EHeKzQK4FnLiO7ezCl/zu64uG0bCCAUROJaBkaLH+5BEsO3W7BTXTguMbSLlWSw==} + dependencies: + '@stablelib/binary': 1.0.1 + '@stablelib/chacha': 1.0.1 + '@stablelib/wipe': 1.0.1 + dev: true + + /@stablelib/xchacha20poly1305@1.0.1: + resolution: {integrity: sha512-B1Abj0sMJ8h3HNmGnJ7vHBrAvxuNka6cJJoZ1ILN7iuacXp7sUYcgOVEOTLWj+rtQMpspY9tXSCRLPmN1mQNWg==} + dependencies: + '@stablelib/aead': 1.0.1 + '@stablelib/chacha20poly1305': 1.0.1 + '@stablelib/constant-time': 1.0.1 + '@stablelib/wipe': 1.0.1 + '@stablelib/xchacha20': 1.0.1 + dev: true + /@tokenizer/token@0.3.0: resolution: {integrity: sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A==} dev: true @@ -3692,6 +3850,14 @@ packages: '@transmute/ld-key-pair': 0.7.0-unstable.81 dev: true + /@trust/keyto@2.0.0-alpha1: + resolution: {integrity: sha512-VmlOa+nOaDzhEUfprnVp7RxFQyuEwA4fJ5+smnsud5WM01gU16yQnO/ejZnDVMGXuq/sUwTa5pCej4JhkKA5Sg==} + dependencies: + asn1.js: 5.4.1 + base64url: 3.0.1 + elliptic: 6.5.4 + dev: true + /@tsconfig/node10@1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true @@ -4097,6 +4263,19 @@ packages: graphql: 15.8.0 wonka: 4.0.15 + /@veramo/core@4.2.0: + resolution: {integrity: sha512-HIqbXfCbwOAJelR5Ohsm22vr63cy6ND8Ua/+9wfMDAiymUUS7NryaJ/v6NRtnmIrNZqUMDdR9/TWdp4cCq5eBg==} + dependencies: + credential-status: 2.0.6 + debug: 4.3.4 + did-jwt-vc: 3.2.15 + did-resolver: 4.1.0 + events: 3.3.0 + z-schema: 5.0.5 + transitivePeerDependencies: + - supports-color + dev: true + /@xmldom/xmldom@0.7.13: resolution: {integrity: sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==} engines: {node: '>=10.0.0'} @@ -4124,6 +4303,12 @@ packages: argparse: 2.0.1 dev: true + /@zxing/text-encoding@0.9.0: + resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} + requiresBuild: true + dev: true + optional: true + /JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -4445,6 +4630,19 @@ packages: resolution: {integrity: sha512-usgMoyXjMbx/ZPdzTSXExhMPur2FTdz/Vo5PVx2gIaBcdAAJNOFlsdgqveM8Cff7W0v+xrf9BwjOV26JSAF9qA==} dev: false + /asmcrypto.js@2.3.2: + resolution: {integrity: sha512-3FgFARf7RupsZETQ1nHnhLUUvpcttcCq1iZCaVAbJZbCZ5VNRrNyvpDyHTOb0KC3llFcsyOT/a99NZcCbeiEsA==} + dev: true + + /asn1.js@5.4.1: + resolution: {integrity: sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==} + dependencies: + bn.js: 4.12.0 + inherits: 2.0.4 + minimalistic-assert: 1.0.1 + safer-buffer: 2.1.2 + dev: true + /asn1js@3.0.5: resolution: {integrity: sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==} engines: {node: '>=12.0.0'} @@ -4510,13 +4708,11 @@ packages: resolution: {integrity: sha512-aHe97M7DXt+dkpa8fHlCcm1CnskAHrJqEfMI0KN7dwqlzml/aUe1AGt6lk51HzrSfVD67xOso84sOpr+0wIe2w==} dependencies: base-64: 0.1.0 - dev: false /b64u-lite@1.1.0: resolution: {integrity: sha512-929qWGDVCRph7gQVTC6koHqQIpF4vtVaSbwLltFQo44B1bYUquALswZdBKFfrJCPEnsCOvWkJsPdQYZ/Ukhw8A==} dependencies: b64-lite: 1.4.0 - dev: false /babel-core@7.0.0-bridge.0(@babel/core@7.23.0): resolution: {integrity: sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==} @@ -4699,7 +4895,6 @@ packages: /base-64@0.1.0: resolution: {integrity: sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==} - dev: false /base-x@3.0.9: resolution: {integrity: sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==} @@ -4731,6 +4926,10 @@ packages: safe-buffer: 5.1.2 dev: false + /bech32@2.0.0: + resolution: {integrity: sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==} + dev: true + /before-after-hook@2.2.3: resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} dev: true @@ -5040,6 +5239,10 @@ packages: /canonicalize@1.0.8: resolution: {integrity: sha512-0CNTVCLZggSh7bc5VkX5WWPWO+cyZbNd07IHIsSXLia/eAq+r836hgk+8BKoEh7949Mda87VUOitx5OddVj64A==} + /canonicalize@2.0.0: + resolution: {integrity: sha512-ulDEYPv7asdKvqahuAY35c1selLdzDwHqugK92hfkzvlDCwXRRelDkR+Er33md/PtnpqHemgkuDPanZ4fiYZ8w==} + dev: true + /canvas@2.11.2: resolution: {integrity: sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==} engines: {node: '>=6'} @@ -5109,6 +5312,13 @@ packages: resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} engines: {node: '>=8'} + /cipher-base@1.0.4: + resolution: {integrity: sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==} + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + /cjs-module-lexer@1.2.3: resolution: {integrity: sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==} dev: true @@ -5570,6 +5780,16 @@ packages: typescript: 5.0.4 dev: true + /create-hash@1.2.0: + resolution: {integrity: sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==} + dependencies: + cipher-base: 1.0.4 + inherits: 2.0.4 + md5.js: 1.3.5 + ripemd160: 2.0.2 + sha.js: 2.4.11 + dev: true + /create-jest@29.7.0(@types/node@18.18.0)(ts-node@10.9.1): resolution: {integrity: sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -5593,6 +5813,13 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true + /credential-status@2.0.6: + resolution: {integrity: sha512-l5ZwSbX/UXFJ3DQ3dFt4rc2BtfUu/rhlkefR7BL9EZsKPyCe21okJA9mDy4h/nXvMEwpYjSQEa5vzR7KZqhI9g==} + dependencies: + did-jwt: 6.11.6 + did-resolver: 4.1.0 + dev: true + /credentials-context@2.0.0: resolution: {integrity: sha512-/mFKax6FK26KjgV2KW2D4YqKgoJ5DVJpNt87X2Jc9IxT2HBMy7nEIlc+n7pEi+YFFe721XqrvZPd+jbyyBjsvQ==} dev: false @@ -5881,6 +6108,45 @@ packages: resolution: {integrity: sha512-iFpszgSxc7d1kNBJWC+PAzNTpe5LPalzsIunTMIpbG3O37Q7Zi7u4iIaedaM7UhziBhT+Agr9DyvAiXSUyfepQ==} dev: false + /did-jwt-vc@3.2.15: + resolution: {integrity: sha512-M/WPiL34CQUiN4bvWnZ0OFHJ3usPtstfQfbNbHAWHvwjeCGi7nAdv62VXHgy2xIhJMc790hH7PsMN3i6SCGEyg==} + engines: {node: '>=18'} + dependencies: + did-jwt: 7.4.7 + did-resolver: 4.1.0 + dev: true + + /did-jwt@6.11.6: + resolution: {integrity: sha512-OfbWknRxJuUqH6Lk0x+H1FsuelGugLbBDEwsoJnicFOntIG/A4y19fn0a8RLxaQbWQ5gXg0yDq5E2huSBiiXzw==} + dependencies: + '@stablelib/ed25519': 1.0.3 + '@stablelib/random': 1.0.2 + '@stablelib/sha256': 1.0.1 + '@stablelib/x25519': 1.0.3 + '@stablelib/xchacha20poly1305': 1.0.1 + bech32: 2.0.0 + canonicalize: 2.0.0 + did-resolver: 4.1.0 + elliptic: 6.5.4 + js-sha3: 0.8.0 + multiformats: 9.9.0 + uint8arrays: 3.1.1 + dev: true + + /did-jwt@7.4.7: + resolution: {integrity: sha512-Apz7nIfIHSKWIMaEP5L/K8xkwByvjezjTG0xiqwKdnNj1x8M0+Yasury5Dm/KPltxi2PlGfRPf3IejRKZrT8mQ==} + dependencies: + '@noble/ciphers': 0.4.1 + '@noble/curves': 1.3.0 + '@noble/hashes': 1.3.3 + '@scure/base': 1.1.5 + canonicalize: 2.0.0 + did-resolver: 4.1.0 + multibase: 4.0.6 + multiformats: 9.9.0 + uint8arrays: 3.1.1 + dev: true + /did-resolver@4.1.0: resolution: {integrity: sha512-S6fWHvCXkZg2IhS4RcVHxwuyVejPR7c+a4Go0xbQ9ps5kILa8viiYQgrM4gfTyeTjJ0ekgJH9gk/BawTpmkbZA==} dev: true @@ -6380,6 +6646,11 @@ packages: resolution: {integrity: sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==} dev: true + /events@3.3.0: + resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} + engines: {node: '>=0.8.x'} + dev: true + /exec-async@2.2.0: resolution: {integrity: sha512-87OpwcEiMia/DeiKFzaQNBNFeN3XkkpYIh9FyOqq5mS2oKv3CBE67PXoEKcr6nodWdXNogTiQ0jE2NGuoffXPw==} @@ -6499,6 +6770,15 @@ packages: transitivePeerDependencies: - supports-color + /expo-crypto@12.6.0(expo@48.0.20): + resolution: {integrity: sha512-wSq64eIJxk4lQBidtcW9wNF5AgO/UvV8W8mDhb7bo6P3xH41yvu/P4FcxevQY1taGA8VHD+fO+xQDrhPiHzFqQ==} + peerDependencies: + expo: '*' + dependencies: + base64-js: 1.5.1 + expo: 48.0.20(@babel/core@7.23.0) + dev: true + /expo-file-system@15.2.2(expo@48.0.20): resolution: {integrity: sha512-LFkOLcWwlmnjkURxZ3/0ukS35OswX8iuQknLHRHeyk8mUA8fpRPPelD/a1lS+yclqfqavMJmTXVKM1Nsq5XVMA==} peerDependencies: @@ -7438,6 +7718,15 @@ packages: dependencies: function-bind: 1.1.1 + /hash-base@3.1.0: + resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} + engines: {node: '>=4'} + dependencies: + inherits: 2.0.4 + readable-stream: 3.6.2 + safe-buffer: 5.2.1 + dev: true + /hash.js@1.1.7: resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} dependencies: @@ -7782,6 +8071,14 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} + /is-arguments@1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: @@ -7870,6 +8167,13 @@ packages: engines: {node: '>=6'} dev: true + /is-generator-function@1.0.10: + resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: true + /is-glob@2.0.1: resolution: {integrity: sha512-a1dBeB19NXsf/E0+FHqkagizel/LQw2DjSQpvQrj3zT+jYPpaUCryPnrQajXKFLCMuf4I6FhRpaGtw4lPrG6Eg==} engines: {node: '>=0.10.0'} @@ -8642,6 +8946,10 @@ packages: resolution: {integrity: sha512-xezGJmOb4lk/M1ZZLTR/jaBHQ4gG/lqQnJqdIv4721DMggsa1bDVlHXNeHYogaIEHD9vCRv0fcL4hMA+Coarkg==} dev: false + /js-sha3@0.8.0: + resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} + dev: true + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -9079,10 +9387,22 @@ packages: /lodash.debounce@4.0.8: resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==} + /lodash.get@4.4.2: + resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} + dev: true + + /lodash.isequal@4.5.0: + resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + dev: true + /lodash.ismatch@4.4.0: resolution: {integrity: sha512-fPMfXjGQEV9Xsq/8MTSgUf255gawYRbjwMyDbcvDhXgV7enSZA0hynz6vMPnpAb5iONEzBHBPsT+0zes5Z301g==} dev: true + /lodash.isplainobject@4.0.6: + resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} + dev: true + /lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} dev: true @@ -9246,6 +9566,14 @@ packages: dependencies: buffer-alloc: 1.2.0 + /md5.js@1.3.5: + resolution: {integrity: sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + /md5@2.2.1: resolution: {integrity: sha512-PlGG4z5mBANDGCKsYQe0CaUYHdZYZt8ZPZLmEt+Urf0W4GlpTX4HescwHU+dc9+Z/G/vZKYZYFrwgm9VxK6QOQ==} dependencies: @@ -9891,7 +10219,14 @@ packages: /msrcrypto@1.5.8: resolution: {integrity: sha512-ujZ0TRuozHKKm6eGbKHfXef7f+esIhEckmThVnz7RNyiOJd7a6MXj2JGBoL9cnPDW+JMG16MoTUh5X+XXjI66Q==} - dev: false + + /multibase@4.0.6: + resolution: {integrity: sha512-x23pDe5+svdLz/k5JPGCVdfn7Q5mZVMBETiC+ORfO+sor9Sgs0smJzAjfTbM5tckeCqnaUuMYoz+k3RXMmJClQ==} + engines: {node: '>=12.0.0', npm: '>=6.0.0'} + deprecated: This module has been superseded by the multiformats module + dependencies: + '@multiformats/base-x': 4.0.1 + dev: true /multiformats@9.9.0: resolution: {integrity: sha512-HoMUjhH9T8DDBNT+6xzkrd9ga/XiBI4xLr58LJACwK6G3HTOPeMz4nB4KJs33L2BelrIJa7P0VuNaVF3hMYfjg==} @@ -11094,6 +11429,19 @@ packages: engines: {node: '>= 0.8'} dev: false + /randombytes@2.1.0: + resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /randomfill@1.0.4: + resolution: {integrity: sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==} + dependencies: + randombytes: 2.1.0 + safe-buffer: 5.2.1 + dev: true + /range-parser@1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} @@ -11183,7 +11531,6 @@ packages: dependencies: base64-js: 1.5.1 react-native: 0.71.13(@babel/core@7.23.0)(@babel/preset-env@7.22.20)(react@18.2.0) - dev: false /react-native@0.71.13(@babel/core@7.23.0)(@babel/preset-env@7.22.20)(react@18.2.0): resolution: {integrity: sha512-zEa69YQNLdv8Sf5Pn0CNDB1K9eGuNy1KoMNxXlrZ89JZ8d02b5hihZIoOCCIwhH+iPgslYwr3ZoGd3AY6FMrgw==} @@ -11590,6 +11937,13 @@ packages: glob: 10.3.10 dev: true + /ripemd160@2.0.2: + resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} + dependencies: + hash-base: 3.1.0 + inherits: 2.0.4 + dev: true + /roarr@7.15.1: resolution: {integrity: sha512-0ExL9rjOXeQPvQvQo8IcV8SR2GTXmDr1FQFlY2HiAV+gdVQjaVZNOx9d4FI2RqFFsd0sNsiw2TRS/8RU9g0ZfA==} engines: {node: '>=12.0'} @@ -11787,6 +12141,14 @@ packages: /setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + /sha.js@2.4.11: + resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} + hasBin: true + dependencies: + inherits: 2.0.4 + safe-buffer: 5.2.1 + dev: true + /shallow-clone@3.0.1: resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} engines: {node: '>=8'} @@ -12031,7 +12393,6 @@ packages: /str2buf@1.3.0: resolution: {integrity: sha512-xIBmHIUHYZDP4HyoXGHYNVmxlXLXDrtFHYT0eV6IOdEj3VO9ccaF1Ejl9Oq8iFjITllpT8FhaXb4KsNmw+3EuA==} - dev: false /stream-buffers@2.2.0: resolution: {integrity: sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==} @@ -13007,6 +13368,16 @@ packages: /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + /util@0.12.5: + resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} + dependencies: + inherits: 2.0.4 + is-arguments: 1.1.1 + is-generator-function: 1.0.10 + is-typed-array: 1.1.12 + which-typed-array: 1.1.11 + dev: true + /utils-merge@1.0.1: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} @@ -13067,6 +13438,15 @@ packages: builtins: 5.0.1 dev: true + /validator@13.11.0: + resolution: {integrity: sha512-Ii+sehpSfZy+At5nPdnyMhx78fEoPDkR2XW/zimHEL3MyGJQOCQ7WeP20jPYRz7ZCpcKLB21NxuXHF3bxjStBQ==} + engines: {node: '>= 0.10'} + dev: true + + /varint@6.0.0: + resolution: {integrity: sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg==} + dev: true + /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -13084,6 +13464,14 @@ packages: dependencies: defaults: 1.0.4 + /web-encoding@1.1.5: + resolution: {integrity: sha512-HYLeVCdJ0+lBYV2FvNZmv3HJ2Nt0QYXqZojk3d9FJOLkwnuhzM9tmamh8d7HPM8QqjKH8DeHkFTx+CFlWpZZDA==} + dependencies: + util: 0.12.5 + optionalDependencies: + '@zxing/text-encoding': 0.9.0 + dev: true + /webcrypto-core@1.7.7: resolution: {integrity: sha512-7FjigXNsBfopEj+5DV2nhNpfic2vumtjjgPmeDKk45z+MJwXKKfhPB7118Pfzrmh4jqOMST6Ch37iPAHoImg5g==} dependencies: @@ -13095,7 +13483,6 @@ packages: /webcrypto-shim@0.1.7: resolution: {integrity: sha512-JAvAQR5mRNRxZW2jKigWMjCMkjSdmP5cColRP1U/pTg69VgHXEi1orv5vVpJ55Zc5MIaPc1aaurzd9pjv2bveg==} - dev: false /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -13419,3 +13806,15 @@ packages: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} dev: true + + /z-schema@5.0.5: + resolution: {integrity: sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==} + engines: {node: '>=8.0.0'} + hasBin: true + dependencies: + lodash.get: 4.4.2 + lodash.isequal: 4.5.0 + validator: 13.11.0 + optionalDependencies: + commander: 9.5.0 + dev: true From b483fb9e979b7d20adb9417257c7e5426537c64d Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Tue, 23 Jan 2024 01:14:18 +0100 Subject: [PATCH 3/5] chore: update lock file --- packages/client/package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/client/package.json b/packages/client/package.json index 699af70f..bb532d56 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -25,7 +25,7 @@ "@types/node": "^18.17.4", "@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0", - "@sphereon/ssi-sdk-ext.key-utils": "^0.15.1-next.7", + "@sphereon/ssi-sdk-ext.key-utils": "^0.16.0", "codecov": "^3.8.3", "dotenv": "^16.3.1", "eslint": "^8.46.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 87e7c5d1..4fc41718 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,8 +128,8 @@ importers: version: 4.3.4 devDependencies: '@sphereon/ssi-sdk-ext.key-utils': - specifier: ^0.15.1-next.7 - version: 0.15.1-unstable.11(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1) + specifier: ^0.16.0 + version: 0.16.0(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1) '@transmute/did-key.js': specifier: ^0.3.0-unstable.10 version: 0.3.0-unstable.10 @@ -3540,8 +3540,8 @@ packages: - supports-color dev: false - /@sphereon/ssi-sdk-ext.key-utils@0.15.1-unstable.11(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1): - resolution: {integrity: sha512-F0vR49mjSJ5Tm5sBvq6HduyAFoPbViTzRBG4J7NeUCubT3R35Jmjr2kWDrp8B1vbyQrCoBi5/TE5g30H2Hd4gA==} + /@sphereon/ssi-sdk-ext.key-utils@0.16.0(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1): + resolution: {integrity: sha512-gaPgoAG2R5pBdMwktPKP39QrcMUc5ny3U9fmzSdlBky0n0BCXv+ifeCSuVSFKQP5tBPeOKPyMH/JcaQWxoFzkA==} dependencies: '@ethersproject/random': 5.7.0 '@sphereon/isomorphic-webcrypto': 2.4.0-unstable.4(expo-crypto@12.6.0)(expo@48.0.20)(msrcrypto@1.5.8)(react-native-securerandom@1.0.1) From d2e9b7d1e2845edc88a5c03999df969038e9b8f4 Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Tue, 23 Jan 2024 01:18:09 +0100 Subject: [PATCH 4/5] chore: update lock file --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a2ae86a4..0a74797f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "publish:unstable": "lerna publish --conventional-prerelease --force-publish --canary --no-git-tag-version --include-merged-tags --preid unstable --pre-dist-tag unstable --yes --registry https://registry.npmjs.org" }, "engines": { - "node": ">=16" + "node": ">=18" }, "resolutions": { "node-fetch": "2.6.12" From a8ea63513c7af72647d4efefe51d15d9791095df Mon Sep 17 00:00:00 2001 From: Niels Klomp Date: Tue, 23 Jan 2024 10:20:26 +0100 Subject: [PATCH 5/5] Update packages/client/lib/CredentialRequestClient.ts --- packages/client/lib/CredentialRequestClient.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/lib/CredentialRequestClient.ts b/packages/client/lib/CredentialRequestClient.ts index 479b1b14..5b26c905 100644 --- a/packages/client/lib/CredentialRequestClient.ts +++ b/packages/client/lib/CredentialRequestClient.ts @@ -42,7 +42,6 @@ export async function buildProof( if ('proof_type' in proofInput) { if (opts.cNonce) { throw Error(`Cnonce param is only supported when using a Proof of Posession builder`); - //decodeJwt(proofInput.jwt). } return await ProofOfPossessionBuilder.fromProof(proofInput as ProofOfPossession, opts.version).build(); }