From 4ea586ebe6604e477787c8bb6c96675368c2b149 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 11 Feb 2016 09:09:39 +0100 Subject: [PATCH] Revert back to servlet 3.0 --- .../oidc/as7-eap6/as7-adapter-spi/pom.xml | 2 +- adapters/oidc/as7-eap6/as7-adapter/pom.xml | 2 +- adapters/oidc/jaxrs-oauth-client/pom.xml | 2 +- adapters/oidc/servlet-filter/pom.xml | 2 +- adapters/oidc/servlet-oauth-client/pom.xml | 2 +- adapters/oidc/spring-security/pom.xml | 2 +- adapters/oidc/undertow/pom.xml | 2 +- adapters/oidc/wildfly/wildfly-adapter/pom.xml | 2 +- adapters/saml/as7-eap6/adapter/pom.xml | 2 +- adapters/saml/servlet-filter/pom.xml | 2 +- adapters/saml/undertow/pom.xml | 2 +- adapters/saml/wildfly/wildfly-adapter/pom.xml | 2 +- adapters/spi/jboss-adapter-core/pom.xml | 2 +- adapters/spi/servlet-adapter-spi/pom.xml | 2 +- .../adapters/servlet/FilterSessionStore.java | 48 +------------------ adapters/spi/undertow-adapter-spi/pom.xml | 2 +- examples/basic-auth/pom.xml | 2 +- .../broker/twitter-authentication/pom.xml | 2 +- examples/cors/database-service/pom.xml | 2 +- .../demo-template/admin-access-app/pom.xml | 2 +- .../demo-template/customer-app-filter/pom.xml | 2 +- examples/demo-template/customer-app/pom.xml | 2 +- .../demo-template/database-service/pom.xml | 2 +- .../demo-template/offline-access-app/pom.xml | 2 +- examples/demo-template/product-app/pom.xml | 2 +- .../demo-template/service-account/pom.xml | 2 +- .../demo-template/third-party-cdi/pom.xml | 2 +- examples/demo-template/third-party/pom.xml | 2 +- examples/fuse/customer-app-fuse/pom.xml | 2 +- examples/fuse/product-app-fuse/pom.xml | 2 +- examples/kerberos/pom.xml | 2 +- examples/ldap/pom.xml | 2 +- examples/multi-tenant/pom.xml | 2 +- pom.xml | 6 +-- services/pom.xml | 2 +- testsuite/integration/pom.xml | 2 +- testsuite/jetty/jetty81/pom.xml | 2 +- testsuite/jetty/jetty91/pom.xml | 2 +- testsuite/jetty/jetty92/pom.xml | 2 +- testsuite/proxy/pom.xml | 2 +- testsuite/tomcat6/pom.xml | 2 +- testsuite/tomcat7/pom.xml | 2 +- testsuite/tomcat8/pom.xml | 2 +- testsuite/wildfly/pom.xml | 2 +- 44 files changed, 47 insertions(+), 91 deletions(-) diff --git a/adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml b/adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml index c926324277..217b417b95 100755 --- a/adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml +++ b/adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml @@ -41,7 +41,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/oidc/as7-eap6/as7-adapter/pom.xml b/adapters/oidc/as7-eap6/as7-adapter/pom.xml index a9251d5975..55037af9de 100755 --- a/adapters/oidc/as7-eap6/as7-adapter/pom.xml +++ b/adapters/oidc/as7-eap6/as7-adapter/pom.xml @@ -73,7 +73,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/oidc/jaxrs-oauth-client/pom.xml b/adapters/oidc/jaxrs-oauth-client/pom.xml index eac0f49ce4..60e8ae74a7 100755 --- a/adapters/oidc/jaxrs-oauth-client/pom.xml +++ b/adapters/oidc/jaxrs-oauth-client/pom.xml @@ -72,7 +72,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/oidc/servlet-filter/pom.xml b/adapters/oidc/servlet-filter/pom.xml index 1e012391d0..9e39669a79 100755 --- a/adapters/oidc/servlet-filter/pom.xml +++ b/adapters/oidc/servlet-filter/pom.xml @@ -75,7 +75,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/oidc/servlet-oauth-client/pom.xml b/adapters/oidc/servlet-oauth-client/pom.xml index 560eecf8b7..0f2891ef8f 100755 --- a/adapters/oidc/servlet-oauth-client/pom.xml +++ b/adapters/oidc/servlet-oauth-client/pom.xml @@ -53,7 +53,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/oidc/spring-security/pom.xml b/adapters/oidc/spring-security/pom.xml index ff39fb5393..d07f2e4b7f 100755 --- a/adapters/oidc/spring-security/pom.xml +++ b/adapters/oidc/spring-security/pom.xml @@ -52,7 +52,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/oidc/undertow/pom.xml b/adapters/oidc/undertow/pom.xml index ed5e7ceeef..80d476e1e6 100755 --- a/adapters/oidc/undertow/pom.xml +++ b/adapters/oidc/undertow/pom.xml @@ -75,7 +75,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/oidc/wildfly/wildfly-adapter/pom.xml b/adapters/oidc/wildfly/wildfly-adapter/pom.xml index 8e83abdbc2..c92a5aeeb9 100755 --- a/adapters/oidc/wildfly/wildfly-adapter/pom.xml +++ b/adapters/oidc/wildfly/wildfly-adapter/pom.xml @@ -89,7 +89,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/saml/as7-eap6/adapter/pom.xml b/adapters/saml/as7-eap6/adapter/pom.xml index 25cf62f4fe..f190d76e2d 100755 --- a/adapters/saml/as7-eap6/adapter/pom.xml +++ b/adapters/saml/as7-eap6/adapter/pom.xml @@ -53,7 +53,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/saml/servlet-filter/pom.xml b/adapters/saml/servlet-filter/pom.xml index 69ce19b269..e3dbee8c93 100755 --- a/adapters/saml/servlet-filter/pom.xml +++ b/adapters/saml/servlet-filter/pom.xml @@ -61,7 +61,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/saml/undertow/pom.xml b/adapters/saml/undertow/pom.xml index f429c4565e..ce7006e202 100755 --- a/adapters/saml/undertow/pom.xml +++ b/adapters/saml/undertow/pom.xml @@ -69,7 +69,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/saml/wildfly/wildfly-adapter/pom.xml b/adapters/saml/wildfly/wildfly-adapter/pom.xml index 7b4e9a7903..acc426f30e 100755 --- a/adapters/saml/wildfly/wildfly-adapter/pom.xml +++ b/adapters/saml/wildfly/wildfly-adapter/pom.xml @@ -69,7 +69,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/spi/jboss-adapter-core/pom.xml b/adapters/spi/jboss-adapter-core/pom.xml index a2229e30c7..9e05f3387b 100755 --- a/adapters/spi/jboss-adapter-core/pom.xml +++ b/adapters/spi/jboss-adapter-core/pom.xml @@ -67,7 +67,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/spi/servlet-adapter-spi/pom.xml b/adapters/spi/servlet-adapter-spi/pom.xml index d6f82e2889..c4c944bb32 100755 --- a/adapters/spi/servlet-adapter-spi/pom.xml +++ b/adapters/spi/servlet-adapter-spi/pom.xml @@ -45,7 +45,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java b/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java index 2470ef4d1c..6a17c8e810 100755 --- a/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java +++ b/adapters/spi/servlet-adapter-spi/src/main/java/org/keycloak/adapters/servlet/FilterSessionStore.java @@ -23,7 +23,6 @@ import org.keycloak.adapters.spi.KeycloakAccount; import org.keycloak.common.util.Encode; import org.keycloak.common.util.MultivaluedHashMap; -import javax.servlet.ReadListener; import javax.servlet.ServletException; import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; @@ -174,54 +173,11 @@ public class FilterSessionStore implements AdapterSessionStore { public ServletInputStream getInputStream() throws IOException { if (needRequestRestore && body != null) { + final ByteArrayInputStream is = new ByteArrayInputStream(body); return new ServletInputStream() { - private int lastIndex = 0; - private ReadListener readListener = null; - - @Override - public boolean isFinished() { - return lastIndex == body.length; - } - - @Override - public boolean isReady() { - return true; - } - - @Override - public void setReadListener(ReadListener readListener) { - this.readListener = readListener; - if (!isFinished()) { - try { - readListener.onDataAvailable(); - } catch (IOException e) { - readListener.onError(e); - } - } else { - try { - readListener.onAllDataRead(); - } catch (IOException e) { - readListener.onError(e); - } - } - } - @Override public int read() throws IOException { - int i = -1; - if (!isFinished()) { - i = body[lastIndex]; - lastIndex++; - if (isFinished() && readListener != null) { - try { - readListener.onAllDataRead(); - } catch (IOException e) { - readListener.onError(e); - throw e; - } - } - } - return i; + return is.read(); } }; } diff --git a/adapters/spi/undertow-adapter-spi/pom.xml b/adapters/spi/undertow-adapter-spi/pom.xml index 1aae136620..7912f1da73 100755 --- a/adapters/spi/undertow-adapter-spi/pom.xml +++ b/adapters/spi/undertow-adapter-spi/pom.xml @@ -47,7 +47,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/basic-auth/pom.xml b/examples/basic-auth/pom.xml index a1ef3c2750..a73db6233a 100755 --- a/examples/basic-auth/pom.xml +++ b/examples/basic-auth/pom.xml @@ -50,7 +50,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/broker/twitter-authentication/pom.xml b/examples/broker/twitter-authentication/pom.xml index 7a92b0820b..83ea633dab 100755 --- a/examples/broker/twitter-authentication/pom.xml +++ b/examples/broker/twitter-authentication/pom.xml @@ -58,7 +58,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/cors/database-service/pom.xml b/examples/cors/database-service/pom.xml index 44262eddb2..2c22c0bb4a 100755 --- a/examples/cors/database-service/pom.xml +++ b/examples/cors/database-service/pom.xml @@ -48,7 +48,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/admin-access-app/pom.xml b/examples/demo-template/admin-access-app/pom.xml index b3f300105c..cfabf9b53d 100755 --- a/examples/demo-template/admin-access-app/pom.xml +++ b/examples/demo-template/admin-access-app/pom.xml @@ -42,7 +42,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/customer-app-filter/pom.xml b/examples/demo-template/customer-app-filter/pom.xml index 758d6fbb99..fb17b6b48a 100755 --- a/examples/demo-template/customer-app-filter/pom.xml +++ b/examples/demo-template/customer-app-filter/pom.xml @@ -42,7 +42,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/customer-app/pom.xml b/examples/demo-template/customer-app/pom.xml index 1fdf6db5f0..4c52e0579e 100755 --- a/examples/demo-template/customer-app/pom.xml +++ b/examples/demo-template/customer-app/pom.xml @@ -42,7 +42,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/database-service/pom.xml b/examples/demo-template/database-service/pom.xml index a864ceed65..f3465e76e5 100755 --- a/examples/demo-template/database-service/pom.xml +++ b/examples/demo-template/database-service/pom.xml @@ -48,7 +48,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/offline-access-app/pom.xml b/examples/demo-template/offline-access-app/pom.xml index 3cefb0dedf..8c715ddbce 100644 --- a/examples/demo-template/offline-access-app/pom.xml +++ b/examples/demo-template/offline-access-app/pom.xml @@ -42,7 +42,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/product-app/pom.xml b/examples/demo-template/product-app/pom.xml index a44de34a16..93d2425fa0 100755 --- a/examples/demo-template/product-app/pom.xml +++ b/examples/demo-template/product-app/pom.xml @@ -42,7 +42,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/service-account/pom.xml b/examples/demo-template/service-account/pom.xml index 68e69c833b..33f9e5ef54 100644 --- a/examples/demo-template/service-account/pom.xml +++ b/examples/demo-template/service-account/pom.xml @@ -34,7 +34,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/third-party-cdi/pom.xml b/examples/demo-template/third-party-cdi/pom.xml index 5dd08c6d61..9c25818c87 100755 --- a/examples/demo-template/third-party-cdi/pom.xml +++ b/examples/demo-template/third-party-cdi/pom.xml @@ -34,7 +34,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/demo-template/third-party/pom.xml b/examples/demo-template/third-party/pom.xml index ebbecaf84e..7a7ba61600 100755 --- a/examples/demo-template/third-party/pom.xml +++ b/examples/demo-template/third-party/pom.xml @@ -34,7 +34,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/fuse/customer-app-fuse/pom.xml b/examples/fuse/customer-app-fuse/pom.xml index 0dea1c4a19..196227c927 100755 --- a/examples/fuse/customer-app-fuse/pom.xml +++ b/examples/fuse/customer-app-fuse/pom.xml @@ -52,7 +52,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/fuse/product-app-fuse/pom.xml b/examples/fuse/product-app-fuse/pom.xml index c24b5d1c2f..5fa2684735 100755 --- a/examples/fuse/product-app-fuse/pom.xml +++ b/examples/fuse/product-app-fuse/pom.xml @@ -53,7 +53,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.keycloak diff --git a/examples/kerberos/pom.xml b/examples/kerberos/pom.xml index 3252d92709..9d9dc25d3f 100755 --- a/examples/kerberos/pom.xml +++ b/examples/kerberos/pom.xml @@ -44,7 +44,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/ldap/pom.xml b/examples/ldap/pom.xml index 241222250d..d3767e3c77 100644 --- a/examples/ldap/pom.xml +++ b/examples/ldap/pom.xml @@ -42,7 +42,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/examples/multi-tenant/pom.xml b/examples/multi-tenant/pom.xml index 757e0b597c..f046804418 100755 --- a/examples/multi-tenant/pom.xml +++ b/examples/multi-tenant/pom.xml @@ -47,7 +47,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec provided diff --git a/pom.xml b/pom.xml index 58ba936365..6212ca8366 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,6 @@ 1.0.4.Final 1.2.16 3.0.14.Final - 1.0.0.Final 1.7.7 2.21 2.2.11 @@ -88,6 +87,7 @@ 4.2.0 3.1.2 9.3-1100-jdbc41 + 1.0.2.Final 4.0.4 @@ -303,8 +303,8 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec - ${servlet.api.31.version} + jboss-servlet-api_3.0_spec + ${servlet.api.30.version} org.picketlink diff --git a/services/pom.xml b/services/pom.xml index 425ef53cab..c2d4392e18 100755 --- a/services/pom.xml +++ b/services/pom.xml @@ -63,7 +63,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.twitter4j diff --git a/testsuite/integration/pom.xml b/testsuite/integration/pom.xml index d9331f941d..8dafd441a0 100755 --- a/testsuite/integration/pom.xml +++ b/testsuite/integration/pom.xml @@ -57,7 +57,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/jetty/jetty81/pom.xml b/testsuite/jetty/jetty81/pom.xml index 73dd109cfc..87000287a7 100755 --- a/testsuite/jetty/jetty81/pom.xml +++ b/testsuite/jetty/jetty81/pom.xml @@ -59,7 +59,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/jetty/jetty91/pom.xml b/testsuite/jetty/jetty91/pom.xml index 1bb34e9e1b..181e575584 100755 --- a/testsuite/jetty/jetty91/pom.xml +++ b/testsuite/jetty/jetty91/pom.xml @@ -59,7 +59,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/jetty/jetty92/pom.xml b/testsuite/jetty/jetty92/pom.xml index 76fb1537cb..0a24ecd941 100755 --- a/testsuite/jetty/jetty92/pom.xml +++ b/testsuite/jetty/jetty92/pom.xml @@ -63,7 +63,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/proxy/pom.xml b/testsuite/proxy/pom.xml index 233f4d88f4..52c83ef752 100755 --- a/testsuite/proxy/pom.xml +++ b/testsuite/proxy/pom.xml @@ -54,7 +54,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/tomcat6/pom.xml b/testsuite/tomcat6/pom.xml index 42aeab44c0..9584809c08 100755 --- a/testsuite/tomcat6/pom.xml +++ b/testsuite/tomcat6/pom.xml @@ -53,7 +53,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/tomcat7/pom.xml b/testsuite/tomcat7/pom.xml index 8ca978b8d0..4e17e56bf3 100755 --- a/testsuite/tomcat7/pom.xml +++ b/testsuite/tomcat7/pom.xml @@ -77,7 +77,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/tomcat8/pom.xml b/testsuite/tomcat8/pom.xml index 1f9cbb9e10..8c3248f9fa 100755 --- a/testsuite/tomcat8/pom.xml +++ b/testsuite/tomcat8/pom.xml @@ -49,7 +49,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs diff --git a/testsuite/wildfly/pom.xml b/testsuite/wildfly/pom.xml index e907b70336..f4af43881a 100644 --- a/testsuite/wildfly/pom.xml +++ b/testsuite/wildfly/pom.xml @@ -56,7 +56,7 @@ org.jboss.spec.javax.servlet - jboss-servlet-api_3.1_spec + jboss-servlet-api_3.0_spec org.jboss.spec.javax.ws.rs