Fixed it.

This commit is contained in:
Adam Migus 2021-06-29 15:37:36 -04:00
parent b0b295ba1e
commit 7ec56a56e5

View File

@ -1,7 +1,7 @@
from .plugin import CredentialPlugin
from django.utils.translation import ugettext_lazy as _
from thycotic.secrets.server import SecretServer, PasswordGrantAuthorizer
from thycotic.secrets.server import SecretServerV1 as SecretServer, PasswordGrantAuthorizer
tss_inputs = {
'fields': [
@ -30,7 +30,7 @@ tss_inputs = {
'id': 'secret_id',
'label': _('Secret ID'),
'help_text': _('The integer ID of the secret'),
'type': 'int',
'type': 'string',
},
],
'required': ['server_url', 'username', 'password', 'secret_id'],
@ -40,6 +40,6 @@ tss_plugin = CredentialPlugin(
'Thycotic Secret Server',
tss_inputs,
lambda **kwargs: SecretServer(
PasswordGrantAuthorizer(**{k: v for (k, v) in kwargs.items() if k in [field['id'] for field in tss_inputs['fields']]})
kwargs['server_url'], PasswordGrantAuthorizer(kwargs['server_url'].rstrip('/') + '/oauth2/token', kwargs['username'], kwargs['password'])
).get_secret(kwargs['secret_id']),
)