From 0603b43ed704ca36c176ca3a6e1cfafd81a2929e Mon Sep 17 00:00:00 2001 From: sanderPostma Date: Thu, 10 Oct 2024 11:47:24 +0200 Subject: [PATCH] chore: PR feedback (partly) --- .../lib/authorization-response/PresentationExchange.ts | 5 ++++- packages/siop-oid4vp/lib/rp/RP.ts | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/siop-oid4vp/lib/authorization-response/PresentationExchange.ts b/packages/siop-oid4vp/lib/authorization-response/PresentationExchange.ts index 1dc36d6c..882dade5 100644 --- a/packages/siop-oid4vp/lib/authorization-response/PresentationExchange.ts +++ b/packages/siop-oid4vp/lib/authorization-response/PresentationExchange.ts @@ -116,7 +116,10 @@ export class PresentationExchange { } else if (!this.allVerifiableCredentials || this.allVerifiableCredentials.length == 0) { throw new Error(`${SIOPErrors.COULD_NOT_FIND_VCS_MATCHING_PD}, no VCs were provided`) } - const selectResults: SelectResults = this.pex.selectFrom(presentationDefinition, this.removeMDocCredentials(this.allVerifiableCredentials), { + // When there are MDoc credentials among the selected ones, filter those out as pex does not support mdoc credentials + const filteredCredentials = this.removeMDocCredentials(this.allVerifiableCredentials) + const selectResults: SelectResults = this.pex.selectFrom(presentationDefinition, filteredCredentials, { + ...opts, holderDIDs: opts?.holderDIDs ?? this.allDIDs, // fixme limited disclosure diff --git a/packages/siop-oid4vp/lib/rp/RP.ts b/packages/siop-oid4vp/lib/rp/RP.ts index d0659bd7..a89b507e 100644 --- a/packages/siop-oid4vp/lib/rp/RP.ts +++ b/packages/siop-oid4vp/lib/rp/RP.ts @@ -198,13 +198,13 @@ export class RP { correlationId, }) correlationId = verifyAuthenticationResponseOpts.correlationId ?? correlationId - await this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_RECEIVED_SUCCESS, { + void this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_RECEIVED_SUCCESS, { correlationId, subject: authorizationResponse, }) const verifiedAuthorizationResponse = await authorizationResponse.verify(verifyAuthenticationResponseOpts) - await this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_VERIFIED_SUCCESS, { + void this.emitEvent(AuthorizationEvents.ON_AUTH_RESPONSE_VERIFIED_SUCCESS, { correlationId, subject: authorizationResponse, }) @@ -228,10 +228,10 @@ export class RP { } public getResponseRedirectUri(mappings?: Record): string | undefined { - if (this._responseRedirectUri === undefined) { + if (!this._responseRedirectUri) { return undefined } - if(mappings === undefined) { + if(!mappings) { return this._responseRedirectUri } return Object.entries(mappings).reduce(