From 7a8c7502d20ea1a914cb71ff34a63813f964895c Mon Sep 17 00:00:00 2001 From: Douglas Palmer Date: Wed, 12 Jun 2024 13:57:32 -0700 Subject: [PATCH] Cleanup of adapter-spi module? Closes#30871 Signed-off-by: Douglas Palmer --- .../servers/adapter-spi/README.md | 15 --- .../servers/adapter-spi/pom.xml | 24 ----- .../undertow-adapter-spi-jakarta/.gitignore | 2 - .../undertow-adapter-spi-jakarta/pom.xml | 91 ------------------- .../undertow/UndertowHttpServletRequest.java | 42 --------- .../integration-arquillian/servers/pom.xml | 1 - 6 files changed, 175 deletions(-) delete mode 100644 testsuite/integration-arquillian/servers/adapter-spi/README.md delete mode 100644 testsuite/integration-arquillian/servers/adapter-spi/pom.xml delete mode 100644 testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/.gitignore delete mode 100644 testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/pom.xml delete mode 100644 testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/src/main/java/org/keycloak/adapters/undertow/UndertowHttpServletRequest.java diff --git a/testsuite/integration-arquillian/servers/adapter-spi/README.md b/testsuite/integration-arquillian/servers/adapter-spi/README.md deleted file mode 100644 index 513209eda5..0000000000 --- a/testsuite/integration-arquillian/servers/adapter-spi/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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 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`. diff --git a/testsuite/integration-arquillian/servers/adapter-spi/pom.xml b/testsuite/integration-arquillian/servers/adapter-spi/pom.xml deleted file mode 100644 index 192df4b86b..0000000000 --- a/testsuite/integration-arquillian/servers/adapter-spi/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - integration-arquillian-servers - org.keycloak.testsuite - 999.0.0-SNAPSHOT - - 4.0.0 - pom - - integration-arquillian-servers-adapter-spi - Testsuite Adapter SPI - - - undertow-adapter-spi-jakarta - - - - - -Djava.security.manager=allow - - diff --git a/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/.gitignore b/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/.gitignore deleted file mode 100644 index 95b63147a9..0000000000 --- a/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/src/main/java/org/keycloak/adapters/undertow/* -!/src/main/java/org/keycloak/adapters/undertow/UndertowHttpServletRequest.java \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/pom.xml b/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/pom.xml deleted file mode 100644 index 32f2b71283..0000000000 --- a/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/pom.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - integration-arquillian-servers-adapter-spi - org.keycloak.testsuite - 999.0.0-SNAPSHOT - ../pom.xml - - 4.0.0 - - keycloak-undertow-adapter-spi-jakarta - Adapter Undertow SPI (JakartaEE) - - - ${project.basedir}/../../../../../adapters/spi/undertow-adapter-spi - ${undertow-adapter-base}/src/main/java/org/keycloak/adapters/undertow/ - ${project.basedir}/src/main/java/org/keycloak/adapters/undertow/ - - - - - org.keycloak - keycloak-adapter-spi - - - org.keycloak - keycloak-common - - - io.undertow - undertow-servlet - - - io.undertow - undertow-core - - - - - - - maven-antrun-plugin - 3.1.0 - - - transform - initialize - - run - - - - - - - - - - - - - - - - - - - - - - - - - - org.eclipse.transformer - org.eclipse.transformer.cli - 0.5.0 - - - org.apache.ant - ant - 1.10.14 - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/src/main/java/org/keycloak/adapters/undertow/UndertowHttpServletRequest.java b/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/src/main/java/org/keycloak/adapters/undertow/UndertowHttpServletRequest.java deleted file mode 100644 index b8359bce42..0000000000 --- a/testsuite/integration-arquillian/servers/adapter-spi/undertow-adapter-spi-jakarta/src/main/java/org/keycloak/adapters/undertow/UndertowHttpServletRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.keycloak.adapters.undertow; - -import jakarta.servlet.ReadListener; -import jakarta.servlet.ServletInputStream; -import jakarta.servlet.ServletRequest; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletRequestWrapper; -import java.io.IOException; -import java.io.InputStream; - -public class UndertowHttpServletRequest { - - public static HttpServletRequestWrapper setupServletInputStream(ServletRequest servletRequest, InputStream inputStream) { - return new HttpServletRequestWrapper((HttpServletRequest) servletRequest) { - @Override - public ServletInputStream getInputStream() { - inputStream.mark(0); - return new ServletInputStream() { - @Override - public boolean isFinished() { - return false; - } - - @Override - public boolean isReady() { - return false; - } - - @Override - public void setReadListener(ReadListener readListener) { - - } - - @Override - public int read() throws IOException { - return inputStream.read(); - } - }; - } - }; - } -} diff --git a/testsuite/integration-arquillian/servers/pom.xml b/testsuite/integration-arquillian/servers/pom.xml index 3f7a86ea82..de7fc63bcb 100644 --- a/testsuite/integration-arquillian/servers/pom.xml +++ b/testsuite/integration-arquillian/servers/pom.xml @@ -44,7 +44,6 @@ - adapter-spi auth-server app-server cache-server