vulcanizer icon indicating copy to clipboard operation
vulcanizer copied to clipboard

Request to add prompt for password

Open skbly7 opened this issue 5 years ago • 8 comments

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)

skbly7 avatar May 17 '19 08:05 skbly7

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

nickcanz avatar May 17 '19 14:05 nickcanz

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.

jhuggart avatar Apr 10 '20 18:04 jhuggart

Thanks for the tip @jhuggart, I'll look into that!

nickcanz avatar Apr 13 '20 15:04 nickcanz

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.

leosunmo avatar Jun 15 '20 09:06 leosunmo

@nickcanz or @jhuggart could you try this out with a password protected cluster?

leosunmo avatar Sep 16 '20 00:09 leosunmo

Sorry about this @leosunmo! Really appreciate your work and I'm going to dedicate some time next week to look at it.

nickcanz avatar Sep 16 '20 20:09 nickcanz

No worries Nick, not in a huge rush, I don't even use the feature. Just very keen to close the last two issues ;)

leosunmo avatar Sep 18 '20 20:09 leosunmo

I've used https://github.com/AlecAivazis/survey for various interactive prompts including masked password in a CLI that is built with Cobra.

dshelley66 avatar Feb 23 '21 21:02 dshelley66