mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
Added base tss plugin code. Not tested
This commit is contained in:
parent
d6621470b3
commit
f06c6d349c
45
awx/main/credential_plugins/tss.py
Normal file
45
awx/main/credential_plugins/tss.py
Normal file
@ -0,0 +1,45 @@
|
||||
from .plugin import CredentialPlugin
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from thycotic.secrets.server import SecretServer, PasswordGrantAuthorizer
|
||||
|
||||
tss_inputs = {
|
||||
'fields': [
|
||||
{
|
||||
'id': 'server_url',
|
||||
'label': _('Secret Server URL'),
|
||||
'help_text': _(''),
|
||||
'type': 'string',
|
||||
},
|
||||
{
|
||||
'id': 'username',
|
||||
'label': _('Username'),
|
||||
'help_text': _(''),
|
||||
'type': 'string',
|
||||
},
|
||||
{
|
||||
'id': 'password',
|
||||
'label': _('Password'),
|
||||
'help_text': _(''),
|
||||
'type': 'string',
|
||||
'secret': True,
|
||||
},
|
||||
],
|
||||
'metadata': [
|
||||
{
|
||||
'id': 'secret_id',
|
||||
'label': _('Secret ID'),
|
||||
'help_text': _(''),
|
||||
'type': 'int',
|
||||
},
|
||||
],
|
||||
'required': ['server_url', 'secret_id', 'username', 'password'],
|
||||
}
|
||||
|
||||
|
||||
authorizer = PasswordGrantAuthorizer(
|
||||
f"{tss_inputs['fields'][0]}", f"{tss_inputs['fields'][1]}", f"{tss_inputs['fields'][2]}" # server_url # username # password
|
||||
)
|
||||
|
||||
|
||||
tss_plugin = CredentialPlugin('Thycotic Secret Server', inputs=tss_inputs, backend=SecretServer(authorizer).get_secret(tss_inputs['metadata'][0]))
|
||||
Loading…
x
Reference in New Issue
Block a user