ManageIQ / manageiq-appliance_console

The console for the ManageIQ appliances.
Apache License 2.0
2 stars 28 forks source link

Add a common method for asking for a new password #251

Closed agrare closed 5 months ago

agrare commented 5 months ago

When entering an existing password it is sufficient to prompt once since if the user mistyped the password it will fail later on, but when creating a new password it is common to re-prompt them to confirm that they didn't typo the new password.

We had this "prompt twice, check non-empty" loop in two places and were going to need it in a third so it seemed better to move this to a common method.

TODO

Database configuration testing:

Each database region number must be unique.
Enter the database region number: 0
Enter the database password on localhost: 

Password can not be empty, please try again
Enter the database password on localhost: 

Password can not be empty, please try again
Enter the database password on localhost: *******
Enter the Re-enter database password on localhost: *****

The passwords did not match, please try again
Enter the database password on localhost: *******
Enter the Re-enter database password on localhost: *******

Message Server Configuration testing

Installed file /opt/kafka/config/server.properties found.

Already configured on this Appliance, Un-Configure first? (Y/N): Y
Remove Installed Files
Unconfigure Firewall
Deactivate Services

Proceed with Configuration? (Y/N): Y

Message Server Parameters:

Enter the Message Keystore Password: |admin| ss: |manageiq-devel.localdomain| 

Password can not be empty, please try again
Enter the Message Keystore Password: *******
Enter the Re-enter Message Keystore Password: *****

The passwords did not match, please try again
Enter the Message Keystore Password: *******
Enter the Re-enter Message Keystore Password: *******

Fixes https://github.com/ManageIQ/manageiq/issues/23031

miq-bot commented 5 months ago

Checked commit https://github.com/agrare/manageiq-appliance_console/commit/7892d830ae593d9f2fb28a0f8f33b038a13007aa with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint 6 files checked, 0 offenses detected Everything looks fine. :cake: