Skip to content
Open
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
28 changes: 14 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.1</version>
<version>3.16.0</version>
</plugin>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.4</version>
<version>3.6.1</version>
<executions>
<execution>
<goals>
Expand All @@ -46,11 +46,11 @@
<plugin>
<groupId>io.jooby</groupId>
<artifactId>jooby-maven-plugin</artifactId>
<version>4.0.11</version>
<version>4.6.0</version>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.1</version>
<version>3.6.2</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -83,14 +83,14 @@
<dependency>
<groupId>io.jooby</groupId>
<artifactId>jooby-bom</artifactId>
<version>4.0.11</version>
<version>4.6.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.40.13</version>
<version>2.57.8</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -106,17 +106,17 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.25.4</version>
<version>2.26.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>2.25.3</version>
<version>2.26.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-iostreams</artifactId>
<version>2.25.3</version>
<version>2.26.1</version>
</dependency>
<dependency>
<groupId>com.lmax</groupId>
Expand All @@ -127,17 +127,17 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.5.0-jre</version>
<version>33.7.2-jre</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.13.2</version>
<version>2.15.0</version>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.2.3</version>
<version>3.3.1</version>
</dependency>

<dependency>
Expand All @@ -148,7 +148,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.51.1.0</version>
<version>3.54.1.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -177,7 +177,7 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.14.1</version>
<version>6.1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/me/lucko/bytebin/http/GetHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
import me.lucko.bytebin.util.TokenGenerator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.time.Instant;
import java.util.List;
Expand Down Expand Up @@ -71,7 +69,7 @@ public GetHandler(BytebinServer server, LogHandler logHandler, RateLimiter rateL
}

@Override
public CompletableFuture<byte[]> apply(@Nonnull Context ctx) {
public CompletableFuture<byte[]> apply(Context ctx) {
// get the requested path
String path = ctx.path("id").value();
if (path.trim().isEmpty() || TokenGenerator.INVALID_TOKEN_PATTERN.matcher(path).find()) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/me/lucko/bytebin/http/MetricsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@
import io.jooby.exception.StatusCodeException;
import io.prometheus.client.CollectorRegistry;
import io.prometheus.client.exporter.common.TextFormat;

import javax.annotation.Nonnull;
import java.io.OutputStreamWriter;

public final class MetricsHandler implements Route.Handler {

@Override
public Context apply(@Nonnull Context ctx) throws Exception {
public Context apply(Context ctx) throws Exception {
// deny requests via the reverse proxy
if (ctx.header("X-Forwarded-For").isPresent()) {
throw new StatusCodeException(StatusCode.UNAUTHORIZED);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/me/lucko/bytebin/http/PostHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
import me.lucko.bytebin.util.TokenGenerator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.annotation.Nonnull;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -91,7 +89,7 @@ public PostHandler(BytebinServer server, LogHandler logHandler, RateLimiter rate
}

@Override
public String apply(@Nonnull Context ctx) {
public String apply(Context ctx) {
byte[] content = getBodyAsByteArray(ctx, (int) this.maxContentLength);

// ensure something was actually posted
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/me/lucko/bytebin/http/UpdateHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import me.lucko.bytebin.util.TokenGenerator;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.annotation.Nonnull;
import java.util.Date;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -75,7 +73,7 @@ public UpdateHandler(BytebinServer server, LogHandler logHandler, RateLimiter ra
}

@Override
public CompletableFuture<Void> apply(@Nonnull Context ctx) {
public CompletableFuture<Void> apply(Context ctx) {
// get the requested path
String path = ctx.path("id").value();
if (path.trim().isEmpty() || TokenGenerator.INVALID_TOKEN_PATTERN.matcher(path).find()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import me.lucko.bytebin.http.BytebinServer;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
Expand All @@ -62,7 +60,7 @@ public BulkDeleteHandler(BytebinServer server, ContentStorageHandler storageHand
}

@Override
public CompletableFuture<Integer> apply(@Nonnull Context ctx) {
public CompletableFuture<Integer> apply(Context ctx) {
String apiKey = ctx.header(HEADER_API_KEY).value("");
if (apiKey.isEmpty() || !this.apiKeys.contains(apiKey)) {
throw new StatusCodeException(StatusCode.UNAUTHORIZED, "API key is invalid");
Expand Down
Loading