Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require Jenkins 2.479.1 or newer -- DRAFT - DO NOT MERGE #140

Closed
Closed
2 changes: 1 addition & 1 deletion .mvn/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.7</version>
<version>1.8</version>
</extension>
</extensions>
12 changes: 10 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
// Build the plugin using https://github.com/jenkins-infra/pipeline-library
buildPlugin(jdkVersions: [11,17])
/*
See the documentation for more options:
https://github.com/jenkins-infra/pipeline-library/
*/
buildPlugin(
useContainerAgent: true, // Set to `false` if you need to use Docker for containerized tests
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
])
21 changes: 16 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.79</version>
<version>5.2</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -43,15 +43,27 @@
<url>https://github.com/${gitHubRepo}</url>
</scm>
<properties>
<revision>1.7.8</revision>
<revision>1.8.0</revision>
<changelist>-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/reverse-proxy-auth-plugin</gitHubRepo>
<jenkins.version>2.387.3</jenkins.version>
<jenkins.baseline>2.479</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<spotbugs.effort>Max</spotbugs.effort>
<spotbugs.failOnError>true</spotbugs.failOnError>
<spotless.check.skip>false</spotless.check.skip>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>3613.v584fca_12cf5c</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<!-- to appear earlier in the test CP for purposes of PCT -->
Expand Down Expand Up @@ -121,7 +133,6 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>mailer</artifactId>
<version>463.vedf8358e006b_</version>
</dependency>
</dependencies>

Expand All @@ -144,7 +155,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.3.1</version>
<version>3.4.0</version>
<configuration>
<configLocation>google_checks.xml</configLocation>
<failOnViolation>true</failOnViolation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
import hudson.util.FormValidation;
import hudson.util.Scrambler;
import hudson.util.Secret;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
Expand All @@ -61,13 +68,6 @@
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import jenkins.model.Jenkins;
import jenkins.security.ApiTokenProperty;
import org.acegisecurity.Authentication;
Expand Down Expand Up @@ -103,7 +103,7 @@
import org.jenkinsci.plugins.reverse_proxy_auth.service.ProxyLDAPUserDetailsService;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerRequest2;
import org.kohsuke.stapler.verb.POST;
import org.springframework.dao.DataAccessException;

Expand Down Expand Up @@ -225,6 +225,7 @@
* CN e.g. <code>GroupDisplayName={0}</code> here you can configure that this (<code>
* GroupDisplayName</code>) or another field should be used when looking for a users groups.
*/
@SuppressFBWarnings(value = "PA_PUBLIC_PRIMITIVE_ATTRIBUTE", justification = "Preserve the public API")
public String groupNameAttribute;

/**
Expand Down Expand Up @@ -594,7 +595,7 @@
public void destroy() {}
};
Filter defaultFilter = super.createFilter(filterConfig);
return new ChainedServletFilter(defaultFilter, filter);
return new ChainedServletFilter2(defaultFilter, filter);
}

private ForwardedUserData retrieveForwardedData(HttpServletRequest r) {
Expand All @@ -618,9 +619,20 @@
}

@Override
public String getPostLogOutUrl(StaplerRequest req, Authentication auth) {
public String getPostLogOutUrl2(StaplerRequest2 req, org.springframework.security.core.Authentication auth) {
if (customLogOutUrl == null) {
return super.getPostLogOutUrl(req, auth);
return super.getPostLogOutUrl2(req, auth);
} else {
return customLogOutUrl;
}
}

@SuppressFBWarnings(value = "BC_UNCONFIRMED_CAST", justification = "Temporary to allow testing by others")
public String getPostLogOutUrl2(StaplerRequest2 req, Authentication auth) {
if (customLogOutUrl == null) {
org.springframework.security.core.Authentication auth6 =
(org.springframework.security.core.Authentication) auth;
return super.getPostLogOutUrl2(req, auth6);

Check warning on line 635 in src/main/java/org/jenkinsci/plugins/reverse_proxy_auth/ReverseProxySecurityRealm.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 624-635 are not covered by tests
} else {
return customLogOutUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}

public void setMessageSource(@NonNull MessageSource messageSource) {
Assert.notNull("Message source must not be null");
Assert.notNull(messageSource, "Message source must not be null");

Check warning on line 44 in src/main/java/org/jenkinsci/plugins/reverse_proxy_auth/auth/DefaultReverseProxyAuthenticator.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 44 is not covered by tests
messages = new MessageSourceAccessor(messageSource);
}

Expand Down
Loading