-
Notifications
You must be signed in to change notification settings - Fork 516
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
fix: failure to verify jsonld on non-conformant doc but vaild vmethod #1301
fix: failure to verify jsonld on non-conformant doc but vaild vmethod #1301
Conversation
Signed-off-by: Daniel Bluhm <[email protected]>
Tests to hit the error path pending, hoping to get this ready for merge ASAP |
Codecov Report
@@ Coverage Diff @@
## main #1301 +/- ##
==========================================
- Coverage 95.43% 95.42% -0.01%
==========================================
Files 476 476
Lines 28977 28980 +3
==========================================
+ Hits 27653 27655 +2
- Misses 1324 1325 +1 |
) | ||
try: | ||
ver_meth_expanded = VerificationMethod.deserialize( | ||
ver_meth_expanded.serialize() |
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.
What is it if not a VerificationMethod?
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.
The dereference method can also be used to dereference a Service. The method itself has a return value of Resource
which is the base VerificationMethod
and Service
build from. It's a little on the complicated side due to attempts to work with documents that don't strictly conform to the schema outlined in the DID spec. In that case, a plain Resource
object is returned since the more feature rich parsing failed. We give that parsing another try for just the identified resource here.
Alternatively, I could see this being simpler: we default to dereferencing resources from a DID document as if the doc itself was non-conforming but modify the dereference
method to also take a parameter asserting that the dereferenced resource is a VerificationMethod
or Service
and "casts" the resource to one of these objects (or whatever type that was passed in) or fails.
Signed-off-by: Daniel Bluhm <[email protected]>
Minor fix for jsonld verify route.