diff --git a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java index 20dcf4633c..f100148bbd 100644 --- a/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java +++ b/services/src/main/java/org/keycloak/services/resources/KeycloakApplication.java @@ -120,7 +120,6 @@ public class KeycloakApplication extends Application { ResteasyProviderFactory.pushContext(KeycloakApplication.class, this); // for injection context.setAttribute(KeycloakSessionFactory.class.getName(), this.sessionFactory); - singletons.add(new ServerVersionResource()); singletons.add(new RobotsResource()); singletons.add(new RealmsResource()); singletons.add(new AdminRoot()); diff --git a/services/src/main/java/org/keycloak/services/resources/ServerVersionResource.java b/services/src/main/java/org/keycloak/services/resources/ServerVersionResource.java deleted file mode 100755 index 0352c08169..0000000000 --- a/services/src/main/java/org/keycloak/services/resources/ServerVersionResource.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.services.resources; - -import org.jboss.logging.Logger; -import org.jboss.resteasy.annotations.cache.NoCache; -import org.jboss.resteasy.spi.HttpRequest; -import org.jboss.resteasy.spi.HttpResponse; -import org.keycloak.representations.VersionRepresentation; - -import javax.ws.rs.GET; -import javax.ws.rs.OPTIONS; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -@Path("/version") -public class ServerVersionResource { - - protected static final Logger logger = Logger.getLogger(ServerVersionResource.class); - - @Context - protected HttpRequest request; - - @Context - protected HttpResponse response; - - @OPTIONS - @Produces(MediaType.APPLICATION_JSON) - public Response getVersionPreflight() { - logger.debugv("cors request from: {0}", request.getHttpHeaders().getRequestHeaders().getFirst("Origin")); - return Cors.add(request, Response.ok()).allowedMethods("GET").auth().preflight().build(); - } - - @GET - @NoCache - @Produces(MediaType.APPLICATION_JSON) - public VersionRepresentation getVersion() { - Cors.add(request).allowedOrigins("*").allowedMethods("GET").auth().build(response); - return VersionRepresentation.SINGLETON; - } -} diff --git a/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTest.java b/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTest.java index a2ec8bb430..c729a8ad12 100755 --- a/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTest.java +++ b/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTest.java @@ -183,11 +183,6 @@ public class AdapterTest { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - @Test public void testAuthenticated() throws Exception { testStrategy.testAuthenticated(); diff --git a/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java b/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java index b99ed06c49..9f845991c8 100755 --- a/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java +++ b/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/AdapterTestStrategy.java @@ -587,28 +587,7 @@ public class AdapterTestStrategy extends ExternalResource { client.close(); } - - public void testVersion() throws Exception { - Client client = ClientBuilder.newClient(); - WebTarget target = client.target(AUTH_SERVER_URL).path("version"); - VersionRepresentation version = target.request().get(VersionRepresentation.class); - Assert.assertNotNull(version); - Assert.assertNotNull(version.getVersion()); - Assert.assertNotNull(version.getBuildTime()); - Assert.assertNotEquals(version.getVersion(), Version.UNKNOWN); - Assert.assertNotEquals(version.getBuildTime(), Version.UNKNOWN); - - VersionRepresentation version2 = client.target(APP_SERVER_BASE_URL + "/secure-portal").path(AdapterConstants.K_VERSION).request().get(VersionRepresentation.class); - Assert.assertNotNull(version2); - Assert.assertNotNull(version2.getVersion()); - Assert.assertNotNull(version2.getBuildTime()); - Assert.assertEquals(version.getVersion(), version2.getVersion()); - Assert.assertEquals(version.getBuildTime(), version2.getBuildTime()); - client.close(); - - } - - + public void testAuthenticated() throws Exception { // test login to customer-portal which does a bearer request to customer-db driver.navigate().to(APP_SERVER_BASE_URL + "/secure-portal"); diff --git a/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/FilterAdapterTest.java b/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/FilterAdapterTest.java index 17531a019e..8b7e6ffae3 100755 --- a/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/FilterAdapterTest.java +++ b/testsuite/integration-deprecated/src/test/java/org/keycloak/testsuite/adapter/FilterAdapterTest.java @@ -153,11 +153,6 @@ public class FilterAdapterTest { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - /* Don't need to test this because HttpServletRequest.authenticate doesn't make sense with filter implementation diff --git a/testsuite/jetty/jetty81/src/test/java/org/keycloak/testsuite/Jetty8Test.java b/testsuite/jetty/jetty81/src/test/java/org/keycloak/testsuite/Jetty8Test.java index 08c55eaa8e..23f95ecf57 100755 --- a/testsuite/jetty/jetty81/src/test/java/org/keycloak/testsuite/Jetty8Test.java +++ b/testsuite/jetty/jetty81/src/test/java/org/keycloak/testsuite/Jetty8Test.java @@ -148,12 +148,6 @@ public class Jetty8Test { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 * diff --git a/testsuite/jetty/jetty91/src/test/java/org/keycloak/testsuite/Jetty9Test.java b/testsuite/jetty/jetty91/src/test/java/org/keycloak/testsuite/Jetty9Test.java index 4876b3bee2..6e3a2ac463 100755 --- a/testsuite/jetty/jetty91/src/test/java/org/keycloak/testsuite/Jetty9Test.java +++ b/testsuite/jetty/jetty91/src/test/java/org/keycloak/testsuite/Jetty9Test.java @@ -154,12 +154,6 @@ public class Jetty9Test { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 * diff --git a/testsuite/jetty/jetty92/src/test/java/org/keycloak/testsuite/Jetty9Test.java b/testsuite/jetty/jetty92/src/test/java/org/keycloak/testsuite/Jetty9Test.java index bd53150b1d..03110639a3 100755 --- a/testsuite/jetty/jetty92/src/test/java/org/keycloak/testsuite/Jetty9Test.java +++ b/testsuite/jetty/jetty92/src/test/java/org/keycloak/testsuite/Jetty9Test.java @@ -154,12 +154,6 @@ public class Jetty9Test { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 * diff --git a/testsuite/jetty/jetty93/src/test/java/org/keycloak/testsuite/Jetty9Test.java b/testsuite/jetty/jetty93/src/test/java/org/keycloak/testsuite/Jetty9Test.java index bd53150b1d..03110639a3 100644 --- a/testsuite/jetty/jetty93/src/test/java/org/keycloak/testsuite/Jetty9Test.java +++ b/testsuite/jetty/jetty93/src/test/java/org/keycloak/testsuite/Jetty9Test.java @@ -154,12 +154,6 @@ public class Jetty9Test { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 * diff --git a/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java b/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java index bd53150b1d..03110639a3 100644 --- a/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java +++ b/testsuite/jetty/jetty94/src/test/java/org/keycloak/testsuite/Jetty9Test.java @@ -154,12 +154,6 @@ public class Jetty9Test { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 * diff --git a/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatTest.java b/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatTest.java index b72aa68eb6..d3e22d06eb 100755 --- a/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatTest.java +++ b/testsuite/tomcat6/src/test/java/org/keycloak/testsuite/TomcatTest.java @@ -138,12 +138,6 @@ public class TomcatTest { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 * diff --git a/testsuite/tomcat7/src/test/java/org/keycloak/testsuite/Tomcat7Test.java b/testsuite/tomcat7/src/test/java/org/keycloak/testsuite/Tomcat7Test.java index 608ab1ed86..a2094a385c 100755 --- a/testsuite/tomcat7/src/test/java/org/keycloak/testsuite/Tomcat7Test.java +++ b/testsuite/tomcat7/src/test/java/org/keycloak/testsuite/Tomcat7Test.java @@ -144,12 +144,6 @@ public class Tomcat7Test { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 * diff --git a/testsuite/tomcat8/src/test/java/org/keycloak/testsuite/TomcatTest.java b/testsuite/tomcat8/src/test/java/org/keycloak/testsuite/TomcatTest.java index bd801d15e4..7d4074ecf1 100755 --- a/testsuite/tomcat8/src/test/java/org/keycloak/testsuite/TomcatTest.java +++ b/testsuite/tomcat8/src/test/java/org/keycloak/testsuite/TomcatTest.java @@ -144,12 +144,6 @@ public class TomcatTest { testStrategy.testBadUser(); } - @Test - public void testVersion() throws Exception { - testStrategy.testVersion(); - } - - /** * KEYCLOAK-732 *