mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 00:37:37 -02:30
properly sanitize encrypted default passwords in JT.survey_spec
see: https://github.com/ansible/ansible-tower/issues/7259
This commit is contained in:
committed by
Matthew Jones
parent
f2d46baf09
commit
82d05e0a10
@@ -240,6 +240,17 @@ class SurveyJobTemplateMixin(models.Model):
|
||||
errors += self._survey_element_validation(survey_element, data)
|
||||
return errors
|
||||
|
||||
def display_survey_spec(self):
|
||||
'''
|
||||
Hide encrypted default passwords in survey specs
|
||||
'''
|
||||
survey_spec = self.survey_spec.copy() if self.survey_spec else {}
|
||||
for field in survey_spec.get('spec', []):
|
||||
if field.get('type') == 'password':
|
||||
if 'default' in field and field['default']:
|
||||
field['default'] = '$encrypted$'
|
||||
return survey_spec
|
||||
|
||||
|
||||
class SurveyJobMixin(models.Model):
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user