-
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 Credential Signing #401
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
TBDocs Report 🛑 Errors: 0 @web5/api
@web5/crypto
@web5/crypto-aws-kms
@web5/dids
TBDocs Report Updated at 2024-02-14T00:26:52Z |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #401 +/- ##
=======================================
Coverage 93.32% 93.33%
=======================================
Files 78 78
Lines 23573 23528 -45
Branches 1866 1863 -3
=======================================
- Hits 21999 21959 -40
+ Misses 1534 1529 -5
Partials 40 40
|
"@web5/common": "0.2.2", | ||
"@web5/crypto": "0.2.4", | ||
"@web5/dids": "0.2.4" | ||
"@web5/common": "0.2.3", |
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.
These are the latest versions right?
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.
Yes -- 0.4.0
for both dids and crypto -- 0.2.3
for common.
Should I bump the version of the credentials package to "version": "0.4.2", ? |
Signed-off-by: Frank Hinek <[email protected]>
packages/credentials/src/jwt.ts
Outdated
|
||
const isSignatureValid = await signer.verify({ | ||
algorithm : signatureAlgorithm!, | ||
const crypto = new CryptoApi(); |
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.
Should we just have is initialized once at the top?
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.
sounds good
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 other than a few changes noted above and updating the test
Co-authored-by: Frank Hinek <[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.
cc: @angiejones
Yes, we might as well publish a release today so that |
* refactor cred signing * updates * fixing jwt test * updates * updates to latest did and crypto package * update package lock * spacing * update package lock * package lock builds * Simplify JWT verify by using CryptoApi from @web5/crypto Signed-off-by: Frank Hinek <[email protected]> * Update packages/credentials/src/jwt.ts Co-authored-by: Frank Hinek <[email protected]> * updates to alg checking --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]>
* refactor cred signing * updates * fixing jwt test * updates * updates to latest did and crypto package * update package lock * spacing * update package lock * package lock builds * Simplify JWT verify by using CryptoApi from @web5/crypto Signed-off-by: Frank Hinek <[email protected]> * Update packages/credentials/src/jwt.ts Co-authored-by: Frank Hinek <[email protected]> * updates to alg checking --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]>
* refactor cred signing * updates * fixing jwt test * updates * updates to latest did and crypto package * update package lock * spacing * update package lock * package lock builds * Simplify JWT verify by using CryptoApi from @web5/crypto Signed-off-by: Frank Hinek <[email protected]> * Update packages/credentials/src/jwt.ts Co-authored-by: Frank Hinek <[email protected]> * updates to alg checking --------- Signed-off-by: Frank Hinek <[email protected]> Co-authored-by: Frank Hinek <[email protected]>
This change slightly refactors credential signing and verifying.
Instead of
PortableDid
we now useBearerDid
This change also:
signer
functionBearerDid
"@web5/common": "0.2.3",
"@web5/crypto": "0.4.0",
"@web5/dids": "0.4.0"