-
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
Add JWT and DID dereference()
#339
Conversation
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-11T19:46:53Z |
Co-authored-by: Frank Hinek <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #339 +/- ##
==========================================
+ Coverage 92.71% 92.82% +0.11%
==========================================
Files 75 76 +1
Lines 16838 17267 +429
Branches 1577 1607 +30
==========================================
+ Hits 15611 16028 +417
- Misses 1201 1212 +11
- Partials 26 27 +1
|
Co-Authored-By: kirahsapong <[email protected]>
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.
Looks good to me!
Co-Authored-By: nitro-neal <[email protected]>
Co-Authored-By: kirahsapong <[email protected]>
@frankhinek is taking a look at some of the tests breaking in |
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
CompactJwt
and DID dereference()
dereference()
Signed-off-by: Frank Hinek <[email protected]>
…o package Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
Signed-off-by: Frank Hinek <[email protected]>
* Separate and refactor JWT related functionality * add `DidResolver.dereference` --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]> Co-authored-by: kirahsapong <[email protected]> Co-authored-by: nitro-neal <[email protected]>
* Separate and refactor JWT related functionality * add `DidResolver.dereference` --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]> Co-authored-by: kirahsapong <[email protected]> Co-authored-by: nitro-neal <[email protected]>
* Separate and refactor JWT related functionality * add `DidResolver.dereference` --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]> Co-authored-by: kirahsapong <[email protected]> Co-authored-by: nitro-neal <[email protected]>
* Separate and refactor JWT related functionality * add `DidResolver.dereference` --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]> Co-authored-by: kirahsapong <[email protected]> Co-authored-by: nitro-neal <[email protected]>
What's Changed
@web5/dids
Added
DidResolver.dereference
hereresolves the DID contained in the DID URL to a DID document, and then extracts and returns the specific part of the document identified by the fragment in the DID URL
Added a
DidResource
type here which represents all of the resources present in a DID Document e.g. services, verification methods etc.Added a
isVerificationMethod
utility function here that acts as a type guard forDidResource
@web5/credentials
Separated all JWT related functionality from
VerifiableCredential
into aJwt
class hereHandrolled
Jwt.verify
and droppeddid-jwt
as a dependency.did-jwt
is a chonker and uses a number of deprecated third party libs.Refactored
VerifiableCredential
andPresentationExchange
methods to consistently use options objects.Refactored
VerifiableCredential
methods to consistently be async.Important
Removed
VerifiedJwt
type as it's no longer being used anywhere. this type was previously exported which means this is a breaking change for any downstream consumers who were using this typeWarning
VerifiableCredential.create
is now an async method.VerifiableCredential.verify
&VerifiableCredentials.parseJwt
method signatures changed to take options object as input.PresentationExchange
method signatures changed to take options object as input.@web5/crypto
Added
JwtHeaderParams
andJwtPayload
types.Dramatically improves performance of
randomUuid()
function:Before:
After: