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

Add support for providing a function as the key #22

Closed
toonetown opened this issue Apr 19, 2016 · 2 comments · Fixed by #24
Closed

Add support for providing a function as the key #22

toonetown opened this issue Apr 19, 2016 · 2 comments · Fixed by #24

Comments

@toonetown
Copy link
Contributor

It would be helpful to be able to provide a function or a string as the key to the verify functions. Such a function would be passed the value of kid from the header as a single parameter, and would return a string to use as the key. This would simplify, for example, using a hash table or a Redis database for looking up keys based off of the kid parameter.

I actually have some code that does this, and am willing to put together a pull request if it would be something that is desired.

@SkyLothar
Copy link
Owner

oh, that's a good idea.
now, i'm doing following steps to perform a kid validaiton

  • load jwt to create a jwt_obj
  • find out the right key according to the kid
  • verify the jwt_obj

yes, a kid validation function sounds good.
much appreciated if you send a pr!

@toonetown
Copy link
Contributor Author

OK - I'll get it worked up probably tomorrow and get something submitted for review.

toonetown added a commit to toonetown/lua-resty-jwt that referenced this issue Apr 20, 2016
This fixes SkyLothar#22.  It also updates the documentation and adds unit tests surrounding the feature.
SkyLothar pushed a commit that referenced this issue Apr 21, 2016
This fixes #22.  It also updates the documentation and adds unit tests surrounding the feature.
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 a pull request may close this issue.

2 participants