Skip to content
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: fix async handling in jwt verify #131

Merged

Conversation

lukasjhan
Copy link
Member

I found a bug while developing https://sdjwt.co

in jwt verify method, It doesn't wait until its resolved. verifier can be async function so we need await keyword.

Signed-off-by: Lukas <Lukas@hopae.io>
Copy link

codecov bot commented Mar 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.39%. Comparing base (c65744c) to head (b513e15).

Additional details and impacted files
@@           Coverage Diff           @@
##             next     #131   +/-   ##
=======================================
  Coverage   97.39%   97.39%           
=======================================
  Files          23       23           
  Lines        1878     1878           
  Branches      272      273    +1     
=======================================
  Hits         1829     1829           
  Misses         49       49           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@cre8 cre8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm,

Have you also checked the code if we have other mistreated async calls?

And I think all defined functions that can be passed to the sd-jwt instance should be async, since we don't know if the user needs it for his implementations. Or we define some type like Promise<string> | string

@lukasjhan
Copy link
Member Author

Lgtm,

Have you also checked the code if we have other mistreated async calls?

And I think all defined functions that can be passed to the sd-jwt instance should be async, since we don't know if the user needs it for his implementations. Or we define some type like Promise<string> | string

Yeah, I checked all code in core :) I guess now we're good.
Currently we treated passed functions as OrPromise which is Promise | type.

@lukasjhan lukasjhan merged commit a28ae21 into openwallet-foundation-labs:next Mar 4, 2024
10 checks passed
cre8 pushed a commit to cre8/sd-jwt-js that referenced this pull request Mar 8, 2024
Signed-off-by: Lukas <Lukas@hopae.io>
Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
cre8 pushed a commit that referenced this pull request Mar 8, 2024
Signed-off-by: Lukas <Lukas@hopae.io>
Signed-off-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants