Prompt for secrets if not provided on CLI #616
Reference in New Issue
Block a user
No description provided.
Delete Branch "calix/646"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Re #646
NB I added an integration test to check for the expected failure if the user provides
--no-input, but I didn't add a test for the new interactive prompt behaviour because I couldn't find an existing example, and addingexpectseemed to be a Big Change Probably Requiring Some Discussion.Radical ☀️ I would also just do a bunch of manual testing for this and call it a day. I don't think we test interactive output anywhere in any part of our testing infra. So yeh, fuck it.
@ -192,0 +196,4 @@if len(args) > 3 {data = args[3]} else if internal.NoInput {log.Fatal("Must provide <data> argument if --no-input is passed")Gotta do the
i18n.G(...)string wrapping translation dance 🙃Also, convention for logging is usually no capitalisation / lower-case 🤷
@ -213,0 +225,4 @@if insertFromFile {message = "Specify secret file"}prompt := &survey.Input{survey.PasswordNice! It will conflict with my changes though #614
I can update my PR to include your commit and make it work with the stdin reading
Ty for the review @decentral1se ! Made those changes
Argh sorry @p4u1, let me know if I can help.
@ -211,2 +220,4 @@}if data == "" && !internal.NoInput {log.Debug("Secret data not provided on command-line, prompting")i18n.G/ capitalisaion 👁🗨@ -213,0 +224,4 @@var prompt survey.Promptif !insertFromFile {prompt = &survey.Password{Message: i18n.G("Specify secret value"),i18n.G/ capitalisaion 👁🗨@ -213,0 +228,4 @@}} else {prompt = &survey.Input{Message: i18n.G("Specify secret file"),i18n.G/ capitalisaion 👁🗨We probably do need that fix suggested in #614 (comment) to wrap the
i18n.Gcall inside the logging functions. If someone is keen to pick it up 🙏 Feel free to merge anyway and come back on it. Happy merge conflict resolving 🤸OK additional tweaks made, mergin'