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

Request to add prompt for password #55

Open
skbly7 opened this issue May 17, 2019 · 8 comments
Open

Request to add prompt for password #55

skbly7 opened this issue May 17, 2019 · 8 comments

Comments

@skbly7
Copy link
Contributor

skbly7 commented May 17, 2019

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)

@nickcanz
Copy link
Contributor

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: spf13/cobra#248

@jhuggart
Copy link

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.

@nickcanz
Copy link
Contributor

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

@leosunmo
Copy link
Contributor

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
Copy link
Contributor

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

@nickcanz
Copy link
Contributor

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

@leosunmo
Copy link
Contributor

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

@dshelley66
Copy link

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

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

No branches or pull requests

5 participants