Update keyvalue.py to be able to add new values without leaking them in the shell history.#5164
Conversation
Add possibility to add a value by using a prompt instead of a parameter. This prevents secrets from being documented/leaked in the shell history.
| instance.user = args.user | ||
|
|
||
| if not args.value: | ||
| instance.value = input("Please insert value for key: ") |
There was a problem hiding this comment.
There is also getpass.getpass() which displays entered value masked on the screen.
But if we go with that approach, we will likely need to ask for confirmation (aka input the secret value twice).
There was a problem hiding this comment.
Is there anything you want to change here or will it be implemented in version 3.5? Nevertheless it is possible to check the value after it was inserted in the key value store.
There was a problem hiding this comment.
In a future PR, I think we could add getpass.getpass() support, but only turn it on if encrypt is True. I think this PR is good enough to merge as is.
|
We just reformatted the code with black. (Hooray!) And this PR got caught in the cross fire too. (Arrgh!) |
4dd01ed to
cd76da9
Compare
| instance.user = args.user | ||
|
|
||
| if not args.value: | ||
| instance.value = input("Please insert value for key: ") |
There was a problem hiding this comment.
In a future PR, I think we could add getpass.getpass() support, but only turn it on if encrypt is True. I think this PR is good enough to merge as is.
|
@Kami do you want to approve this? Would be nice, otherwise I have to overwrite this all the time after a Stackstorm upgrade in my local installations. |
Add possibility to add a value by using a prompt instead of a parameter. This prevents secrets from being documented/leaked in the shell history.