Skip to content
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

DID Resolution Result in case of upstream issues #102

Open
frankhinek opened this issue Jan 12, 2024 · 4 comments
Open

DID Resolution Result in case of upstream issues #102

frankhinek opened this issue Jan 12, 2024 · 4 comments
Labels
did related to decentralized identifiers question Further information is requested

Comments

@frankhinek
Copy link
Contributor

frankhinek commented Jan 12, 2024

Seeking commentary on what the resolve() function in our DID method/resolver implementations should do when there is either a network failure or upstream gateway failure. Examples include:

  • for did:web, when attempting a GET to the server specified by the DID URI the network call might return a failure or the remote server could respond with status codes 404, 500, 503, etc.
  • for did:dht, there are multiple steps in the resolution process where network calls or upstream gateways might return an error status

Note

This only pertains to DID methods in which resolution relies on an external service. In other words, we need to consider for did:dht and did:web but not did:jwk or did:key.

We haven't yet added test vectors for DID DHT but there is one test for DID Web checks for didResolutionMetadata containing an error value of notFound given an invalid domain.

Do we want to mirror this pattern for other DID test vectors? Should implementations raise an exception? (Kotlin/JS) or return an error result (Go, Rust). Is it up to the implementation and all of the Web5 SDKs will do it differently?

Additional Reference Information

@frankhinek frankhinek added the question Further information is requested label Jan 12, 2024
@andresuribe87
Copy link
Contributor

For did:dht, the proposed impelementation does:

  • notFound, when the given did isn't found by the gateway.
  • internalError for all other types of errors, e.g. a timeout.

@frankhinek
Copy link
Contributor Author

@andresuribe87 Given that, what are your thoughts on returning internalError in the event the HTTP GET request during resolution of a did:web DID either outright fails (network transport layer issue) or returns a status code other than 200?

@andresuribe87
Copy link
Contributor

@frankhinek I proposed something a bit different in this PR:

  • When the host is unknown (e.g. domaindoesnotexist.com), return a notFound
  • Any other error results in internalError. For example, timeouts or parsing errors.

The motivation behind this was to follow the did spec notFound definition (which was pointed by you at the top).

@andresuribe87
Copy link
Contributor

FWIW, this reference implementation always returns notFound when there are any issues.

@decentralgabe decentralgabe added the did related to decentralized identifiers label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
did related to decentralized identifiers question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants