0

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): Run build with parameters

Already completed build (history of the parameters with which the build was launched): Already completed build

        [
            $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\']
                        }

                    '''
                ],
            ]
        ],
rensar
  • 11
  • 3

1 Answers1

0

Would you consider using password parameter type?

    parameters {
        password(name: 'YourSuperPassword', defaultValue: 'blah', description: 'You super secret password')
    }
Iterokun
  • 184
  • 6
  • I need to show this option only if checkbox is selected by the service for which this password is set. This does not allow adding display conditions – rensar Sep 02 '23 at 09:05
  • Your other option is `input` step. I’m not aware of plug-ins that can do exactly what you want, sorry. – Iterokun Sep 02 '23 at 19:04