From 2d05154fb4ba61e8d364cda6fd32f630c85427a1 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sun, 5 Nov 2023 09:08:21 -0700 Subject: [PATCH] Use proxy.getSecretPassword(), not deprecated proxy.getPassword() (#1072) 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. --- .../java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java index adef73973f..f27474cb78 100644 --- a/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java +++ b/src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java @@ -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(); } } try {