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

CLI - support base64 encoded address parameters #2588

Closed
matevz opened this issue Jan 23, 2020 · 3 comments · Fixed by #2640
Closed

CLI - support base64 encoded address parameters #2588

matevz opened this issue Jan 23, 2020 · 3 comments · Fixed by #2640
Assignees
Labels
c:bug Category: bug c:cli Category: command line interface

Comments

@matevz
Copy link
Member

matevz commented Jan 23, 2020

Summary

Currently, RuntimeID, EntityID, NodeID and maybe some other parameters need to be passed as hex-encoded values when calling oasis-node from CLI. On the other hand, listing the entities, runtimes etc. using CLI prints JSON which has base64 encoded address. Instead of simply copy&pasting them, you need to convert it to hex value using some external tool. Documentation also mentions this.

Expected behavior

To ease copy&pasting CLI parameter values should support (at least) the formats to which they are marshalled when printing them. Right now, this is base64, so implement that beside the hex format.

@matevz matevz added c:bug Category: bug c:cli Category: command line interface labels Jan 23, 2020
@Yawning
Copy link
Contributor

Yawning commented Jan 23, 2020

Like I said, as long as this doesn't change the encoding required for serialized data, I don't care.

@pro-wh
Copy link
Contributor

pro-wh commented Jan 23, 2020

  • some strings can be valid in both encodings. decoding would have to be more complex. possibly by decoding with knowledge of what length to expect. not sure if all tooling is ready for t this kind of thing
  • we should not let this make standardizing on one less appealing. let's still make output and a preferred input encoding consistent
  • we should warn when accepting whichever one is less preferred

@tjanez tjanez self-assigned this Jan 24, 2020
@tjanez
Copy link
Member

tjanez commented Jan 24, 2020

As @pro-wh pointed out, supporting both encodings would be complex and we should decide on a preference anyway.

Also, at this stage, we can still make such breaking changes to the CLI, so we can sort this out more cleanly.

Since JSON serialization will always use base64 encoding and all the Pem files containing public keys already use base64 encoding, it is perhaps most convenient to always use base64 encoding when something is either outputted by a CLI command or given as an input to a CLI command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c:bug Category: bug c:cli Category: command line interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants