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

Can't edit multi line values with jx secret edit #8314

Open
msvticket opened this issue Jul 28, 2022 · 7 comments
Open

Can't edit multi line values with jx secret edit #8314

msvticket opened this issue Jul 28, 2022 · 7 comments
Assignees
Labels

Comments

@msvticket
Copy link
Member

msvticket commented Jul 28, 2022

When inputting values with jx secret edit you can't input multiline values. I'm trying to edit jenkins-maven-settings.

The jx secret command is built from the repo https://github.com/jenkins-x-plugins/jx-secret/

@ba11b0y
Copy link

ba11b0y commented Dec 20, 2022

Hey @msvticket !
Is this still up for grabs?

@msvticket
Copy link
Member Author

Hey @msvticket ! Is this still up for grabs?

Sure, go ahead and code!

@ba11b0y
Copy link

ba11b0y commented Dec 27, 2022

/assign @ba11b0y

@ba11b0y
Copy link

ba11b0y commented Dec 27, 2022

@msvticket I took a stab at this. But it seems I've hit a brick wall here since https://github.com/go-survey/survey doesn't support multiline password inputs.
Am I missing anything?

@msvticket
Copy link
Member Author

I don't know, but that could very well be.

@yeswanth-koti26
Copy link

yeswanth-koti26 commented Jul 4, 2024

Hello @msvticket ,

I've noticed the issue with jx secret edit not supporting multi-line inputs and I'd like to contribute to a solution. It appears that the go-survey/survey library may need enhancements to support multi-line inputs, particularly for password fields. I propose modifying this library to extend its capabilities.

Could you please confirm if this approach aligns with the project’s needs, and if there are specific implementation details or requirements you’d like? I’m eager to assist and look forward to your guidance.

Thank you,
[Yeswanth Koti/@yeswanthkoti-26]

@msvticket
Copy link
Member Author

I've noticed the issue with jx secret edit not supporting multi-line inputs and I'd like to contribute to a solution. It appears that the go-survey/survey library may need enhancements to support multi-line inputs, particularly for password fields. I propose modifying this library to extend its capabilities.

Could you please confirm if this approach aligns with the project’s needs, and if there are specific implementation details or requirements you’d like? I’m eager to assist and look forward to your guidance.

Currently we use github.com/AlecAivazis/survey for terminal input, but that is not maintained any more. So to solve this issue AlecAivazis/survey needs to be replaced or complemented with another library. Since AlecAivazis/survey now recommends charmbracelet/bubbletea I have considered that, but no choice has been made in this regard. In Jenkins X input handling is one of the areas which is encapsulated in the library github.com/jenkins-x/jx-helpers.

Exactly how the UI should look is a tricky issue since different secrets have different demands. Ideally the default input mode would be like today if the current value doesn't contain any newlines but a multi line mode should be the default if it does contain newlines. But it should be possible to switch from single line to multi line mode. To also be able to switch between password mode (i.e. not showing the real character on screen) and clear text mode would also be very good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants