diff --git a/changelog.html b/changelog.html
index 1a7a9456540340ef29eef6b1e60d0500832e80cf..06a27b30a75d38e9869f87e5c85c13e4f377b489 100644
--- a/changelog.html
+++ b/changelog.html
@@ -55,6 +55,9 @@ Upcoming changes
+ -
+ Saving Global Jenkins Global Config wipes out the crumb issuer settings in the Global Security Config.
+ (issue 17087)
-
Preview function for textareas using Jenkins markup did not work when CSRF protection was enabled.
(issue 17085)
diff --git a/core/src/main/java/hudson/Functions.java b/core/src/main/java/hudson/Functions.java
index e23502e1ae0a998960d2671648e7024ef9cab8da..a330a042bfba8edad253fa7ec7269e3ba901e92a 100644
--- a/core/src/main/java/hudson/Functions.java
+++ b/core/src/main/java/hudson/Functions.java
@@ -782,6 +782,7 @@ public class Functions {
*
* @param predicate
* Filter the descriptors based on {@link GlobalConfigurationCategory}
+ * @since 1.494
*/
public static Collection getSortedDescriptorsForGlobalConfig(Predicate predicate) {
ExtensionList exts = Jenkins.getInstance().getExtensionList(Descriptor.class);
@@ -807,13 +808,32 @@ public class Functions {
return DescriptorVisibilityFilter.apply(Jenkins.getInstance(),answer);
}
+ /**
+ * Like {@link #getSortedDescriptorsForGlobalConfig(Predicate)} but with a constant truth predicate, to include all descriptors.
+ */
public static Collection getSortedDescriptorsForGlobalConfig() {
return getSortedDescriptorsForGlobalConfig(Predicates.alwaysTrue());
}
+ /**
+ * @deprecated This is rather meaningless.
+ */
+ @Deprecated
public static Collection getSortedDescriptorsForGlobalConfigNoSecurity() {
return getSortedDescriptorsForGlobalConfig(Predicates.not(GlobalSecurityConfiguration.FILTER));
}
+
+ /**
+ * Like {@link #getSortedDescriptorsForGlobalConfig(Predicate)} but for unclassified descriptors only.
+ * @since 1.506
+ */
+ public static Collection getSortedDescriptorsForGlobalConfigUnclassified() {
+ return getSortedDescriptorsForGlobalConfig(new Predicate() {
+ public boolean apply(GlobalConfigurationCategory cat) {
+ return cat instanceof GlobalConfigurationCategory.Unclassified;
+ }
+ });
+ }
private static class Tag implements Comparable {
double ordinal;
diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java
index a11dd3484526217fac3d7390158ee7253a269522..55cef562bc2eacac5228ef5913a0e7930486075c 100755
--- a/core/src/main/java/jenkins/model/Jenkins.java
+++ b/core/src/main/java/jenkins/model/Jenkins.java
@@ -94,6 +94,7 @@ import hudson.DNSMultiCast;
import hudson.DescriptorExtensionList;
import hudson.Extension;
import hudson.ExtensionList;
+import hudson.ExtensionPoint;
import hudson.FilePath;
import hudson.Functions;
import hudson.Launcher;
@@ -110,6 +111,7 @@ import hudson.UDPBroadcastThread;
import hudson.Util;
import static hudson.Util.fixEmpty;
import static hudson.Util.fixNull;
+import hudson.WebAppMain;
import hudson.XmlFile;
import hudson.cli.CLICommand;
import hudson.cli.CliEntryPoint;
@@ -247,6 +249,7 @@ import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import static hudson.init.InitMilestone.*;
+import hudson.security.BasicAuthenticationFilter;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
import java.io.File;
@@ -2702,7 +2705,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
jdks.addAll(req.bindJSONToList(JDK.class,json.get("jdks")));
boolean result = true;
- for( Descriptor> d : Functions.getSortedDescriptorsForGlobalConfig() )
+ for (Descriptor> d : Functions.getSortedDescriptorsForGlobalConfigUnclassified())
result &= configureDescriptor(req,json,d);
version = VERSION;
@@ -2886,7 +2889,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
* Check if the given name is suitable as a name
* for job, view, etc.
*
- * @throws ParseException
+ * @throws Failure
* if the given name is not good
*/
public static void checkGoodName(String name) throws Failure {
@@ -2907,7 +2910,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableTopLevelItemGro
/**
* Makes sure that the given name is good as a job name.
- * @return trimmed name if valid; throws ParseException if not
+ * @return trimmed name if valid; throws Failure if not
*/
private String checkJobName(String name) throws Failure {
checkGoodName(name);
diff --git a/core/src/main/resources/jenkins/model/Jenkins/configure.jelly b/core/src/main/resources/jenkins/model/Jenkins/configure.jelly
index f695d73d9b99757882eca24a0d31308e4c3f28e8..ac7438b4d7fb8ae1f913507d0d00dac7960ca525 100644
--- a/core/src/main/resources/jenkins/model/Jenkins/configure.jelly
+++ b/core/src/main/resources/jenkins/model/Jenkins/configure.jelly
@@ -53,7 +53,7 @@ THE SOFTWARE.
-
+