Skip to content

Commit

Permalink
[JENKINS-73279] Adapt LDAP plugin for Spring Security 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Aug 13, 2024
1 parent 705702d commit db23b25
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 0 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
buildPlugin(
configurations: [
[platform: 'linux', jdk: 11],
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
])
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<apacheds.version>2.0.0.AM25</apacheds.version>
<jenkins.version>2.361.4</jenkins.version>
<!-- TODO JENKINS-73278 https://ci.jenkins.io/job/Core/job/jenkins/job/jakarta/ -->
<jenkins.version>2.472-rc35224.83b_736a_f3fc3</jenkins.version>
<!-- TODO JENKINS-73339 until in parent POM -->
<jenkins-test-harness.version>2250.v03a_1295b_0a_30</jenkins-test-harness.version>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<scm>
Expand Down Expand Up @@ -301,6 +305,12 @@
<scope>import</scope>
<type>pom</type>
</dependency>
<!-- TODO JENKINS-73339 until in parent POM, work around https://github.com/jenkinsci/plugin-pom/issues/936 -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/hudson/security/LDAPSecurityRealm.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.interceptor.RequirePOST;

import edu.umd.cs.findbugs.annotations.CheckForNull;
Expand Down Expand Up @@ -1483,7 +1483,7 @@ public IdStrategy getDefaultIdStrategy() {
}

@Override
public SecurityRealm newInstance(StaplerRequest req, JSONObject formData) throws FormException {
public SecurityRealm newInstance(StaplerRequest2 req, JSONObject formData) throws FormException {
if (!formData.has("configurations")) {
throw new Descriptor.FormException(jenkins.security.plugins.ldap.Messages.LDAPSecurityRealm_AtLeastOne(), "configurations");
} else {
Expand Down Expand Up @@ -1514,7 +1514,7 @@ public SecurityRealm newInstance(StaplerRequest req, JSONObject formData) throws
}

@RequirePOST
public FormValidation doValidate(StaplerRequest req) throws Exception {
public FormValidation doValidate(StaplerRequest2 req) throws Exception {
if (!Jenkins.get().hasPermission(Jenkins.ADMINISTER)) {
// require admin to test
return FormValidation.ok();
Expand Down

0 comments on commit db23b25

Please sign in to comment.