PEX
PEX copied to clipboard
Better error message for when credentials in presentation dont match requirements
Lets say I have the PD of:
{
"id": "81857b3f-5977-442e-9eae-225ca158d1a5",
"input_descriptors": [
{
"id": "Credential 1",
"name": "test PD",
"purpose": "verify",
"constraints": {
"fields": [
{
"path": [
"$.credentialSubject.email"
]
}
]
}
}
]
}
And I submit a presentation with a subject like:
{"notEmail": "blah"}
I will get these error messages:
{
"errors": [
{
"tag": "FilterEvaluation",
"status": "error",
"message": "Input candidate does not contain property: $.input_descriptors[0]: $.verifiableCredential[0]"
},
{
"tag": "MarkForSubmissionEvaluation",
"status": "error",
"message": "The input candidate is not eligible for submission: $.input_descriptors[0]: $.verifiableCredential[0]"
}
]
}
It would be beneficial to be told which field is missing and ideally not to have the Input candidate does not contain property message at all - unless that message is reffering to the email property. The reading of it is that its referring to the path $.input_descriptors[0]: $.verifiableCredential[0].
Hi @SamHellawell Thanks for the issue.
Although I do agree that messages should be more clear, they almost certainly come from a combinatorics problem. Your example is a really simply one, with one VC versus a simple definition. PEX also needs to handle the case, where you have let's say 50 credentials in your wallet and where 3 VCs need to be presented, which are part of multiple requirements grouped together with filters and other predicates.
We have however identified several enhancements which will go into a new major release, and the error handling is also in this list.
Thanks for responding.
Although I do agree that messages should be more clear, they almost certainly come from a combinatorics problem. Your example is a really simply one, with one VC versus a simple definition. PEX also needs to handle the case, where you have let's say 50 credentials in your wallet and where 3 VCs need to be presented, which are part of multiple requirements grouped together with filters and other predicates.
I'm aware of this use case too and its one we're also working with - what I was thinking is along the lines of:
{
"message": "Input candidate does not contain property: $.input_descriptors[0]: $.verifiableCredential[0].email"
}
whereby the 0 index can be changed for whatever is needed
As an error thats returned. Of course, when you have multiple credentials you may get multiple errors, or it may be possible to tie them up into one long message somehow. Either way - good to hear that error handling is being thought of - its workable for now as we can write a solution around this case.
Btw, thanks for the library!