Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
maths22 committed May 14, 2024
1 parent e95629e commit 262d637
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/main/java/org/pac4j/javalin/JavalinContextFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 <code>INSTANCE</code> */
public static final WebContextFactory INSTANCE = new JavalinContextFactory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/pac4j/javalin/JavalinWebContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 262d637

Please sign in to comment.