massa
massa copied to clipboard
Hide both secret(private) + public keys by defaut in `wallet_info`
Actual:
command > wallet_info
WARNING: do not share your key
Secret key: S12S57nLY3Mp2Q6ciWZMvAucMyUgdsPPG1m46Ly9ibDh2tqCP3gF
Public key: P1L2bCTc5pYa1HXL5LtGF67kk1z4ehbNZb2xrVbCYaLSKXvmZgZ
Address: A1XCXQ8t5xFqheAmY81Pw2pPT3cti9NZ2JeefzeeWiLyCXJAQ2t (thread 8):
Balance: final=0, candidate=0
Rolls: active=0, final=0, candidate=0
=====
Expected:
command > wallet_info
WARNING: you could display secret(private) + public by adding `--show-all-keys`(For example or remove this line)
Address: A1XCXQ8t5xFqheAmY81Pw2pPT3cti9NZ2JeefzeeWiLyCXJAQ2t (thread 8):
Balance: final=0, candidate=0
Rolls: active=0, final=0, candidate=0
Part of #3166
One approach that might be interesting: oauth2 crates approach. See the secret
function.
From my surface-level understanding, a type can be turned into a secret-type through the use of a macro. This causes the Display
implementation for that type to output [redacted]
instead of the value, but also generates a secret
method to leak the actual value. If this sounds interesting, I can dig around in the code, look around for stand-alone libraries etc. and brief the team when ready.
related to #3369, which addresses this issue in a more general context
Closed as part of #3166