Skip to content

Commit

Permalink
Use proxy.getSecretPassword(), not deprecated proxy.getPassword() (#1072
Browse files Browse the repository at this point in the history
)

Thanks to @StefanSpieker for the pointer to
https://ci.jenkins.io/job/Reporting/job/deprecated-usage-in-plugins/
where it shows that proxy.getPassword() is the only deprecated core API
used in the git client plugin.  Easy to fix.

Not tested by automation.

Tested interactively by temporarily adding a logging statement to report
the value of userInfo after the assignment.  I defined a proxy in the
"Advanced settings" of the plugin manager page, then attempted to clone a
git repository over https.  The logging statement displayed the expected
value in the userInfo string.  I removed the temporary logging statement.
  • Loading branch information
MarkEWaite authored Nov 5, 2023
1 parent 67d24c9 commit 2d05154
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2168,7 +2168,7 @@ private String launchCommandWithCredentials(
if (StringUtils.isNotEmpty(proxy.getUserName())) {
userInfo = proxy.getUserName();
if (StringUtils.isNotEmpty(proxy.getPassword())) {
userInfo += ":" + proxy.getPassword();
userInfo += ":" + proxy.getSecretPassword();

Check warning on line 2171 in src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 2171 is not covered by tests
}
}
try {
Expand Down

0 comments on commit 2d05154

Please sign in to comment.