mirror of
https://github.com/ansible/awx.git
synced 2026-04-09 20:19:21 -02:30
Fixed it.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
from .plugin import CredentialPlugin
|
from .plugin import CredentialPlugin
|
||||||
from django.utils.translation import ugettext_lazy as _
|
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 = {
|
tss_inputs = {
|
||||||
'fields': [
|
'fields': [
|
||||||
@@ -30,7 +30,7 @@ tss_inputs = {
|
|||||||
'id': 'secret_id',
|
'id': 'secret_id',
|
||||||
'label': _('Secret ID'),
|
'label': _('Secret ID'),
|
||||||
'help_text': _('The integer ID of the secret'),
|
'help_text': _('The integer ID of the secret'),
|
||||||
'type': 'int',
|
'type': 'string',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
'required': ['server_url', 'username', 'password', 'secret_id'],
|
'required': ['server_url', 'username', 'password', 'secret_id'],
|
||||||
@@ -40,6 +40,6 @@ tss_plugin = CredentialPlugin(
|
|||||||
'Thycotic Secret Server',
|
'Thycotic Secret Server',
|
||||||
tss_inputs,
|
tss_inputs,
|
||||||
lambda **kwargs: SecretServer(
|
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']),
|
).get_secret(kwargs['secret_id']),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user