-
Notifications
You must be signed in to change notification settings - Fork 59
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
feat: jwt utilities #1973
feat: jwt utilities #1973
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1973 +/- ##
===========================================
+ Coverage 80.28% 80.38% +0.09%
===========================================
Files 103 104 +1
Lines 3530 3568 +38
Branches 758 767 +9
===========================================
+ Hits 2834 2868 +34
- Misses 382 383 +1
- Partials 314 317 +3 ☔ View full report in Codecov by Sentry. |
const payload = JSON.parse(this.payloadAsJson); | ||
if (!this.includeSubJwk) payload.sub_jwk = undefined; | ||
// TODO: expose account used in aepp-wallet connection | ||
return signJwt(payload, this.aeSdk._resolveAccount(this.aeSdk.address)); |
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.
I will figure out a fix for this later 😢
payload.sub_jwk = { | ||
kty: 'OKP', | ||
crv: 'Ed25519', | ||
x: toBase64Url(decode(account.address)), |
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.
https://datatracker.ietf.org/doc/html/draft-ietf-jose-cfrg-curves-06#section-2
is it based on something like this? In the next chapter "Ed25519" defined, but I can't find it in "JSON Web Elliptic Curve" registry.
Initially I found "sub_jwk" in https://www.iana.org/assignments/jwt/jwt.xhtml
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.
I've exported the jwk key via the jose
library and that was the format
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 very good to me, tried and compared it with other libraries and matches expected outputs
This PR is supported by the Æternity Foundation
based on #1967