mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Merge pull request #627 from ryanpetrello/fix-7898
enforce strings for secret password inputs on Credentials
This commit is contained in:
commit
eda53eb548
@ -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