|
|
@ -99,6 +99,8 @@ class VaultCLI(CLI):
|
|
|
|
enc_str_parser.add_argument('-p', '--prompt', dest='encrypt_string_prompt',
|
|
|
|
enc_str_parser.add_argument('-p', '--prompt', dest='encrypt_string_prompt',
|
|
|
|
action='store_true',
|
|
|
|
action='store_true',
|
|
|
|
help="Prompt for the string to encrypt")
|
|
|
|
help="Prompt for the string to encrypt")
|
|
|
|
|
|
|
|
enc_str_parser.add_argument('--show-input', dest='show_string_input', default=False, action='store_true',
|
|
|
|
|
|
|
|
help='Do not hide input when prompted for the string to encrypt')
|
|
|
|
enc_str_parser.add_argument('-n', '--name', dest='encrypt_string_names',
|
|
|
|
enc_str_parser.add_argument('-n', '--name', dest='encrypt_string_names',
|
|
|
|
action='append',
|
|
|
|
action='append',
|
|
|
|
help="Specify the variable name")
|
|
|
|
help="Specify the variable name")
|
|
|
@ -300,8 +302,13 @@ class VaultCLI(CLI):
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: could prompt for which vault_id to use for each plaintext string
|
|
|
|
# TODO: could prompt for which vault_id to use for each plaintext string
|
|
|
|
# currently, it will just be the default
|
|
|
|
# currently, it will just be the default
|
|
|
|
# could use private=True for shadowed input if useful
|
|
|
|
hide_input = not context.CLIARGS['show_string_input']
|
|
|
|
prompt_response = display.prompt(msg)
|
|
|
|
if hide_input:
|
|
|
|
|
|
|
|
msg = "String to encrypt (hidden): "
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
msg = "String to encrypt:"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prompt_response = display.prompt(msg, private=hide_input)
|
|
|
|
|
|
|
|
|
|
|
|
if prompt_response == '':
|
|
|
|
if prompt_response == '':
|
|
|
|
raise AnsibleOptionsError('The plaintext provided from the prompt was empty, not encrypting')
|
|
|
|
raise AnsibleOptionsError('The plaintext provided from the prompt was empty, not encrypting')
|
|
|
|