Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52713

Broken output when secret text starts with whitespace

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Operating System: Host=macOS 10.13.6 Guest=jenkinsci/blueocean on Docker
      Plugin: Credentials Binding Plugin v1.16

      I found credentials-binding-plugin prints raw text when use secret text start with whitespace (like " secret") .

      Here is my sample pipeline script:

       

      node {
          withCredentials([string(credentialsId: 'SAMPLE_CREDENTIAL', variable: 'SAMPLE_CREDENTIAL')]) {
              sh 'echo $SAMPLE_CREDENTIAL'
          }
      }
      

      All output:

      Started by user user
      Running in Durability level: MAX_SURVIVABILITY
      [Pipeline] node
      Running on Jenkins in /var/jenkins_home/workspace/print_credential_pipeline
      [Pipeline] {
      [Pipeline] withCredentials
      [Pipeline] {
      [Pipeline] sh
      [print_credential_pipeline] Running shell script
      + echo****
      credential test
      {{[Pipeline] }}}
      [Pipeline] // withCredentials
      {{[Pipeline] }}}
      [Pipeline] // node
      [Pipeline] End of Pipeline
      Finished: SUCCESS

            Unassigned Unassigned
            mtgto Satoshi Goto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: