allow both base64 and base64url encoded public keys#23
Open
allow both base64 and base64url encoded public keys#23
Conversation
|
This pull request has been linked to Shortcut Story #184330: remove URL encoding from wallet jwt sub claim. |
mtps
reviewed
Oct 21, 2022
cmd/jwt-wallet/main_test.go
Outdated
| } | ||
|
|
||
| func GenerateClaims(addr string, pubKey *secp256k1.PublicKey) *signing.Claims { | ||
| func GenerateClaims(addr string, pubKey *secp256k1.PublicKey, urlEncodeKey bool) *signing.Claims { |
Collaborator
There was a problem hiding this comment.
Prefer passing in encoder or some typed object over booleans. The bool params make code harder to read and require delving into the function call to interpret meaning. Passing the base64.StdEncoding or base64.URLEncoding object is much clearer.
Collaborator
There was a problem hiding this comment.
oh, we're in test code here, nevermind! (though my distaste of boolean arguments still applies, but is less important of a detail since test code...)
Contributor
Author
There was a problem hiding this comment.
doesn't bother me either way--updated to pass the encoding
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.
this allows either encoding of the public key claim, with the intent to standardize on non-url encoded claim a la walletconnect in the near future