diff --git a/awx/main/credential_plugins/dsv.py b/awx/main/credential_plugins/dsv.py index 7fca6a81f7..8e8f11a98a 100644 --- a/awx/main/credential_plugins/dsv.py +++ b/awx/main/credential_plugins/dsv.py @@ -13,6 +13,13 @@ dsv_inputs = { 'help_text': _('The tenant e.g. "ex" when the URL is https://ex.secretservercloud.com'), 'type': 'string', }, + { + 'id': 'tld', + 'label': _('Top-level Domain (TLD)'), + 'help_text': _('The TLD of the tenant e.g. "com" when the URL is https://ex.secretservercloud.com'), + 'choices': ['ca', 'com', 'com.au', 'com.sg', 'eu'], + 'default': 'com', + }, {'id': 'client_id', 'label': _('Client ID'), 'type': 'string'}, { 'id': 'client_secret', @@ -28,12 +35,6 @@ dsv_inputs = { 'type': 'string', 'help_text': _('The secret path e.g. /test/secret1'), }, - { - 'id': 'expr', - 'label': _('Attribute Expression'), - 'type': 'string', - 'help_text': _('A Python expression on the dict representation of the secret e.g. "data.username"'), - }, ], 'required': ['tenant', 'client_id', 'client_secret', 'path'], } @@ -48,24 +49,8 @@ if settings.DEBUG: } ) -if to_locale(get_language()) != 'en_US': - dsv_inputs['fields'].append( - { - 'id': 'tld', - 'label': _('Top-level Domain (TLD)'), - 'help_text': _('The Top-level domain of the tenant e.g. "com" when the URL is https://ex.secretservercloud.com'), - 'type': 'string', - 'default': 'com', - 'choices': ['ca', 'com', 'com.au', 'com.sg', 'eu'], - } - ) - - dsv_plugin = CredentialPlugin( 'Thycotic DevOps Secrets Vault', dsv_inputs, - lambda **kwargs: eval( - kwargs['expr'], - SecretsVault(**{k: v for (k, v) in kwargs.items() if k in [field['id'] for field in dsv_inputs['fields']]}).get_secret(kwargs['path']), - ), + lambda **kwargs: SecretsVault(**{k: v for (k, v) in kwargs.items() if k in [field['id'] for field in dsv_inputs['fields']]}).get_secret(kwargs['path']), )