Skip to content

Commit 722ebfc

Browse files
authored
Merge branch 'master' into chore/remove-commons-lang-2.6
2 parents 27a9c51 + f067d46 commit 722ebfc

File tree

51 files changed

+1240
-718
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1240
-718
lines changed

.github/workflows/announce-lts-rc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
discourse-author-username: jenkins-release-bot
1818
discourse-category: 23
1919
- name: Post on mailing list
20-
uses: dawidd6/action-send-mail@6e71c855c9a091d80a519621b9fd3e8d252ca40c # v7
20+
uses: dawidd6/action-send-mail@62a2d05b79935ad4fb90ce9079928099579c14ac # v9
2121
with:
2222
server_address: smtp.gmail.com
2323
server_port: 465

.stylelintrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ module.exports = {
1717
"number-max-precision": 5,
1818
"no-duplicate-selectors": null,
1919
"hue-degree-notation": "number",
20+
"scss/operator-no-newline-after": null,
2021
},
2122
};

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ axes.values().combinations {
7171
}
7272
int retryCount = 0
7373
retry(conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()], count: 2) {
74-
if (retryCount == 1 && platform == 'windows' ) {
74+
if (retryCount == 1) {
7575
agentContainerLabel = agentContainerLabel + '-nonspot'
7676
}
7777
// Increment before allocating the node in case it fails

ath.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -o xtrace
66
cd "$(dirname "$0")"
77

88
# https://github.com/jenkinsci/acceptance-test-harness/releases
9-
export ATH_VERSION=6535.v65db_170d2a_03
9+
export ATH_VERSION=6536.vedb_8c398315e
1010

1111
if [[ $# -eq 0 ]]; then
1212
export JDK=21

bom/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ THE SOFTWARE.
4141
<commons-fileupload2.version>2.0.0-M4</commons-fileupload2.version>
4242
<groovy.version>2.4.21</groovy.version>
4343
<jelly.version>1.1-jenkins-20250731</jelly.version>
44-
<stapler.version>2065.v7db_c1fcf0a_d0</stapler.version>
44+
<stapler.version>2074.v6ff4fa_fccff7</stapler.version>
4545
</properties>
4646

4747
<dependencyManagement>
@@ -109,7 +109,7 @@ THE SOFTWARE.
109109
<dependency>
110110
<groupId>commons-codec</groupId>
111111
<artifactId>commons-codec</artifactId>
112-
<version>1.20.0</version>
112+
<version>1.21.0</version>
113113
</dependency>
114114
<dependency>
115115
<groupId>commons-collections</groupId>

cli/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<url>https://github.com/jenkinsci/jenkins</url>
1616

1717
<properties>
18-
<mina-sshd.version>2.16.0</mina-sshd.version>
18+
<mina-sshd.version>2.17.1</mina-sshd.version>
1919
<!-- Filled in by jacoco-maven-plugin -->
2020
<jacocoSurefireArgs />
2121
</properties>

core/src/main/java/hudson/Functions.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
import jenkins.model.details.Detail;
171171
import jenkins.model.details.DetailFactory;
172172
import jenkins.model.details.DetailGroup;
173+
import jenkins.telemetry.impl.PasswordMasking;
173174
import jenkins.util.SystemProperties;
174175
import org.apache.commons.jelly.JellyContext;
175176
import org.apache.commons.jelly.JellyTagException;
@@ -2256,32 +2257,64 @@ public String getPasswordValue(Object o) {
22562257
if (o instanceof Secret || Secret.BLANK_NONSECRET_PASSWORD_FIELDS_WITHOUT_ITEM_CONFIGURE) {
22572258
if (req != null) {
22582259
if (NON_RECURSIVE_PASSWORD_MASKING_PERMISSION_CHECK) {
2260+
List<Ancestor> ancestors = req.getAncestors();
2261+
String closestAncestor = ancestors.isEmpty() ? "unknown" :
2262+
ancestors.getLast().getObject().getClass().getName();
2263+
22592264
Item item = req.findAncestorObject(Item.class);
22602265
if (item != null && !item.hasPermission(Item.CONFIGURE)) {
2266+
PasswordMasking.recordMasking(
2267+
item.getClass().getName(),
2268+
closestAncestor,
2269+
getJellyViewsInformationForCurrentRequest()
2270+
);
22612271
return "********";
22622272
}
22632273
Computer computer = req.findAncestorObject(Computer.class);
22642274
if (computer != null && !computer.hasPermission(Computer.CONFIGURE)) {
2275+
PasswordMasking.recordMasking(
2276+
computer.getClass().getName(),
2277+
closestAncestor,
2278+
getJellyViewsInformationForCurrentRequest()
2279+
);
22652280
return "********";
22662281
}
22672282
} else {
22682283
List<Ancestor> ancestors = req.getAncestors();
2284+
String closestAncestor = ancestors.isEmpty() ? "unknown" :
2285+
ancestors.getLast().getObject().getClass().getName();
2286+
22692287
for (Ancestor ancestor : Iterators.reverse(ancestors)) {
22702288
Object type = ancestor.getObject();
22712289
if (type instanceof Item item) {
22722290
if (!item.hasPermission(Item.CONFIGURE)) {
2291+
PasswordMasking.recordMasking(
2292+
item.getClass().getName(),
2293+
closestAncestor,
2294+
getJellyViewsInformationForCurrentRequest()
2295+
);
22732296
return "********";
22742297
}
22752298
break;
22762299
}
22772300
if (type instanceof Computer computer) {
22782301
if (!computer.hasPermission(Computer.CONFIGURE)) {
2302+
PasswordMasking.recordMasking(
2303+
computer.getClass().getName(),
2304+
closestAncestor,
2305+
getJellyViewsInformationForCurrentRequest()
2306+
);
22792307
return "********";
22802308
}
22812309
break;
22822310
}
22832311
if (type instanceof View view) {
22842312
if (!view.hasPermission(View.CONFIGURE)) {
2313+
PasswordMasking.recordMasking(
2314+
view.getClass().getName(),
2315+
closestAncestor,
2316+
getJellyViewsInformationForCurrentRequest()
2317+
);
22852318
return "********";
22862319
}
22872320
break;

core/src/main/java/hudson/diagnosis/ReverseProxySetupMonitor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.util.logging.Logger;
3535
import jenkins.model.Jenkins;
3636
import jenkins.security.stapler.StaplerDispatchable;
37+
import jenkins.util.ClientHttpRedirect;
3738
import org.jenkinsci.Symbol;
3839
import org.kohsuke.accmod.Restricted;
3940
import org.kohsuke.accmod.restrictions.DoNotUse;
@@ -127,7 +128,7 @@ public HttpResponse doAct(@QueryParameter String no) throws IOException {
127128
// of course the irony is that this redirect won't work
128129
return HttpResponses.redirectViaContextPath("/manage");
129130
} else {
130-
return new HttpRedirect("https://www.jenkins.io/redirect/troubleshooting/broken-reverse-proxy");
131+
return new ClientHttpRedirect("https://www.jenkins.io/redirect/troubleshooting/broken-reverse-proxy");
131132
}
132133
}
133134

core/src/main/java/hudson/security/csrf/DefaultCrumbIssuer.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@
2424
import java.util.logging.Logger;
2525
import jenkins.model.Jenkins;
2626
import jenkins.security.HexStringConfidentialKey;
27+
import jenkins.util.ClientHttpRedirect;
2728
import jenkins.util.SystemProperties;
2829
import net.sf.json.JSONObject;
2930
import org.jenkinsci.Symbol;
3031
import org.kohsuke.accmod.Restricted;
3132
import org.kohsuke.accmod.restrictions.NoExternalUse;
3233
import org.kohsuke.stapler.DataBoundConstructor;
34+
import org.kohsuke.stapler.HttpResponse;
35+
import org.kohsuke.stapler.HttpResponses;
3336
import org.kohsuke.stapler.QueryParameter;
3437
import org.kohsuke.stapler.StaplerRequest2;
35-
import org.kohsuke.stapler.StaplerResponse2;
3638
import org.kohsuke.stapler.verb.POST;
3739
import org.springframework.security.core.Authentication;
3840

@@ -181,15 +183,14 @@ public String getDisplayName() {
181183
}
182184

183185
@POST
184-
public void doAct(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter String learn, @QueryParameter String dismiss) throws IOException, ServletException {
186+
public HttpResponse doAct(StaplerRequest2 req, @QueryParameter String learn, @QueryParameter String dismiss) throws IOException, ServletException {
185187
if (learn != null) {
186-
rsp.sendRedirect("https://www.jenkins.io/redirect/csrf-protection/");
187-
return;
188+
return new ClientHttpRedirect("https://www.jenkins.io/redirect/csrf-protection/");
188189
}
189190
if (dismiss != null) {
190191
disable(true);
191192
}
192-
rsp.forwardToPreviousPage(req);
193+
return HttpResponses.forwardToPreviousPage();
193194
}
194195
}
195196

core/src/main/java/hudson/util/HttpResponses.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.io.IOException;
3232
import java.nio.charset.StandardCharsets;
3333
import java.util.Map;
34+
import jenkins.util.ClientHttpRedirect;
3435
import net.sf.json.JSONArray;
3536
import net.sf.json.JSONObject;
3637
import org.kohsuke.stapler.HttpResponse;
@@ -51,6 +52,16 @@ public static HttpResponse staticResource(File f) throws IOException {
5152
return staticResource(f.toURI().toURL());
5253
}
5354

55+
/**
56+
* Redirect to the given URL via a client-side JS/meta tag redirect.
57+
* @param url the URL to redirect to
58+
* @return the HttpResponse
59+
* @since TODO
60+
*/
61+
public static HttpResponse clientRedirectTo(String url) {
62+
return new ClientHttpRedirect(url);
63+
}
64+
5465
/**
5566
* Create an empty "ok" response.
5667
*

0 commit comments

Comments
 (0)