Motivation
Printing a user-supplied password again exposes a secret without any benefit. This is especially unnecessary in getpass mode: the password is entered hidden, then printed to the screen.
Changes
Show the password only when rpcauth.py generated it. Do not echo positional or prompted passwords. JSON output and rpcauth generation remain unchanged; CLI output tests were added.
Testing
python3 -m py_compile share/rpcauth/rpcauth.pypython3 -m py_compile test/functional/tool_rpcauth.py./ci/lint.py --lint=py_linttool_rpcauth.pyin an Ubuntu 24.04 container- Manual checks for:
- generated password output
- positional password input
- prompted password input (
-/getpass) --jsonoutput