TBD54566975 / web5-spec

https://tbd54566975.github.io/sdk-report-runner/
Apache License 2.0
6 stars 6 forks source link

DID Resolution Result in case of upstream issues #102

Open frankhinek opened 6 months ago

frankhinek commented 6 months ago

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:

[!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

andresuribe87 commented 6 months ago

For did:dht, the proposed impelementation does:

frankhinek commented 6 months ago

@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 commented 6 months ago

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

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

andresuribe87 commented 6 months ago

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