-
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
Refactor @web5/dids
to adopt Web5 Spec API changes
#406
Conversation
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
TBDocs Report ✅ No errors or warnings @web5/api
TBDocs Report Updated at 2024-02-09T22:24:12Z |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #406 +/- ##
==========================================
+ Coverage 93.25% 93.31% +0.05%
==========================================
Files 77 78 +1
Lines 23454 23573 +119
Branches 1869 1866 -3
==========================================
+ Hits 21873 21996 +123
+ Misses 1542 1537 -5
- Partials 39 40 +1
|
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
@web5/dids
to adopt Web5 Spec API changes
The failing security audit is for a development dependency that is not in the published artifact to NPM Registry. Issue tracking this has been opened here. |
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.
Great job once again! Looks just as discussed. 👍
Co-authored-by: nitro-neal <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
* Break out BearerDid/PortableDid and add DidRegistrationResult * Refactor DIDs package to new API design * Bump @web5/dids to 0.4.0 --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: nitro-neal <[email protected]>
* Break out BearerDid/PortableDid and add DidRegistrationResult * Refactor DIDs package to new API design * Bump @web5/dids to 0.4.0 --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: nitro-neal <[email protected]>
* Break out BearerDid/PortableDid and add DidRegistrationResult * Refactor DIDs package to new API design * Bump @web5/dids to 0.4.0 --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: nitro-neal <[email protected]>
Summary
This PR brings
@web5/dids
up to date with the Web5 Spec API described here.closes #397
closes #398
Details
BearerDid
BearerDid
BearerDid
includes a functiongetSigner
that returns an object/instance withsign()
andverify()
methods that can be used to sign messages, credentials, or arbitrary data. The object/instance returns also hasalgorithm
andkeyId
properties that are needed for header properties when creating JWS and JWE. By default, ifgetSigner
is called with no arguments it uses the first verification method found in the DID Document'sassertionMethod
property. It can optionally be called with amethodId
argument to select a specific verification method from the DID document.PortableDid
Additional Changes
fromKeyManager()
. It was introduced to solve an issue for a PFI partner that is now better solved byimport()
.toKeys
ortoPortableDid
. It has been replaced by theexport()
function on theBearerDid
instance.load()
/fromKeys
/fromPortableDid
toDidMethod.import()
import()
must optionally accept a key manager (e.g.,AwsKeyManager
orLocalKeyManager
)Did
= the string and hasDid.parse()