mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 19:20:05 -03:30
Introduce a new CredentialTemplate model
Credentials now have a required CredentialType, which defines inputs (i.e., username, password) and injectors (i.e., assign the username to SOME_ENV_VARIABLE at job runtime) This commit only implements the model changes necessary to support the new inputs model, and includes code for the credential serializer that allows backwards-compatible support for /api/v1/credentials/; tasks.py still needs to be updated to actually respect CredentialType injectors. This change *will* break the UI for credentials (because it needs to be updated to use the new v2 endpoint). see: #5877 see: #5876 see: #5805
This commit is contained in:
@@ -321,7 +321,7 @@ try:
|
||||
name='%s Credential %d User %d' % (prefix, credential_id, user_idx),
|
||||
defaults=dict(created_by=next(creator_gen),
|
||||
modified_by=next(modifier_gen)),
|
||||
kind='ssh'
|
||||
credential_type=CredentialType.from_v1_kind('ssh')
|
||||
)
|
||||
credential.admin_role.members.add(user)
|
||||
credentials.append(credential)
|
||||
@@ -344,7 +344,7 @@ try:
|
||||
name='%s Credential %d team %d' % (prefix, credential_id, team_idx),
|
||||
defaults=dict(created_by=next(creator_gen),
|
||||
modified_by=next(modifier_gen)),
|
||||
kind='ssh'
|
||||
credential_type=CredentialType.from_v1_kind('ssh')
|
||||
)
|
||||
credential.admin_role.parents.add(team.member_role)
|
||||
credentials.append(credential)
|
||||
|
||||
Reference in New Issue
Block a user