mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
enforce strings for secret password inputs on Credentials
see: https://github.com/ansible/ansible-tower/issues/7898
This commit is contained in:
parent
bd2f1568fb
commit
82e41b40bb
@ -499,6 +499,12 @@ class CredentialInputField(JSONSchemaField):
|
||||
v != '$encrypted$',
|
||||
model_instance.pk
|
||||
]):
|
||||
if not isinstance(getattr(model_instance, k), six.string_types):
|
||||
raise django_exceptions.ValidationError(
|
||||
_('secret values must be of type string, not {}').format(type(v).__name__),
|
||||
code='invalid',
|
||||
params={'value': v},
|
||||
)
|
||||
decrypted_values[k] = utils.decrypt_field(model_instance, k)
|
||||
else:
|
||||
decrypted_values[k] = v
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user