Skip to content

Conversation

@benarena
Copy link
Contributor

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

@benarena benarena requested review from jphorec and mtps as code owners October 21, 2022 00:02
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #184330: remove URL encoding from wallet jwt sub claim.

}

func GenerateClaims(addr string, pubKey *secp256k1.PublicKey) *signing.Claims {
func GenerateClaims(addr string, pubKey *secp256k1.PublicKey, urlEncodeKey bool) *signing.Claims {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@mtps mtps Oct 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't bother me either way--updated to pass the encoding

@benarena benarena requested a review from mtps October 25, 2022 14:30
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 this pull request may close these issues.

3 participants