feat: add base64 Pubkeys from cli#17639
Merged
Merged
Conversation
4 tasks
alexanderbez
reviewed
Sep 6, 2023
| if err != nil { | ||
| return err | ||
| } | ||
| jsonPub := fmt.Sprintf(`{"@type":"%s","key":"%s"}`, tempAny.TypeUrl, b64) |
Contributor
There was a problem hiding this comment.
Is there a way to avoid manual JSON templating?
Contributor
There was a problem hiding this comment.
Yeah this is susceptible to some sneak attacks, we can invoke this
jsonPubB, err := json.Marshal(struct{
Type string `json:"@type,omitempty"`
Key string `json:"key,omitempty"`
}{tempAny.TypeURL, b64})
if err != nil {
return fmt.Errorf("failed to JSON marshal typeURL and base64 key: %w", err)
}
Contributor
Author
There was a problem hiding this comment.
nice catch guys!! Resolved in last commit!
odeke-em
suggested changes
Sep 6, 2023
Contributor
odeke-em
left a comment
There was a problem hiding this comment.
Thank you for this change @JulianToledano! I've added some code reviews, please take a look.
| if err != nil { | ||
| return err | ||
| } | ||
| jsonPub := fmt.Sprintf(`{"@type":"%s","key":"%s"}`, tempAny.TypeUrl, b64) |
Contributor
There was a problem hiding this comment.
Yeah this is susceptible to some sneak attacks, we can invoke this
jsonPubB, err := json.Marshal(struct{
Type string `json:"@type,omitempty"`
Key string `json:"key,omitempty"`
}{tempAny.TypeURL, b64})
if err != nil {
return fmt.Errorf("failed to JSON marshal typeURL and base64 key: %w", err)
}Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
odeke-em
reviewed
Sep 6, 2023
odeke-em
approved these changes
Sep 6, 2023
Contributor
odeke-em
left a comment
There was a problem hiding this comment.
Nice work, thank you @JulianToledano! LGTM with some tweaks.
Contributor
|
lgtm |
Contributor
|
@Mergifyio backport release/v0.50.x |
Contributor
✅ Backports have been createdDetails
|
mergify Bot
pushed a commit
that referenced
this pull request
Nov 10, 2023
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> (cherry picked from commit 933d042) # Conflicts: # CHANGELOG.md
julienrbrt
added a commit
that referenced
this pull request
Nov 10, 2023
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
Closes:
#10388
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdmake lintandmake testReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!in the type prefix if API or client breaking change