decentralized-identity / universal-resolver

Universal Resolver implementation and drivers.
https://uniresolver.io/
Apache License 2.0
530 stars 235 forks source link

How does the universal resolver support application/did+json #150

Open OR13 opened 3 years ago

OR13 commented 3 years ago

@peacekeeper wondering about the profile.... should it be https://w3id.org/did-resolution ?

Can you provide your thoughts on what happens when I request application/did+json ?

I assume based on your comments on the DID WG call that the universal resolver will throw an error if the did method does not support application/did+json but does application/did+ld+json....

I would prefer that application/did+json be compatible with application/did+ld+json... so that JSON-LD can be returned when JSON is requested and the DID Method has chosen not to support JSON...

Obviously thats for the DID WG to decide.

I would like to know how you plan to handle the following cases:

  1. application/did+json is requested but did method only supports application/did+ld+json.

  2. application/did+ld+json is requested but did method only supports application/did+json.

  3. */* is requested but did method only supports application/did+ld+json.

  4. */* is requested and did method supports application/did+ld+json and application/did+json.

  5. application/did+ld+json, application/did+json is requested and did method supports application/did+ld+json.

  6. application/did+json, application/did+ld+json is requested and did method supports application/did+ld+json.

OR13 commented 3 years ago

@peacekeeper better to just answer on the did core issue: https://github.com/w3c/did-core/issues/417

I think this will help clarify a lot.

peacekeeper commented 3 years ago

@OR13 I agree this should be discussed either in did-core or did-resolution, since it's about resolvers in general, not about the Universal Resolver specifically. Do you want to close the issue here to avoid duplication?

peacekeeper commented 3 years ago

@peacekeeper wondering about the profile.... should it be https://w3id.org/did-resolution ?

Yes I think that makes more sense, I can make the change in DID Resolution and the UR code.

peacekeeper commented 3 years ago

Updated the profile URL in https://github.com/decentralized-identity/universal-resolver/commit/4817115f65be42319299552ca08e305060f2bd69 and https://github.com/w3c-ccg/did-resolution/commit/68ac2a77ed79932c61ef437d375787ad1bd83a5e

peacekeeper commented 2 years ago

We reviewed this on the 14 Jul 2021 Universal Resolver Work Item Call. Now seems to be a good time to continue this conversation, since 1. DID Core is nearing completion, 2. A DID test suite exist now, and 3. there is ongoing work on the Universal Resolver to address this topic.

peacekeeper commented 2 years ago

There is some support now in the Universal Resolver for different representations, but this isn't well-documented yet. We should add some explanation and examples like the following:

curl "https://dev.uniresolver.io/1.0/identifiers/did:sov:WRfXPg8dantKVubE3HX8pw"

Returns the DID document + metadata.

curl -H "Accept: application/did+json" "https://dev.uniresolver.io/1.0/identifiers/did:sov:WRfXPg8dantKVubE3HX8pw"

Returns the DID document in JSON.

curl -H "Accept: application/did+ld+json" "https://dev.uniresolver.io/1.0/identifiers/did:sov:WRfXPg8dantKVubE3HX8pw"

Returns the DID document in JSON-LD.

curl -H "Accept: application/did+json" "https://dev.uniresolver.io/1.0/identifiers/did:sov:WRfXPg8dantKVubE3HX8pw"

Returns the DID document in CBOR.

We updated the README with these examples in https://github.com/decentralized-identity/universal-resolver/commit/7a974108d36f359c6a080792bbc4b8f15a9bbd4f.