Merge branch 'master' of https://github.com/jenkinsci/jenkins into previouslyAssignedLabels

This commit is contained in:
Jesse Glick 2025-07-22 07:41:58 -04:00
commit 3dfc55ea69
No known key found for this signature in database
GPG Key ID: 1DDA69D94B624311
6 changed files with 15 additions and 73 deletions

View File

@ -119,7 +119,7 @@ THE SOFTWARE.
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.19.0</version>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>

View File

@ -41,7 +41,6 @@ import hudson.model.Computer;
import hudson.model.Describable;
import hudson.model.Descriptor;
import hudson.model.DescriptorVisibilityFilter;
import hudson.model.Hudson;
import hudson.model.Item;
import hudson.model.ItemGroup;
import hudson.model.Items;
@ -97,11 +96,9 @@ import hudson.util.jna.GNUCLibrary;
import hudson.views.MyViewsTabBar;
import hudson.views.ViewsTabBar;
import hudson.widgets.RenderOnDemandClosure;
import io.jenkins.servlet.ServletExceptionWrapper;
import io.jenkins.servlet.http.CookieWrapper;
import io.jenkins.servlet.http.HttpServletRequestWrapper;
import io.jenkins.servlet.http.HttpServletResponseWrapper;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@ -190,8 +187,6 @@ import org.kohsuke.stapler.RawHtmlArgument;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.StaplerResponse2;
import org.springframework.security.access.AccessDeniedException;
/**
@ -921,11 +916,11 @@ public class Functions {
return buf.toString();
}
public static void checkPermission(Permission permission) throws IOException, ServletException {
public static void checkPermission(Permission permission) {
checkPermission(Jenkins.get(), permission);
}
public static void checkPermission(AccessControlled object, Permission permission) throws IOException, ServletException {
public static void checkPermission(AccessControlled object, Permission permission) {
if (permission != null) {
object.checkPermission(permission);
}
@ -936,7 +931,7 @@ public class Functions {
* degrades gracefully if "it" is not an {@link AccessControlled} object.
* Otherwise it will perform no check and that problem is hard to notice.
*/
public static void checkPermission(Object object, Permission permission) throws IOException, ServletException {
public static void checkPermission(Object object, Permission permission) {
if (permission == null)
return;
@ -961,7 +956,7 @@ public class Functions {
* @param permission
* If null, returns true. This defaulting is convenient in making the use of this method terse.
*/
public static boolean hasPermission(Permission permission) throws IOException, ServletException {
public static boolean hasPermission(Permission permission) {
return hasPermission(Jenkins.get(), permission);
}
@ -969,7 +964,7 @@ public class Functions {
* This version is so that the 'hasPermission' can degrade gracefully
* if "it" is not an {@link AccessControlled} object.
*/
public static boolean hasPermission(Object object, Permission permission) throws IOException, ServletException {
public static boolean hasPermission(Object object, Permission permission) {
if (permission == null)
return true;
if (object instanceof AccessControlled)
@ -986,36 +981,6 @@ public class Functions {
}
}
/**
* @since 2.475
*/
public static void adminCheck(StaplerRequest2 req, StaplerResponse2 rsp, Object required, Permission permission) throws IOException, ServletException {
// this is legacy --- all views should be eventually converted to
// the permission based model.
if (required != null && !Hudson.adminCheck(StaplerRequest.fromStaplerRequest2(req), StaplerResponse.fromStaplerResponse2(rsp))) {
// check failed. commit the FORBIDDEN response, then abort.
rsp.setStatus(HttpServletResponse.SC_FORBIDDEN);
rsp.getOutputStream().close();
throw new ServletException("Unauthorized access");
}
// make sure the user owns the necessary permission to access this page.
if (permission != null)
checkPermission(permission);
}
/**
* @deprecated use {@link #adminCheck(StaplerRequest2, StaplerResponse2, Object, Permission)}
*/
@Deprecated
public static void adminCheck(StaplerRequest req, StaplerResponse rsp, Object required, Permission permission) throws IOException, javax.servlet.ServletException {
try {
adminCheck(StaplerRequest.toStaplerRequest2(req), StaplerResponse.toStaplerResponse2(rsp), required, permission);
} catch (ServletException e) {
throw ServletExceptionWrapper.fromJakartaServletException(e);
}
}
/**
* Infers the hudson installation URL from the given request.
*
@ -1298,7 +1263,7 @@ public class Functions {
*
* @since 2.238
*/
public static boolean hasAnyPermission(Object object, Permission[] permissions) throws IOException, ServletException {
public static boolean hasAnyPermission(Object object, Permission[] permissions) {
if (permissions == null || permissions.length == 0) {
return true;
}
@ -1336,7 +1301,7 @@ public class Functions {
* degrades gracefully if "it" is not an {@link AccessControlled} object.
* Otherwise it will perform no check and that problem is hard to notice.
*/
public static void checkAnyPermission(Object object, Permission[] permissions) throws IOException, ServletException {
public static void checkAnyPermission(Object object, Permission[] permissions) {
if (permissions == null || permissions.length == 0) {
return;
}

View File

@ -42,7 +42,6 @@ import io.jenkins.servlet.ServletContextWrapper;
import io.jenkins.servlet.ServletExceptionWrapper;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.text.NumberFormat;
@ -51,7 +50,6 @@ import java.util.List;
import jenkins.model.Jenkins;
import org.jvnet.hudson.reactor.ReactorException;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.interceptor.RequirePOST;
@ -293,27 +291,6 @@ public class Hudson extends Jenkins {
return Platform.isDarwin();
}
/**
* @deprecated since 2007-12-18.
* Use {@link #checkPermission(hudson.security.Permission)}
*/
@Deprecated
public static boolean adminCheck() throws IOException {
return adminCheck(Stapler.getCurrentRequest(), Stapler.getCurrentResponse());
}
/**
* @deprecated since 2007-12-18.
* Use {@link #checkPermission(hudson.security.Permission)}
*/
@Deprecated
public static boolean adminCheck(StaplerRequest req, StaplerResponse rsp) throws IOException {
if (isAdmin(req)) return true;
rsp.sendError(HttpServletResponse.SC_FORBIDDEN);
return false;
}
/**
* Checks if the current user (for which we are processing the current request)
* has the admin access.

View File

@ -45,7 +45,7 @@
"sass": "1.89.2",
"sass-loader": "16.0.5",
"style-loader": "4.0.0",
"stylelint": "16.21.1",
"stylelint": "16.22.0",
"stylelint-checkstyle-reporter": "1.1.1",
"stylelint-config-standard-scss": "15.0.1",
"webpack": "5.100.2",

View File

@ -390,7 +390,7 @@ THE SOFTWARE.
<!-- dependency of script-security and workflow-support -->
<groupId>io.jenkins.plugins</groupId>
<artifactId>caffeine-api</artifactId>
<version>3.2.0-166.v72a_6d74b_870f</version>
<version>3.2.2-178.v353b_8428ed56</version>
<type>hpi</type>
</artifactItem>

View File

@ -4407,7 +4407,7 @@ __metadata:
sass-loader: "npm:16.0.5"
sortablejs: "npm:1.15.6"
style-loader: "npm:4.0.0"
stylelint: "npm:16.21.1"
stylelint: "npm:16.22.0"
stylelint-checkstyle-reporter: "npm:1.1.1"
stylelint-config-standard-scss: "npm:15.0.1"
tippy.js: "npm:6.3.7"
@ -6729,9 +6729,9 @@ __metadata:
languageName: node
linkType: hard
"stylelint@npm:16.21.1":
version: 16.21.1
resolution: "stylelint@npm:16.21.1"
"stylelint@npm:16.22.0":
version: 16.22.0
resolution: "stylelint@npm:16.22.0"
dependencies:
"@csstools/css-parser-algorithms": "npm:^3.0.5"
"@csstools/css-tokenizer": "npm:^3.0.4"
@ -6773,7 +6773,7 @@ __metadata:
write-file-atomic: "npm:^5.0.1"
bin:
stylelint: bin/stylelint.mjs
checksum: 10c0/32750d764411213d96e24f6a6e12af85f365ad4674214843068b39e02873adae927680c58e3ae14bc9d624899abe330819a53020bf3bd812821c3966678a3663
checksum: 10c0/706ba1f2f8d1c4c55347c2abbab661cf36cd6889af8afd200877cababf7f758e780d0e8a22ed1833542f487aeba08c30964b88dd6764c63953f7f232f5f4f114
languageName: node
linkType: hard