-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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): make KeyFunc public in JWT middleware #1756
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1756 +/- ##
=======================================
Coverage 89.73% 89.74%
=======================================
Files 32 32
Lines 2669 2671 +2
=======================================
+ Hits 2395 2397 +2
Misses 175 175
Partials 99 99
Continue to review full report at Codecov.
|
I have no idea why codecov/patch failed with '84.61% of diff hit (target 89.43%)'. It would be nice if I could get some pointer and improve it. |
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.
Thanks for your contribution!
Could you shed some light on what is you actual use case is and why his PR is needed?
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.
Thanks for your contribution!
Could you shed some light on what is you actual use case is and why his PR is needed?
Sorry, for my late reaction. I didn't notice that you commented 3 weeks ago.
I would like to use Google to issue a sign-in token and echo verifies the token. I came across that someone else wanted to have it too (#1731)
I try to approach it using a custom KeyFunc which does:
- Downloads the key sets from https://www.googleapis.com/oauth2/v3/certs and cache it for X hours.
- Verifies the token according https://developers.google.com/identity/sign-in/web/backend-auth
- Returns the public key
Is there another way with the existing JWT Middleware functions?
That would be great if there is one.
It allows a user-defined function to supply the key for a token verification.
89ac390
to
6c6a45b
Compare
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. Approved from my side!
Thanks @antonindrawan
No problem. Thank you for reviewing @lammel . One other question: I see that the code coverage result fails. I have added test cases but I can't understand the code coverage result. Will it block the pull request to be merged later? |
Documentation for exposing KeyFunc: labstack/echo#1756
Documentation for exposing KeyFunc: labstack/echo#1756
Documentation for exposing KeyFunc: labstack/echo#1756
It allows a user-defined function to supply the key for a token
verification.
Address #1731
Since this is my first contribution to echo, please suggest any improvements.