mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
Fix secret lookup links when credentials are copied
- When a credential that contains secret lookups (e.g. HashiCorp Vault Secret Lookup) is copied, the lookup fields are not properly copied - This change adds the necessary fields to FIELDS_TO_PRESERVE_AT_COPY for both Credential and CredentialInputSource classes to ensure a proper copy
This commit is contained in:
@@ -86,6 +86,7 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin):
|
|||||||
unique_together = (('organization', 'name', 'credential_type'))
|
unique_together = (('organization', 'name', 'credential_type'))
|
||||||
|
|
||||||
PASSWORD_FIELDS = ['inputs']
|
PASSWORD_FIELDS = ['inputs']
|
||||||
|
FIELDS_TO_PRESERVE_AT_COPY = ['input_sources']
|
||||||
|
|
||||||
credential_type = models.ForeignKey(
|
credential_type = models.ForeignKey(
|
||||||
'CredentialType',
|
'CredentialType',
|
||||||
@@ -1162,6 +1163,8 @@ class CredentialInputSource(PrimordialModel):
|
|||||||
unique_together = (('target_credential', 'input_field_name'),)
|
unique_together = (('target_credential', 'input_field_name'),)
|
||||||
ordering = ('target_credential', 'source_credential', 'input_field_name',)
|
ordering = ('target_credential', 'source_credential', 'input_field_name',)
|
||||||
|
|
||||||
|
FIELDS_TO_PRESERVE_AT_COPY = ['source_credential', 'metadata', 'input_field_name']
|
||||||
|
|
||||||
target_credential = models.ForeignKey(
|
target_credential = models.ForeignKey(
|
||||||
'Credential',
|
'Credential',
|
||||||
related_name='input_sources',
|
related_name='input_sources',
|
||||||
|
|||||||
Reference in New Issue
Block a user