Prompt for secrets if not provided on CLI #616
Merged
3wordchant
merged 3 commits from 2025-08-26 17:15:48 +00:00
calix/646 into main
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#616
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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'