Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 83 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,74 @@
<properties>
<check.fail-spotbugs>true</check.fail-spotbugs>
<check.spotbugs-exclude-filter-file>spotbugs-exclude.xml</check.spotbugs-exclude-filter-file>
<extra-enforcer-rules.version>1.12.0</extra-enforcer-rules.version>
<guice.version>7.0.0</guice.version>
<jakarta.annotation-api.version>2.1.1</jakarta.annotation-api.version>
<jakarta.inject-api.version>2.0.1</jakarta.inject-api.version>
<jakarta.servlet-api.version>5.0.0</jakarta.servlet-api.version>
<jetty.version>11.0.24</jetty.version>
<killbill-commons.version>0.27.0</killbill-commons.version>
<killbill-platform.version>0.40.13</killbill-platform.version>
<project.build.targetJdk>21</project.build.targetJdk>
<!-- killbill-oss-parent still brings SpotBugs 4.7.2.1, whose ASM stack cannot parse
Java 21 class files. Keep this local override until the parent moves to a
Java-21-capable SpotBugs line. -->
<spotbugs-maven-plugin.version>4.9.8.3</spotbugs-maven-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
</dependency>
<dependency>
<groupId>jakarta.annotation</groupId>
<artifactId>jakarta.annotation-api</artifactId>
<version>${jakarta.annotation-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
<version>${jakarta.inject-api.version}</version>
</dependency>
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${jakarta.servlet-api.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-http</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-io</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.http2</groupId>
<artifactId>http2-server</artifactId>
<version>${jetty.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand All @@ -75,10 +137,6 @@
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-joda</artifactId>
</dependency>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand Down Expand Up @@ -131,18 +189,6 @@
<groupId>org.joda</groupId>
<artifactId>joda-money</artifactId>
</dependency>
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby</artifactId>
</dependency>
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.jooby</groupId>
<artifactId>jooby-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
Expand Down Expand Up @@ -228,26 +274,36 @@
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-clock</artifactId>
<version>${killbill-commons.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb-common</artifactId>
<version>${killbill-commons.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb-mysql</artifactId>
<version>${killbill-commons.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-embeddeddb-postgresql</artifactId>
<version>${killbill-commons.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-jooby</artifactId>
<version>${killbill-commons.version}</version>
</dependency>
<dependency>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-utils</artifactId>
<version>${killbill-commons.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -292,6 +348,17 @@
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>extra-enforcer-rules</artifactId>
<version>${extra-enforcer-rules.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
15 changes: 15 additions & 0 deletions spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,19 @@
<FindBugsFilter>
<Bug pattern="EI_EXPOSE_REP"/>
<Bug pattern="EI_EXPOSE_REP2"/>
<!-- Constructor validates and normalizes input URLs, and the checked exception is part of the public API. -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
<Class name="org.killbill.billing.plugin.api.payment.PluginHostedPaymentPageFormDescriptor"/>
</Match>
<!-- Constructor performs DB metadata and schema resolution eagerly, and SQL failures are part of the public API. -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
<Class name="org.killbill.billing.plugin.dao.PluginDao"/>
</Match>
<!-- Constructor builds SSL/HTTP client state eagerly, and security setup failures are part of the public API. -->
<Match>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
<Class name="org.killbill.billing.plugin.util.http.HttpClient"/>
</Match>
</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.killbill.commons.utils.Strings;
import org.killbill.commons.utils.collect.Iterables;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public abstract class PluginProperties {

// Last one has precedence
Expand Down Expand Up @@ -122,7 +120,6 @@ public static Iterable<PluginProperty> findPluginProperties(final Pattern keyPat
.collect(Collectors.toUnmodifiableSet());
}

@SuppressFBWarnings("WMI_WRONG_MAP_ITERATOR")
public static <K, V> List<PluginProperty> buildPluginProperties(@Nullable final Map<K, V> data) {
if (data == null || data.isEmpty()) {
return Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.jooby.Sse;
import org.jooby.servlet.ServletServletRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@
import java.util.regex.Pattern;

import javax.annotation.Nullable;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.joda.time.LocalDate;
import org.joda.time.format.DateTimeFormat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean;

import javax.servlet.AsyncContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.AsyncContext;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletResponse;

import org.jooby.Sse;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.killbill.billing.plugin.core.resources.jooby;

import javax.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServlet;

import org.jooby.Jooby;
import org.jooby.json.Jackson;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ public void checkServerTrusted(final java.security.cert.X509Certificate[] certs,
}
}

private final SSLContext looseTrustManagerSSLContext = looseTrustManagerSSLContext();

private SSLContext looseTrustManagerSSLContext() {
private static SSLContext buildLooseTrustManagerSSLContext() {
try {
final SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[]{new LooseTrustManager()}, new SecureRandom());
Expand All @@ -60,11 +58,15 @@ private static class SingletonHolder {
public static final SslUtils instance = new SslUtils();
}

private static class LooseTrustManagerSSLContextHolder {
public static final SSLContext instance = buildLooseTrustManagerSSLContext();
}

public static SslUtils getInstance() {
return SingletonHolder.instance;
}

public SSLContext getSSLContext(final boolean acceptAnyCertificate) throws GeneralSecurityException {
return acceptAnyCertificate ? looseTrustManagerSSLContext : SSLContext.getDefault();
return acceptAnyCertificate ? LooseTrustManagerSSLContextHolder.instance : SSLContext.getDefault();
}
}
Loading