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
Preserve JWK kid on import #320
Conversation
Hello, @rkmetzl! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information. |
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.
Great improvement, left one suggestion.
@keypair = keypair | ||
end | ||
|
||
def kid | ||
return jwk_kid if jwk_kid |
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.
Would it make sense to have this method as something like:
def kid
@kid ||= generate_from_public_key
end
Then we can just set the instance variable @kid
in the constructor.
Hey @rkmetzl are you still planning on moving forward with things change? It would be great if we could set our own |
Updates the implementation of JWT:JWK::EC so it will import and export custom "kid" values. See also jwt#320, which proposes doing the same for JWT::JWK::RSA.
Updates the implementation of JWT:JWK::EC so it will import and export custom "kid" values. See also jwt#320, which proposes doing the same for JWT::JWK::RSA.
@excpt I think we could merge this as it is now and then make some improvements. There are some exciting changes related to JWKs happening. |
This can be closed because it get solved with PR #375. |
Updates the implementation of JWT:JWK::EC so it will import and export custom "kid" values. See also jwt#320, which proposes doing the same for JWT::JWK::RSA.
Updates the implementation of JWT:JWK::EC so it will import and export custom "kid" values. See also #320, which proposes doing the same for JWT::JWK::RSA.
From issue #313
The JWK
import
method generates a unique kid on export, but doesn't take the imported kid into account. The logic here allows an imported kid to be included on export, while allowing a kid to be generated if none is present.