jenkinsci / jenkinsci/credentials-binding-plugin

[JENKINS-60700] Credentials Binding Plugin binds to partial string matches

Open
#476 0 comments 0 reactions 0 assignees View on GitHub
component:credentials-binding-plugin imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
57
Forks
108
PR merge metrics
No merged PRs in 30d

Description

Same as JENKINS-43032">JENKINS-43032, except the value I bound to a username in withCredentials is being bound to a string not related to the binding.  

ex.

CHART_NAME=ingestion-tracking

value of DATASOURCE_USERNAME = ingestion

withCredentials([usernamePassword(credentialsId: "${DATASOURCE_CREDS}", passwordVariable: 'DATASOURCE_PASSWORD', usernameVariable: 'DATASOURCE_USERNAME')

]) {

  sh "echo ${DATASOURCE_USERNAME}"

  sh "echo ${CHART_NAME}"

}

will yield:

****

****-tracking

 

I expect:

****

ingestion-tracking

 

---
Originally reported by timmerkt_perspecta, imported from: Credentials Binding Plugin binds to partial string matches


  • status: Open
  • priority: Minor
  • component(s): credentials-binding-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 3
  • imported: 20251211-141027

Raw content of original issue

Same as JENKINS-43032, except the value I bound to a username in withCredentials is being bound to a string not related to the binding.  

ex.

CHART_NAME=ingestion-tracking

value of DATASOURCE_USERNAME = ingestion

withCredentials([usernamePassword(credentialsId: "${DATASOURCE_CREDS}", passwordVariable: 'DATASOURCE_PASSWORD', usernameVariable: 'DATASOURCE_USERNAME')
]) {
  sh "echo ${DATASOURCE_USERNAME}"

  sh "echo ${CHART_NAME}"
}

will yield:
****
****-tracking

 

I expect:
****

ingestion-tracking

 

environment

```
credentials-binding-plugin 1.20

Jenkins 2.190.1
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.