jenkinsci / jenkinsci/git-client-plugin
[JENKINS-57936] Parameters not expanded in username or password portion of https git URL
- Dominant language
- Java
- Stars
- 152
- Forks
- 402
- Avg merge
- 6h 47m
- Merged PRs (30d)
- 4
Description
When a parameterized job attempts to use the value of the parameter as the username or password of an https based git repository URL, the git client plugin does not expand the parameter reference. If a string parameter USERNAME and a password parameter PASSWORD are defined in either a Freestyle or a Pipeline job, references to those variables are not expanded in the username and password portion of the repository URL.
```
https://${USERNAME}:${PASSWORD}@github.com/${USERNAME}/secret-repo.git
```
becomes:
```
https://${USERNAME}:${PASSWORD}@github.com/MarkEWaite/secret-repo.git
```
Notice that the USERNAME parameter is replaced in some parts of the URL, but not in all parts of the URL.
Dear Jenkins users,
I'm use Jenkins 2.164.3 and trying to clone a repository with Git Plugin I get the error " authentication failed", because for some reason git plugin add "%24" in front of my password read from password parameter.
I read from ticket JENKINS-20533">JENKINS-20533
It was an old bug of 5 years ago of very old git plugin, but now should be solved!
Could you help me? Thanks.
---
Originally reported by
unrue, imported from: Parameters not expanded in username or password portion of https git URL
unrue
Raw content of original issue
When a parameterized job attempts to use the value of the parameter as the username or password of an https based git repository URL, the git client plugin does not expand the parameter reference. If a string parameter USERNAME and a password parameter PASSWORD are defined in either a Freestyle or a Pipeline job, references to those variables are not expanded in the username and password portion of the repository URL.
https://${USERNAME}:${PASSWORD}@github.com/${USERNAME}/secret-repo.gitbecomes:
https://${USERNAME}:${PASSWORD}@github.com/MarkEWaite/secret-repo.gitNotice that the USERNAME parameter is replaced in some parts of the URL, but not in all parts of the URL.
Dear Jenkins users,
I'm use Jenkins 2.164.3 and trying to clone a repository with Git Plugin I get the error " authentication failed", because for some reason git plugin add "%24" in front of my password read from password parameter.
I read from ticket
JENKINS-20533It was an old bug of 5 years ago of very old git plugin, but now should be solved!
Could you help me? Thanks.
- environment:
Jenkins 2.164.3 git plugin 3.10.0 git-client 2.7.7
1 attachment
- [parameter-values-visible-in-build-detail.png](https://issues.jenkins.io/secure/attachment/48869/parameter-values-visible-in-build-detail.png)
> 
Contributor guide
Assessment
This issue has not been assessed yet.