vulcanizer
vulcanizer copied to clipboard
Request to add prompt for password
Currently we can password passwords only by vulcanizer.yaml
configuration file or in cmdline.
Can/Should we allow password as prompt if not provided after --password
flag? (or new flag all together)
This is a good idea! But unfortunately it doesn't look like it's supported by the https://github.com/spf13/cobra, the cli library that's we're using: https://github.com/spf13/cobra/issues/248
Hey @nickcanz, Good to see you in the wild. I stumbled across this from the cobra issue you referenced above.
I ended up using promptui with cobra to allow input for a handful of fields. It was super easy to wire up. Maybe it'll work for you too.
Thanks for the tip @jhuggart, I'll look into that!
I wrote up two implementations of this using https://github.com/manifoldco/promptui and Go's builtin golang.org/x/crypto/ssh/terminal terminal.ReadPassword()
.
manifoldco/promptui implementation golang.org/x/crypto/ssh/terminal implementation
Binary sizes:
13544298 promptui-vulcanizer
13120932 terminal-vulcanizer
Promptui looks a bit flashier and will obviously open up other possibilities for interactive prompts that we might want in the future, but /x/crypto/ssh/terminal is a lot slimmer.
Promptui allows you to set limits on the password, which might not be interesting for this purpose, but it displays "*" instead of what you type, where as /x/crypto/ssh/terminal just shows nothing at all which can be confusing for some.
@jhuggart If you are still using Vulcanizer, could you check out one of my branches and try it out? I don't have a cluster with auth enabled handy right now so I can't validate if this actually works.
@nickcanz or @jhuggart could you try this out with a password protected cluster?
Sorry about this @leosunmo! Really appreciate your work and I'm going to dedicate some time next week to look at it.
No worries Nick, not in a huge rush, I don't even use the feature. Just very keen to close the last two issues ;)
I've used https://github.com/AlecAivazis/survey for various interactive prompts including masked password in a CLI that is built with Cobra.