-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validate presentaion submission with new validator #208
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #208 +/- ##
==========================================
+ Coverage 79.91% 80.16% +0.24%
==========================================
Files 37 37
Lines 2166 2193 +27
Branches 299 309 +10
==========================================
+ Hits 1731 1758 +27
Misses 297 297
Partials 138 138
|
} | ||
|
||
if (descriptor.id != id) { | ||
throw PexValidationException("Each descriptor should have one id in it, on all levels") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also need to check that descriptor ids are unique within the definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm with one comment
credentials/src/main/kotlin/web5/sdk/credentials/PresentationExchange.kt
Show resolved
Hide resolved
* Throws an [PexValidationException] if the provided object does not conform to the Presentation Definition | ||
*/ | ||
@Throws(PexValidationException::class) | ||
public fun validateSubmission(presentationSubmission: PresentationSubmission) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this specify that it's for v2 like the PD one above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope there is only one version of submission and honestly we should probably remove the v2 from definition since I think we will only be using v2
This method performs several checks to ensure the integrity of the presentation submission model object:
Usage:
web5-spec vector change - decentralized-identity/web5-spec#109