The masking of secrets of one char length mangles the output.

      With this credential (Secret = 'a'):

      the following job produces magled output

      #!/usr/bin/env groovy
      pipeline {
          agent any
          stages {
              stage('Check run') {
                  steps {
                      withCredentials([string(credentialsId: 'test-credentials-binding-plugin-masking-secret-text',
                              variable: 'VAR')]) {
                          sh '''
                              echo "VAR.length = ${#VAR}" 
                              echo "This should be masked: VAR = $VAR"
                          '''
                      }
                  }
              }
          }
      } 

      we obtain the following output in the console:

      [Pipeline] withEnv
      [Pipeline] {
      [Pipeline] stage
      [Pipeline] { (Check run)
      [Pipeline] withCredentials
      Masking supported pattern matches of $VAR
      [Pipeline] {
      [Pipeline] sh
      ****+**** ****e****c****h****o**** ****'****V****A****R****.****l****e****n****g****t****h**** ****=**** ****1****'****
      ********V****A****R****.****l****e****n****g****t****h**** ****=**** ****1****
      ********+**** ****e****c****h****o**** ****'****T****h****i****s**** ****s****h****o****u****l****d**** ****b****e**** ****m********s****k****e****d****:**** ****V****A****R**** ****=**** ********'****
      ********T****h****i****s**** ****s****h****o****u****l****d**** ****b****e**** ****m********s****k****e****d****:**** ****V****A****R**** ****=**** ********
      ****[Pipeline] }
      [Pipeline] // withCredentials 

          [JENKINS-72412] Masking of one character secrets mangle output

          Alberto Gallardo created issue -
          Jesse Glick made changes -
          Component/s New: github-branch-source-plugin [ 20858 ]
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-66675 [ JENKINS-66675 ]
          Jesse Glick made changes -
          Assignee New: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Released As New: https://github.com/jenkinsci/credentials-binding-plugin/releases/tag/677.vdc9d38cb_254d
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            jglick Jesse Glick
            agallardo Alberto Gallardo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: