-
-
Notifications
You must be signed in to change notification settings - Fork 243
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 JWKS parsing #146
Add JWKS parsing #146
Conversation
Looks, good, but I have a couple of ideas/additions:
|
Thanks for the feedback
I will add more unit tests and think of a way to abstract away the asymmetric-keys like you suggested |
I was actually thinking more about the parsing and not the accessors. I am not a computer rn, but you could take a look at the existing code (in particular the verifier) to check which methods have error_codes. |
The However, if you feel this shouldn't throw an exception and instead use the |
I stand corrected on my own library. You are right they do throw on invalid input. We normally have both overloads, one that takes an error_code and only throws if something really bad happens and one that basically calls the error_code overload and throws if the error code is set. But I think it might be a good idea to get it merged in some form at least and then iron out this stuff. Shouldn't be a problem as long as it is not part of a release. |
I agree - I can send follow-up PR's to change the |
Ok so I finally came around to actually download the branch and take a look at the jwk specification.
dont have an accessor. Was this a deliberate decision (e.g. to keep the interface simpler) or an oversight ? It might also be a good idea to check that members required by the spec (e.g. kty) are present and have the correct format. I don't think it makes sense to add parsing of the keys right now, instead I think we should merge this with the basic structure (which should already be helpfull to people) and follow up with a number of other pr's.
I am still wondering whether or not to take a look at encryption. Since we already depend on openssl/libressl we would not introduce new dependencies by adding it, but I wonder how many people actually use it (i.e. if its worth the effort). |
It was an oversight - I had mistakenly assumed the OP had completely implemented the spec, my bad - I should have verified my assumptions. I agree with your list of TODO items - and I think the next step after merging this is to transition to error_code interfaces and stabilize the API before adding more features |
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.
You are right they do throw on invalid input.
That said it might be a wise idea to move forward to using error_codes there as well.
@prince-chrismc what do you think about this ?
No objections! 👍
include/jwt-cpp/jwt.h
Outdated
* Create a verifier using the given clock | ||
* \param c Clock instance to use | ||
* \return verifier instance | ||
*/ |
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 out of place 🤔
Co-authored-by: Chris Mc <[email protected]>
@tchinmai7 Thanks for the work you put into this :) |
You're welcome, and Thank you very much for this awesome library! |
builds on top of #112
closes #112