-
-
Notifications
You must be signed in to change notification settings - Fork 746
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
Update keyvalue.py to be able to add new values without leaking them in the shell history. #5164
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.scope = args.scope | ||
instance.user = args.user | ||
|
||
if not args.value: | ||
instance.value = input("Please insert value for key: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.scope = args.scope | ||
instance.user = args.user | ||
|
||
if not args.value: | ||
instance.value = input("Please insert value for key: ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wingiti The lint checks are failing as there is trailing space on the CHANGELOG.rst.
Could you amend, and check if you have signed the CLA (there was a new version issued, so you may have to re-sign).
Many thanks.
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.