mirror of
https://github.com/ansible/awx.git
synced 2026-05-23 16:47:45 -02:30
Scrub passwords from extra vars preview on launch
This commit is contained in:
@@ -37,6 +37,8 @@ export default
|
||||
|
||||
scope.promptData.extraVars = ToJSON(scope.parseType, scope.promptData.prompts.variables.value, false);
|
||||
|
||||
const surveyPasswords = {};
|
||||
|
||||
if (scope.promptData.launchConf.ask_tags_on_launch) {
|
||||
scope.promptData.prompts.tags.value = consolidateTags(scope.promptData.prompts.tags.value, "#job_launch_job_tags");
|
||||
}
|
||||
@@ -69,10 +71,20 @@ export default
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (surveyQuestion.type === 'password' && surveyQuestion.model.toString()!=="") {
|
||||
surveyPasswords[surveyQuestion.variable] = '$encrypted$';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
scope.promptExtraVars = $.isEmptyObject(scope.promptData.extraVars) ? '---' : '---\n' + jsyaml.safeDump(scope.promptData.extraVars);
|
||||
// We don't want to modify the extra vars when we merge them with the survey
|
||||
// password $encrypted$ strings so we clone it
|
||||
const extraVarsClone = _.cloneDeep(scope.promptData.extraVars);
|
||||
// Replace the survey passwords with $encrypted$ to display to the user
|
||||
const cleansedExtraVars = Object.assign(extraVarsClone, surveyPasswords);
|
||||
|
||||
scope.promptExtraVars = $.isEmptyObject(scope.promptData.extraVars) ? '---' : '---\n' + jsyaml.safeDump(cleansedExtraVars);
|
||||
|
||||
ParseTypeChange({
|
||||
scope: scope,
|
||||
|
||||
Reference in New Issue
Block a user