Presentation definitions with pick requirements result in malformed presentationExchanges because of logic defined here, where getSubmissionRequirementRulePick assigns all satisfiedSubmissions to the submission property, instead of submissionEntry.
Description
I'm currently building an OID4VP presentation flow where the presentation definition has some submission_requirements. Here's what the presentation definition looks like:
The presentation request is built as expected, and can be resolved by a Holder agent, but the single requirement in resolvedPresentationRequest.presentationExchange.credentialsForRequest does not match the DifPexCredentialsForRequestRequirement type - what we would expect to be present under submissionEntry is actually found in the submission property, i.e:
This means that, for this type of presentationDefinition, presentationExchangeService.selectCredentialsForRequest cannot be used, as it leads to a No verifiable presentations created error, as selectCredentialsForRequest returns {}.
If I build my own selectCredentialsForRequest function, I need to adjust some types as Property 'submission' does not exist on type 'DifPexCredentialsForRequestRequirement'.
Credo version: 0.5.9
tl;dr
Presentation definitions with
pick
requirements result in malformedpresentationExchange
s because of logic defined here, wheregetSubmissionRequirementRulePick
assigns allsatisfiedSubmissions
to thesubmission
property, instead ofsubmissionEntry
.Description
I'm currently building an OID4VP presentation flow where the presentation definition has some
submission_requirements
. Here's what the presentation definition looks like:The presentation request is built as expected, and can be resolved by a Holder agent, but the single
requirement
inresolvedPresentationRequest.presentationExchange.credentialsForRequest
does not match theDifPexCredentialsForRequestRequirement
type - what we would expect to be present undersubmissionEntry
is actually found in thesubmission
property, i.e:This means that, for this type of
presentationDefinition
,presentationExchangeService.selectCredentialsForRequest
cannot be used, as it leads to aNo verifiable presentations created
error, asselectCredentialsForRequest
returns{}
.If I build my own
selectCredentialsForRequest
function, I need to adjust some types asProperty 'submission' does not exist on type 'DifPexCredentialsForRequestRequirement'.