mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 02:19:58 -03:30
remove credential_type iteration, explicitly check for encyption with startswith
This commit is contained in:
parent
2c1a39233e
commit
c554c10c5c
@ -32,13 +32,11 @@ def _credentials(apps):
|
||||
utils.get_current_apps = lambda: apps
|
||||
for credential in apps.get_model('main', 'Credential').objects.all():
|
||||
for field_name, value in credential.inputs.items():
|
||||
if field_name in credential.credential_type.inputs.get('fields', []):
|
||||
value = getattr(credential, field_name)
|
||||
if value.startswith('$encrypted$AESCBC$'):
|
||||
continue
|
||||
elif value.startswith('$encrypted$AES$'):
|
||||
value = decrypt_field(credential, field_name)
|
||||
credential.inputs[field_name] = value
|
||||
if value.startswith('$encrypted$AESCBC$'):
|
||||
continue
|
||||
elif value.startswith('$encrypted$AES$'):
|
||||
value = decrypt_field(credential, field_name)
|
||||
credential.inputs[field_name] = value
|
||||
credential.save()
|
||||
finally:
|
||||
utils.get_current_apps = orig_current_apps
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user