I use a type=password for a dynamic element (used to enter the user's password, which is then used by the ansible for configuration) to hide the entered password from the parameters and it is hidden, however, if you go into the parameters of an already completed build, then the password is written there in clear text.
How to prevent the password from appearing in plaintext in the history of a running build?
Run build with parameters (form for run build):
Already completed build (history of the parameters with which the build was launched):
[
$class: 'DynamicReferenceParameter',
choiceType: 'ET_FORMATTED_HTML',
name: 'mysql_root_password',
omitValueField: true,
referencedParameters: 'SERVICES',
script: [
$class: 'GroovyScript',
script: [
classpath: [],
sandbox: true,
script:
'''
if (SERVICES.contains("mysql")){
return """<input name="value" value="" class="setting-input" type="password">"""
} else {
return [\'Inactive\']
}
'''
],
]
],