// Path: core/src/main/java/org/pac4j/jax/rs/helpers/RequestJaxRsContext.java
// public class RequestJaxRsContext {
// 
//     private final ProvidersContext providers;
//     private final ContainerRequestContext context;
// 
//     public RequestJaxRsContext(Providers providers, ContainerRequestContext context) {
//         this.providers = new ProvidersContext(providers);
//         this.context = context;
//     }
// 
//     public Optional<JaxRsContext> context() {
//         return new RequestPac4JSecurityContext(context).context().map(Pac4JSecurityContext::getContext);
//     }
// 
//     public JaxRsContext contextOrNew() {
//         return context().orElse(providers.resolveNotNull(JaxRsContextFactory.class).provides(context));
//     }
// }
// 
// Path: core/src/main/java/org/pac4j/jax/rs/helpers/RequestPac4JSecurityContext.java
// public class RequestPac4JSecurityContext {
// 
//     private final SecurityContext securityContext;
// 
//     public RequestPac4JSecurityContext(JaxRsContext context) {
//         this(context.getRequestContext());
//     }
// 
//     public RequestPac4JSecurityContext(ContainerRequestContext request) {
//         this(request.getSecurityContext());
//     }
// 
//     public RequestPac4JSecurityContext(SecurityContext securityContext) {
//         this.securityContext = securityContext;
//     }
// 
//     public Optional<Pac4JSecurityContext> context() {
//         if (securityContext instanceof Pac4JSecurityContext) {
//             return Optional.of((Pac4JSecurityContext) securityContext);
//         } else {
//             return Optional.empty();
//         }
//     }
// }


import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.ext.Providers;
import org.jboss.resteasy.core.interception.PreMatchContainerRequestContext;
import org.jboss.resteasy.spi.HttpRequest;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.pac4j.jax.rs.helpers.RequestJaxRsContext;
import org.pac4j.jax.rs.helpers.RequestPac4JSecurityContext;
package org.pac4j.jax.rs.resteasy.helpers;



/**
 * @author Victor Noel
 * @since 2.2.0
 */
public class RestEasyRequestContext extends RequestJaxRsContext {

    public RestEasyRequestContext(Providers providers) {
        this(providers, ResteasyProviderFactory.getContextData(HttpRequest.class));
    }

    public RestEasyRequestContext(Providers providers, HttpRequest request) {
        super(providers,
// Path: core/src/main/java/org/pac4j/jax/rs/helpers/RequestJaxRsContext.java
// public class RequestJaxRsContext {
// 
//     private final ProvidersContext providers;
//     private final ContainerRequestContext context;
// 
//     public RequestJaxRsContext(Providers providers, ContainerRequestContext context) {
//         this.providers = new ProvidersContext(providers);
//         this.context = context;
//     }
// 
//     public Optional<JaxRsContext> context() {
//         return new RequestPac4JSecurityContext(context).context().map(Pac4JSecurityContext::getContext);
//     }
// 
//     public JaxRsContext contextOrNew() {
//         return context().orElse(providers.resolveNotNull(JaxRsContextFactory.class).provides(context));
//     }
// }
// 
// Path: core/src/main/java/org/pac4j/jax/rs/helpers/RequestPac4JSecurityContext.java
// public class RequestPac4JSecurityContext {
// 
//     private final SecurityContext securityContext;
// 
//     public RequestPac4JSecurityContext(JaxRsContext context) {
//         this(context.getRequestContext());
//     }
// 
//     public RequestPac4JSecurityContext(ContainerRequestContext request) {
//         this(request.getSecurityContext());
//     }
// 
//     public RequestPac4JSecurityContext(SecurityContext securityContext) {
//         this.securityContext = securityContext;
//     }
// 
//     public Optional<Pac4JSecurityContext> context() {
//         if (securityContext instanceof Pac4JSecurityContext) {
//             return Optional.of((Pac4JSecurityContext) securityContext);
//         } else {
//             return Optional.empty();
//         }
//     }
// }


// Path: resteasy/src/main/java/org/pac4j/jax/rs/resteasy/helpers/RestEasyRequestContext.java
import javax.ws.rs.core.SecurityContext;
import javax.ws.rs.ext.Providers;
import org.jboss.resteasy.core.interception.PreMatchContainerRequestContext;
import org.jboss.resteasy.spi.HttpRequest;
import org.jboss.resteasy.spi.ResteasyProviderFactory;
import org.pac4j.jax.rs.helpers.RequestJaxRsContext;
import org.pac4j.jax.rs.helpers.RequestPac4JSecurityContext;

package org.pac4j.jax.rs.resteasy.helpers;



/**
 * @author Victor Noel
 * @since 2.2.0
 */
public class RestEasyRequestContext extends RequestJaxRsContext {

    public RestEasyRequestContext(Providers providers) {
        this(providers, ResteasyProviderFactory.getContextData(HttpRequest.class));
    }

    public RestEasyRequestContext(Providers providers, HttpRequest request) {
        super(providers,
                new RequestPac4JSecurityContext(ResteasyProviderFactory.getContextData(SecurityContext.class)).context()