From 0cc6bf9b60da62875e17dd98214560611c372edb Mon Sep 17 00:00:00 2001 From: Ricky White Date: Fri, 25 Jun 2021 16:48:14 +0000 Subject: [PATCH] Updated backend code --- awx/main/credential_plugins/tss.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awx/main/credential_plugins/tss.py b/awx/main/credential_plugins/tss.py index d5e9752e7f..2c8ab6a18a 100644 --- a/awx/main/credential_plugins/tss.py +++ b/awx/main/credential_plugins/tss.py @@ -33,13 +33,13 @@ tss_inputs = { 'type': 'int', }, ], - 'required': ['server_url', 'secret_id', 'username', 'password'], + 'required': ['server_url', 'username', 'password', 'secret_id'], } -authorizer = PasswordGrantAuthorizer( - f"{tss_inputs['fields'][0]}", f"{tss_inputs['fields'][1]}", f"{tss_inputs['fields'][2]}" # server_url # username # password -) +def tss_backend(**kwargs): + authorizer = PasswordGrantAuthorizer(kwargs['server_url'], kwargs['username'], kwargs['password']) + return SecretServer(authorizer).get_secret(kwargs['secret_id']) -tss_plugin = CredentialPlugin('Thycotic Secret Server', inputs=tss_inputs, backend=SecretServer(authorizer).get_secret(tss_inputs['metadata'][0])) +tss_plugin = CredentialPlugin('Thycotic Secret Server', inputs=tss_inputs, backend=tss_backend)