Skip to content
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

Skip whitespace in base64 encoded inputs given to the CLI #377

Merged
merged 2 commits into from
Jul 15, 2024
Merged

Conversation

leighmcculloch
Copy link
Member

@leighmcculloch leighmcculloch commented Jul 15, 2024

What

Skip whitespace in base64 encoded inputs given to the CLI.

Why

It's easy for spaces and new lines to end up in base64 inputs either because folks copy a base64 input and the following new line, or they pipe a value using echo without the -n, or they pipe a value from another command line tool that appends a new line, or they copy a base64 value that has been hard wrapped.

There's not really any reason to fail parsing these inputs in the CLI. The CLI is intended to be convenient to use by humans.

Note that I considered making this change to the base64 decoder in the XDR library itself, but I think this convenience feature is most impactful and meaningful to users when they are interacting with the CLI, and to introduce this into other places like the XDR lib is likely to not be impactful or if it is in a surprising way.

Close #375

@leighmcculloch leighmcculloch requested review from fnando and a team July 15, 2024 11:01
@leighmcculloch leighmcculloch marked this pull request as ready for review July 15, 2024 11:02
@leighmcculloch leighmcculloch enabled auto-merge July 15, 2024 11:04
@leighmcculloch leighmcculloch added this pull request to the merge queue Jul 15, 2024
Merged via the queue into main with commit b6032a4 Jul 15, 2024
11 checks passed
@leighmcculloch leighmcculloch deleted the i375 branch July 15, 2024 16:58
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.

cli: automatically remove a single trailing new-line character when decoding a base64 encoded input
2 participants