Repository navigation
Conversation
JWT::JWK::KeyBase#inspect called #export, and #export calls #private?, which builds the OpenSSL key. A JWK with a kid is not built when it is imported, so one with bad key material, such as an EC point that is not on the curve or an RSA modulus that is not base64, imported fine and then raised from #inspect. That broke irb, logging and RSpec failure output, and JWT::JWK::Set#inspect with it, for exactly the keys someone would be debugging. Before jwt#754 it returned a string. #inspect now takes the parameters without the private key members, the same members #export drops, without building the key. #export still raises for such keys, as jwt#789 intends.
Member
Author
|
Closing: Posted by Claude on behalf of @anakinj. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
#754 made
JWT::JWK::KeyBase#inspectshowexportinstead of the key's internals. Butexportcallsprivate?, which builds the OpenSSL key, and a JWK with akidisn't built when it's imported. So a JWK with bad key material imported fine and then raised frominspect:JWT::JWK::Set#inspectraised too if any member was bad. On 3.3.0 these returned a string. This broke irb, logging and RSpec failure output for exactly the keys someone would be debugging.inspectnow takes the parameters without the private key members, the same membersexportdrops, so it never builds the key. For valid keys the output is unchanged.exportstill raises for such keys, as #789 intends.#754 hasn't been released, so there's no changelog row.
Checklist
Posted by Claude on behalf of @anakinj.