Undertow JakartaEE adapter in the testsuite
This commit is contained in:
parent
124591ce1a
commit
77a494d3be
13 changed files with 177 additions and 31 deletions
|
@ -196,18 +196,7 @@ public class UndertowHttpFacade implements HttpFacade {
|
|||
|
||||
inputStream = new BufferedInputStream(exchange.getInputStream());
|
||||
|
||||
context.setServletRequest(new HttpServletRequestWrapper((HttpServletRequest) servletRequest) {
|
||||
@Override
|
||||
public ServletInputStream getInputStream() {
|
||||
inputStream.mark(0);
|
||||
return new ServletInputStream() {
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
return inputStream.read();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
context.setServletRequest(UndertowHttpServletRequest.setupServletInputStream(servletRequest, inputStream));
|
||||
return inputStream;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import java.io.InputStream;
|
|||
|
||||
public class UndertowHttpServletRequest {
|
||||
|
||||
public static HttpServletRequestWrapper setupServletInputStream(ServletRequest servletRequest, InputStream inputStream) {
|
||||
public static HttpServletRequestWrapper setupServletInputStream(ServletRequest servletRequest, final InputStream inputStream) {
|
||||
return new HttpServletRequestWrapper((HttpServletRequest) servletRequest) {
|
||||
@Override
|
||||
public ServletInputStream getInputStream() {
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<cache.server.java.home>${java.home}</cache.server.java.home>
|
||||
|
||||
<!--component versions-->
|
||||
<arquillian-core.version>1.6.0.Final</arquillian-core.version>
|
||||
<arquillian-core.version>1.7.0.Alpha13</arquillian-core.version>
|
||||
<!--the version of shrinkwrap_resolver should align with the version in arquillian-bom-->
|
||||
<shrinkwrap-resolver.version>3.1.4</shrinkwrap-resolver.version>
|
||||
<selenium.version>3.14.0</selenium.version>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
# Adapter SPI
|
||||
|
||||
This module is primarily used for custom adapters in the testsuite.
|
||||
|
||||
## Undertow
|
||||
Modules related to Undertow:
|
||||
* Keycloak Undertow Adapter SPI (`undertow-adapter-spi-jakarta`)
|
||||
* Keycloak Undertow OIDC adapter (`undertow-adapter-jakarta`)
|
||||
* Keycloak Undertow SAML adapter (`undertow-adapter-saml-jakarta`)
|
||||
|
||||
These modules are automatically generated from the Keycloak adapters module (`/adapters`) and converted to adapters supporting JakartaEE.
|
||||
|
||||
You can override files from the original module by putting the class with the same name into the `src` directory.
|
||||
Do not forget to edit `.gitignore` file for changes, which should be kept in the module.
|
||||
|
||||
You can check the behavior in `undertow-adapter-spi-jakarta` module and class `UndertowHttpServletRequest`.
|
|
@ -14,8 +14,9 @@
|
|||
<name>Testsuite Adapter SPI</name>
|
||||
|
||||
<modules>
|
||||
<module>undertow-adapter-jakarta-spi</module>
|
||||
<module>undertow-adapter-spi-jakarta</module>
|
||||
<module>undertow-adapter-jakarta</module>
|
||||
<module>undertow-adapter-saml-jakarta</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>keycloak-undertow-adapter-jakarta</artifactId>
|
||||
<name>App Server - Undertow (JakartaEE)</name>
|
||||
<name>Undertow OIDC Adapter (JakartaEE)</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
|
@ -27,12 +27,16 @@
|
|||
*;resolution:=optional
|
||||
</keycloak.osgi.import>
|
||||
|
||||
<undertow-adapter-spi-base>${project.basedir}/../../../../../adapters/oidc/undertow</undertow-adapter-spi-base>
|
||||
<jakarta-transformer-sources>${undertow-adapter-spi-base}/</jakarta-transformer-sources>
|
||||
<jakarta-transformer-sources>${project.basedir}/../../../../../adapters/oidc/undertow</jakarta-transformer-sources>
|
||||
<jakarta-transformer-target>${project.basedir}</jakarta-transformer-target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-undertow-adapter-spi-jakarta</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.logging</groupId>
|
||||
<artifactId>jboss-logging</artifactId>
|
||||
|
@ -46,11 +50,6 @@
|
|||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>integration-arquillian-undertow-jakarta-spi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-core</artifactId>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
src/
|
|
@ -0,0 +1,138 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>integration-arquillian-servers</artifactId>
|
||||
<groupId>org.keycloak.testsuite</groupId>
|
||||
<version>999-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>keycloak-saml-undertow-adapter-jakarta</artifactId>
|
||||
<name>Undertow SAML Adapter (JakartaEE)</name>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
|
||||
<jakarta-transformer-sources>${project.basedir}/../../../../../adapters/saml/undertow</jakarta-transformer-sources>
|
||||
<jakarta-transformer-target>${project.basedir}</jakarta-transformer-target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-core</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-adapter-spi</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-common</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-api-public</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-adapter-core</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak.testsuite</groupId>
|
||||
<artifactId>keycloak-undertow-adapter-jakarta</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.logging</groupId>
|
||||
<artifactId>jboss-logging</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.spec.javax.servlet</groupId>
|
||||
<artifactId>jboss-servlet-api_3.0_spec</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.undertow</groupId>
|
||||
<artifactId>undertow-servlet</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.undertow</groupId>
|
||||
<artifactId>undertow-core</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>transform</id>
|
||||
<phase>initialize</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<property name="plugin_classpath" refid="maven.plugin.classpath" />
|
||||
<java classname="org.eclipse.transformer.jakarta.JakartaTransformer">
|
||||
<arg value="-o" />
|
||||
<arg value="${jakarta-transformer-sources}" />
|
||||
<arg value="${jakarta-transformer-target}/tmp" />
|
||||
<classpath>
|
||||
<pathelement path="${plugin_classpath}" />
|
||||
</classpath>
|
||||
</java>
|
||||
<touch>
|
||||
<fileset dir="${jakarta-transformer-target}"/>
|
||||
</touch>
|
||||
<copy todir="${jakarta-transformer-target}" overwrite="false">
|
||||
<fileset dir="${jakarta-transformer-target}/tmp"/>
|
||||
</copy>
|
||||
<delete dir="${jakarta-transformer-target}/tmp"/>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.eclipse.transformer</groupId>
|
||||
<artifactId>org.eclipse.transformer.cli</artifactId>
|
||||
<version>0.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ant-contrib</groupId>
|
||||
<artifactId>ant-contrib</artifactId>
|
||||
<version>1.0b3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ant</groupId>
|
||||
<artifactId>ant</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
|
@ -10,15 +10,15 @@
|
|||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>integration-arquillian-undertow-jakarta-spi</artifactId>
|
||||
<name>App Server - Undertow SPI (JakartaEE)</name>
|
||||
<artifactId>keycloak-undertow-adapter-spi-jakarta</artifactId>
|
||||
<name>Adapter Undertow SPI (JakartaEE)</name>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
|
||||
<undertow-adapter-spi-base>${project.basedir}/../../../../../adapters/spi/undertow-adapter-spi</undertow-adapter-spi-base>
|
||||
<jakarta-transformer-sources>${undertow-adapter-spi-base}/src/main/java/org/keycloak/adapters/undertow/</jakarta-transformer-sources>
|
||||
<undertow-adapter-base>${project.basedir}/../../../../../adapters/spi/undertow-adapter-spi</undertow-adapter-base>
|
||||
<jakarta-transformer-sources>${undertow-adapter-base}/src/main/java/org/keycloak/adapters/undertow/</jakarta-transformer-sources>
|
||||
<jakarta-transformer-target>${project.basedir}/src/main/java/org/keycloak/adapters/undertow/</jakarta-transformer-target>
|
||||
</properties>
|
||||
|
|
@ -34,8 +34,9 @@
|
|||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-undertow-adapter</artifactId>
|
||||
<groupId>org.keycloak.testsuite</groupId>
|
||||
<artifactId>keycloak-saml-undertow-adapter-jakarta</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
|
|
|
@ -186,8 +186,9 @@
|
|||
<artifactId>keycloak-servlet-filter-adapter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-saml-undertow-adapter</artifactId>
|
||||
<groupId>org.keycloak.testsuite</groupId>
|
||||
<artifactId>keycloak-saml-undertow-adapter-jakarta</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
|
|
Loading…
Reference in a new issue