Skip to content

Commit

Permalink
chore: only show DcqlQuery when present
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Dec 17, 2024
1 parent fa3e1b8 commit 9b4bb1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/siop-oid4vp/lib/rp/RP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,12 @@ export class RP {
state,
nonce,
verification: mergeVerificationOpts(this._verifyResponseOptions, opts),
presentationDefinitions: opts?.presentationDefinitions ?? this._verifyResponseOptions.presentationDefinitions,
dcqlQuery: opts?.dcqlQuery ?? this._verifyResponseOptions.dcqlQuery,
...(opts?.presentationDefinitions && !opts?.dcqlQuery && {
presentationDefinitions: this._verifyResponseOptions.presentationDefinitions
}),
...(opts?.dcqlQuery && {
dcqlQuery: this._verifyResponseOptions.dcqlQuery
})
}
}

Expand Down
6 changes: 6 additions & 0 deletions packages/siop-oid4vp/lib/rp/RPBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,16 @@ export class RPBuilder {
},
true,
)
this._authorizationRequestPayload.presentation_definition = undefined
this._requestObjectPayload.presentation_definition = undefined
return this
}

withPresentationDefinition(definitionOpts: { definition: IPresentationDefinition; definitionUri?: string }, targets?: PropertyTargets): RPBuilder {
if(this._authorizationRequestPayload.dcql_query) {
return this
}

const { definition, definitionUri } = definitionOpts

if (this.getSupportedRequestVersion() < SupportedVersion.SIOPv2_D11) {
Expand Down

0 comments on commit 9b4bb1f

Please sign in to comment.