From 262d63744e71d4597da4eb895b9a50a888ff0799 Mon Sep 17 00:00:00 2001 From: Jacob Burroughs Date: Tue, 14 May 2024 07:20:31 -0500 Subject: [PATCH] Address feedback --- src/main/java/org/pac4j/javalin/JavalinContextFactory.java | 6 ++++++ .../java/org/pac4j/javalin/JavalinFrameworkParameters.java | 6 ++++++ src/main/java/org/pac4j/javalin/JavalinWebContext.java | 6 ++++++ .../org/pac4j/javalin/JavalinHttpActionAdapterTest.java | 3 --- .../org/pac4j/javalin/example/ExampleConfigFactory.java | 1 - .../java/org/pac4j/javalin/example/JavalinPac4jExample.java | 1 - 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/pac4j/javalin/JavalinContextFactory.java b/src/main/java/org/pac4j/javalin/JavalinContextFactory.java index 59f8115..3dea436 100644 --- a/src/main/java/org/pac4j/javalin/JavalinContextFactory.java +++ b/src/main/java/org/pac4j/javalin/JavalinContextFactory.java @@ -4,6 +4,12 @@ import org.pac4j.core.context.WebContextFactory; import org.pac4j.core.exception.TechnicalException; +/** + * Build a Javalin context from parameters. + * + * @author Jacob Burroughs + * @since 7.0.0 + */ public class JavalinContextFactory implements WebContextFactory { /** Constant INSTANCE */ public static final WebContextFactory INSTANCE = new JavalinContextFactory(); diff --git a/src/main/java/org/pac4j/javalin/JavalinFrameworkParameters.java b/src/main/java/org/pac4j/javalin/JavalinFrameworkParameters.java index f0627fd..9305ea2 100644 --- a/src/main/java/org/pac4j/javalin/JavalinFrameworkParameters.java +++ b/src/main/java/org/pac4j/javalin/JavalinFrameworkParameters.java @@ -5,6 +5,12 @@ import lombok.Getter; import org.pac4j.core.context.FrameworkParameters; +/** + * Specific Javalin parameters. + * + * @author Jacob Burroughs + * @since 7.0.0 + */ @AllArgsConstructor @Getter public class JavalinFrameworkParameters implements FrameworkParameters { diff --git a/src/main/java/org/pac4j/javalin/JavalinWebContext.java b/src/main/java/org/pac4j/javalin/JavalinWebContext.java index bc1f860..f225741 100644 --- a/src/main/java/org/pac4j/javalin/JavalinWebContext.java +++ b/src/main/java/org/pac4j/javalin/JavalinWebContext.java @@ -10,6 +10,12 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +/** + * Web context that uses the Javalin implementations of parameter handling instead of the servlet ones + * + * @author Jacob Burroughs + * @since 7.0.0 + */ public class JavalinWebContext extends JEEContext { private final Context context; diff --git a/src/test/java/org/pac4j/javalin/JavalinHttpActionAdapterTest.java b/src/test/java/org/pac4j/javalin/JavalinHttpActionAdapterTest.java index 6149532..103474d 100644 --- a/src/test/java/org/pac4j/javalin/JavalinHttpActionAdapterTest.java +++ b/src/test/java/org/pac4j/javalin/JavalinHttpActionAdapterTest.java @@ -1,7 +1,6 @@ package org.pac4j.javalin; import io.javalin.http.*; -import jakarta.servlet.ServletOutputStream; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.BeforeEach; @@ -13,10 +12,8 @@ import org.pac4j.core.exception.http.HttpAction; import org.pac4j.core.exception.http.OkAction; import org.pac4j.core.exception.http.UnauthorizedAction; -import org.pac4j.jee.context.JEEContext; import java.io.IOException; -import java.nio.charset.StandardCharsets; import static org.assertj.core.api.Assertions.*; import static org.mockito.ArgumentMatchers.eq; diff --git a/src/test/java/org/pac4j/javalin/example/ExampleConfigFactory.java b/src/test/java/org/pac4j/javalin/example/ExampleConfigFactory.java index ae8b9cf..04b95df 100644 --- a/src/test/java/org/pac4j/javalin/example/ExampleConfigFactory.java +++ b/src/test/java/org/pac4j/javalin/example/ExampleConfigFactory.java @@ -19,7 +19,6 @@ import org.pac4j.http.client.indirect.FormClient; import org.pac4j.http.client.indirect.IndirectBasicAuthClient; import org.pac4j.javalin.JavalinContextFactory; -import org.pac4j.jee.context.JEEContextFactory; import org.pac4j.jee.context.session.JEESessionStoreFactory; import org.pac4j.jwt.config.signature.SecretSignatureConfiguration; import org.pac4j.jwt.credentials.authenticator.JwtAuthenticator; diff --git a/src/test/java/org/pac4j/javalin/example/JavalinPac4jExample.java b/src/test/java/org/pac4j/javalin/example/JavalinPac4jExample.java index a867e89..3c794d8 100644 --- a/src/test/java/org/pac4j/javalin/example/JavalinPac4jExample.java +++ b/src/test/java/org/pac4j/javalin/example/JavalinPac4jExample.java @@ -13,7 +13,6 @@ import org.pac4j.core.profile.UserProfile; import org.pac4j.http.client.indirect.FormClient; import org.pac4j.javalin.*; -import org.pac4j.jee.context.JEEContext; import org.pac4j.jee.context.session.JEESessionStore; import org.pac4j.jwt.config.signature.SecretSignatureConfiguration; import org.pac4j.jwt.profile.JwtGenerator;