-
Notifications
You must be signed in to change notification settings - Fork 5
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: Correct handling for metadata and resourceMetadata query params + other fixes [DEV-4758] #340
Conversation
DaevMithran
commented
Feb 18, 2025
•
edited by ankurdotb
Loading
edited by ankurdotb
- Remove isSingleQuery in services/diddoc/echo_handlers.go and handle the metadata and resourceMetadata in QueryDIDDocRequestService
- Rename DidDocResourceCollectionEchoHandler (update testcases as well)
- Rename DIDDocResourceDereferencingService
- Rename ResourceService.ResolveCollectionResources
- Rename resourceCheck Variable in services/request_service_base.go
- Replace the removed Testcase "can get DIDDoc with an existent versionId and versionTime query parameters with Chrome Accept header"
- Return invalidDidUrl Error when any query parameter is misspelt
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Task linked: DEV-4758 Bug fixes from DID Resolution task |
Signed-off-by: Sownak Roy <sownak@cheqd.io>
Signed-off-by: Sownak Roy <sownak@cheqd.io>
3a7a015
to
c1da324
Compare
f6917bb
to
9293260
Compare
tests/integration/rest/testdata/query/resource_metadata/metadata_did_res.json
Show resolved
Hide resolved
0cf81aa
to
5f5f206
Compare
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.
Examples of non-working queries:
- http://localhost:8080/1.0/identifiers/did:cheqd:testnet:9cdea85b-7524-4962-ad11-c943b8303692?versionTime=2025-01-24&resourceMetadata=false - Returns the contents of a resource, rather than a specific DID Document with DLR metadata taken out
- Sent
http://localhost:8080/1.0/identifiers/did:cheqd:testnet:9cdea85b-7524-4962-ad11-c943b8303692?resourceName=didScidExample&resourceType=didScidLogEntry
with accept headerapplication/ld+json;profile="https://w3id.org/did-url-dereferencing"
- Expected to get both the resource as well as it's metadata when this specific header/profile was applied since that's the whole point of the DID URL dereferencing task that we're supposed to be doing, i.e., if no header supplied return resource but if this header's passed, return resource + metadata. And this doesn't seem to be doing that. http://localhost:8080/1.0/identifiers/did:cheqd:testnet:55dbc8bf-fba3-4117-855c-1e0dc1d3bb47?resourceName=Eventbrite Logo
with same accept header as previous one returns just image, rather than Base64 encoded resource + it's metadata
DIDDocuments are only returned on DIDResolution. Default behaviour for resource queries is dereferencing as discussed. The below curl request should provide the output you expected
Resource queries do not return content + contentMetadata, This was not specified in the task. This works only for http://localhost:8080/1.0/identifiers/did:cheqd:testnet:9cdea85b-7524-4962-ad11-c943b8303692/resources/<resource_id>.
Same as above |