generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 57
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 DHT Enhancements #334
Merged
Merged
DID DHT Enhancements #334
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e test coverage Signed-off-by: Frank Hinek <[email protected]>
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
TBDocs Report ✅ No errors or warnings @web5/api
TBDocs Report Updated at 2023-12-06T02:49:41Z |
Signed-off-by: Frank Hinek <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #334 +/- ##
==========================================
+ Coverage 92.23% 92.71% +0.47%
==========================================
Files 75 75
Lines 16771 16786 +15
Branches 1567 1575 +8
==========================================
+ Hits 15469 15563 +94
+ Misses 1276 1197 -79
Partials 26 26
|
decentralgabe
approved these changes
Dec 5, 2023
Signed-off-by: Frank Hinek <[email protected]>
csuwildcat
approved these changes
Dec 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR primarily addresses Issue #312 by improving the error handling when attempting to resolve a
did:dht
DID that hasn't yet been published. Additionally, it modifies the key set handling to better align with the original intent and other existing DID method implementations. This was necessary to support the forthcoming switch todid:dht
as the default DID for@web5/api
package. Lastly it approves test coverage for the DID DHT related code.Context
As of the creation of this PR, the
pkarr
library dependency throws an error if thedid:dht
DID is not found. This could occur because the DID has not yet been published or because a previously published DID is no longer being maintained in mainline DHT. Ideally we could distinguish between error conditions such as aninternalError
andnotFound
, but until a better solution is found, this exception is caught and a DID Resolution Result is returned with an internalError.Issue #331 was created to follow-up on implementing the improvement in the
@web5/dids
package if/once one is selected.Changes
@web5/dids
identityKey
property from the DID DHT key set. Unlike DID ION update and recovery keys, all of the keys associated with adid:dht
DID reside within theverificationMethods
array. As a result, there isn't a need to track this key separately nor duplicate it in two places. The "identity" key is distinguishable due to its well-known0
key ID.did-dht.ts
.@web5/credentials