From 6201257f767b69f6cd65c1dea8d8a6959683a7e8 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Fri, 31 Mar 2017 15:50:53 +0200 Subject: [PATCH] KEYCLOAK-4549 [RH-SSO] EAP 7.1.0 Alpha16 --- distribution/feature-packs/pom.xml | 28 --- .../server-feature-pack/assembly.xml | 55 +---- .../feature-packs/server-feature-pack/pom.xml | 216 +++++++++++++++++- .../standalone/subsystems-ha.xml | 49 ++++ .../configuration/standalone/subsystems.xml | 47 ++++ .../configuration/standalone/template.xml | 90 ++++++++ .../identity/module/dir/META-INF/MANIFEST.MF | 2 +- pom.xml | 8 +- .../services/resources/JsResource.java | 17 +- .../services/resources/RobotsResource.java | 5 +- .../java/org/keycloak/utils/MediaType.java | 6 + .../keycloak-datasources2.xml | 57 +++++ .../keycloak-infinispan.xml | 16 +- .../keycloak-infinispan2.xml | 146 ++++++++++++ 14 files changed, 640 insertions(+), 102 deletions(-) create mode 100755 distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems-ha.xml create mode 100755 distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems.xml create mode 100644 distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/template.xml create mode 100755 wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-datasources2.xml create mode 100755 wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan2.xml diff --git a/distribution/feature-packs/pom.xml b/distribution/feature-packs/pom.xml index a1407950a6..b5988a67a9 100644 --- a/distribution/feature-packs/pom.xml +++ b/distribution/feature-packs/pom.xml @@ -34,32 +34,4 @@ adapter-feature-pack server-feature-pack - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack-client-cli-dist - prepare-package - - unpack - - - - - org.keycloak - keycloak-themes - ${project.build.directory}/unpacked - - - - - - - - - diff --git a/distribution/feature-packs/server-feature-pack/assembly.xml b/distribution/feature-packs/server-feature-pack/assembly.xml index 631a62cc8a..1fdde3f439 100644 --- a/distribution/feature-packs/server-feature-pack/assembly.xml +++ b/distribution/feature-packs/server-feature-pack/assembly.xml @@ -24,63 +24,10 @@ false - target/${project.build.finalName} - - true - - **/module.xml - **/MANIFEST.MF - **/template.xml - **/host.xml - **/host-master.xml - **/host-slave.xml - - - - target/${project.build.finalName} - - false - - **/module.xml - **/MANIFEST.MF - **/template.xml - **/host.xml - **/host-master.xml - **/host-slave.xml - - - - ../../../ - - License.html - - content - - - target/unpacked/theme - content/themes - - **/** - - - - src/main/resources/identity - content/bin - - **/product.conf - - true - - - src/main/resources/identity/module - modules/system/layers/keycloak/org/jboss/as/product/${product.slot} - - **/* - - true + diff --git a/distribution/feature-packs/server-feature-pack/pom.xml b/distribution/feature-packs/server-feature-pack/pom.xml index 99df51f936..46fee49f59 100644 --- a/distribution/feature-packs/server-feature-pack/pom.xml +++ b/distribution/feature-packs/server-feature-pack/pom.xml @@ -51,6 +51,149 @@ + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-theme + validate + + unpack + + + + + org.keycloak + keycloak-themes + target/unpacked-themes + + + + + + + + + maven-resources-plugin + + + copy-configuration + validate + + copy-resources + + + target/resources/configuration + + + src/main/resources/configuration + true + + + + + + copy-modules + validate + + copy-resources + + + target/resources/modules + + + src/main/resources/modules + + + + + + copy-content + validate + + copy-resources + + + target/resources/content + + + src/main/resources/content + + + + + + copy-identity + validate + + copy-resources + + + target/resources/content/bin + + + src/main/resources/identity + + **/product.conf + + true + + + + + + copy-identity-module + validate + + copy-resources + + + target/resources/modules/system/layers/keycloak/org/jboss/as/product/${product.slot} + + + src/main/resources/identity/module + true + + + + + + copy-themes + validate + + copy-resources + + + target/resources/content/themes + + + target/unpacked-themes/theme + + + + + + copy-license + validate + + copy-resources + + + target/resources/content + + + ../../../ + + License.html + + + + + + + + org.wildfly.build wildfly-feature-pack-build-maven-plugin @@ -63,6 +206,7 @@ compile feature-pack-build.xml + target/resources @@ -116,6 +260,50 @@ + + + + wf11 + + + urn:jboss:domain:5.0 + + + + + org.wildfly + wildfly-feature-pack + ${wildfly11.version} + zip + + + + + + + maven-resources-plugin + + + copy-configuration-wf11 + validate + + copy-resources + + + target/resources/configuration + + + src/main/resources-wf11/configuration + true + + + + + + + + + product @@ -126,7 +314,7 @@ org.jboss.eap:wildfly-feature-pack - urn:jboss:domain:4.1 + urn:jboss:domain:5.0 @@ -137,6 +325,32 @@ zip + + + + + maven-resources-plugin + + + copy-configuration-wf11 + validate + + copy-resources + + + target/resources/configuration + + + src/main/resources-wf11/configuration + true + + + + + + + + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems-ha.xml b/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems-ha.xml new file mode 100755 index 0000000000..9d9954de9b --- /dev/null +++ b/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems-ha.xml @@ -0,0 +1,49 @@ + + + + + + + logging.xml + bean-validation.xml + keycloak-datasources.xml + deployment-scanner.xml + ee.xml + ejb3.xml + io.xml + keycloak-infinispan.xml + jaxrs.xml + jca.xml + jdr.xml + jgroups.xml + jmx.xml + jpa.xml + jsf.xml + mail.xml + mod_cluster.xml + naming.xml + remoting.xml + request-controller.xml + security-manager.xml + elytron.xml + security.xml + transactions.xml + undertow.xml + keycloak-server.xml + + \ No newline at end of file diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems.xml b/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems.xml new file mode 100755 index 0000000000..823b45cebc --- /dev/null +++ b/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/subsystems.xml @@ -0,0 +1,47 @@ + + + + + + + logging.xml + bean-validation.xml + keycloak-datasources2.xml + deployment-scanner.xml + ee.xml + ejb3.xml + io.xml + keycloak-infinispan2.xml + jaxrs.xml + jca.xml + jdr.xml + jmx.xml + jpa.xml + jsf.xml + mail.xml + naming.xml + remoting.xml + request-controller.xml + security-manager.xml + elytron.xml + security.xml + transactions.xml + undertow.xml + keycloak-server.xml + + diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/template.xml b/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/template.xml new file mode 100644 index 0000000000..e28a49ba48 --- /dev/null +++ b/distribution/feature-packs/server-feature-pack/src/main/resources-wf11/configuration/standalone/template.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/distribution/feature-packs/server-feature-pack/src/main/resources/identity/module/dir/META-INF/MANIFEST.MF b/distribution/feature-packs/server-feature-pack/src/main/resources/identity/module/dir/META-INF/MANIFEST.MF index 5c2cb16d8b..a467c06b87 100644 --- a/distribution/feature-packs/server-feature-pack/src/main/resources/identity/module/dir/META-INF/MANIFEST.MF +++ b/distribution/feature-packs/server-feature-pack/src/main/resources/identity/module/dir/META-INF/MANIFEST.MF @@ -1,3 +1,3 @@ -JBoss-Product-Release-Name: ${product.name} +JBoss-Product-Release-Name: ${product.name.full} JBoss-Product-Release-Version: ${product.version} JBoss-Product-Console-Slot: ${product.wildfly.console.slot} diff --git a/pom.xml b/pom.xml index 246bcc1537..364121c10c 100755 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,11 @@ 7.2.0.Final 10.0.0.Final - 7.0.5.GA-redhat-2 + 11.0.0.Alpha1 + 7.1.0.Alpha1-redhat-16 + 2.0.10.Final + 1.1.8.Final + 1.1.0.Beta32 1.0.0.Beta14 @@ -74,8 +78,6 @@ 2.2.11 20140925 1.3.15.Final - 2.0.10.Final - 1.1.3.Final 2.0.5 diff --git a/services/src/main/java/org/keycloak/services/resources/JsResource.java b/services/src/main/java/org/keycloak/services/resources/JsResource.java index c74abf0e52..3e41dad355 100755 --- a/services/src/main/java/org/keycloak/services/resources/JsResource.java +++ b/services/src/main/java/org/keycloak/services/resources/JsResource.java @@ -19,6 +19,7 @@ package org.keycloak.services.resources; import org.keycloak.Config; import org.keycloak.common.Version; +import org.keycloak.utils.MediaType; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -43,14 +44,14 @@ public class JsResource { */ @GET @Path("/keycloak.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakJs() { return getJs("keycloak.js"); } @GET @Path("/{version}/keycloak.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakJsWithVersion(@PathParam("version") String version) { if (!version.equals(Version.RESOURCES_VERSION)) { return Response.status(Response.Status.NOT_FOUND).build(); @@ -61,14 +62,14 @@ public class JsResource { @GET @Path("/keycloak.min.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakMinJs() { return getJs("keycloak.min.js"); } @GET @Path("/{version}/keycloak.min.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakMinJsWithVersion(@PathParam("version") String version) { if (!version.equals(Version.RESOURCES_VERSION)) { return Response.status(Response.Status.NOT_FOUND).build(); @@ -84,14 +85,14 @@ public class JsResource { */ @GET @Path("/keycloak-authz.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakAuthzJs() { return getJs("keycloak-authz.js"); } @GET @Path("/{version}/keycloak-authz.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakAuthzJsWithVersion(@PathParam("version") String version) { if (!version.equals(Version.RESOURCES_VERSION)) { return Response.status(Response.Status.NOT_FOUND).build(); @@ -102,14 +103,14 @@ public class JsResource { @GET @Path("/keycloak-authz.min.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakAuthzMinJs() { return getJs("keycloak-authz.min.js"); } @GET @Path("/{version}/keycloak-authz.min.js") - @Produces("text/javascript") + @Produces(MediaType.TEXT_PLAIN_JAVASCRIPT) public Response getKeycloakAuthzMinJsWithVersion(@PathParam("version") String version) { if (!version.equals(Version.RESOURCES_VERSION)) { return Response.status(Response.Status.NOT_FOUND).build(); diff --git a/services/src/main/java/org/keycloak/services/resources/RobotsResource.java b/services/src/main/java/org/keycloak/services/resources/RobotsResource.java index 16e9393c66..b4c37719cc 100755 --- a/services/src/main/java/org/keycloak/services/resources/RobotsResource.java +++ b/services/src/main/java/org/keycloak/services/resources/RobotsResource.java @@ -17,10 +17,11 @@ package org.keycloak.services.resources; +import org.keycloak.utils.MediaType; + import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; @Path("/robots.txt") public class RobotsResource { @@ -28,7 +29,7 @@ public class RobotsResource { private static final String robots = "User-agent: *\n" + "Disallow: /"; @GET - @Produces(MediaType.TEXT_PLAIN) + @Produces(MediaType.TEXT_PLAIN_UTF_8) public String getRobots() { return robots; } diff --git a/services/src/main/java/org/keycloak/utils/MediaType.java b/services/src/main/java/org/keycloak/utils/MediaType.java index c34858dccd..acb0b4134e 100644 --- a/services/src/main/java/org/keycloak/utils/MediaType.java +++ b/services/src/main/java/org/keycloak/utils/MediaType.java @@ -25,6 +25,12 @@ public class MediaType { public static final String TEXT_HTML_UTF_8 = "text/html; charset=utf-8"; public static final javax.ws.rs.core.MediaType TEXT_HTML_UTF_8_TYPE = new javax.ws.rs.core.MediaType("text", "html", "utf-8"); + public static final String TEXT_PLAIN_UTF_8 = "text/plain; charset=utf-8"; + public static final javax.ws.rs.core.MediaType TEXT_PLAIN_UTF_8_TYPE = new javax.ws.rs.core.MediaType("text", "plain", "utf-8"); + + public static final String TEXT_PLAIN_JAVASCRIPT = "text/javascript; charset=utf-8"; + public static final javax.ws.rs.core.MediaType TEXT_JAVASCRIPT_UTF_8_TYPE = new javax.ws.rs.core.MediaType("text", "javascript", "utf-8"); + public static final String APPLICATION_JSON = javax.ws.rs.core.MediaType.APPLICATION_JSON; public static final javax.ws.rs.core.MediaType APPLICATION_JSON_TYPE = javax.ws.rs.core.MediaType.APPLICATION_JSON_TYPE; diff --git a/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-datasources2.xml b/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-datasources2.xml new file mode 100755 index 0000000000..19d41b3056 --- /dev/null +++ b/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-datasources2.xml @@ -0,0 +1,57 @@ + + + + + + org.jboss.as.connector + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + + h2 + + sa + sa + + + + + org.h2.jdbcx.JdbcDataSource + + + + + + + jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE + + + + + jdbc:h2:${jboss.server.data.dir}/../../shared-database/keycloak;AUTO_SERVER=TRUE + + + diff --git a/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan.xml b/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan.xml index f779bcf19f..0c969049c3 100755 --- a/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan.xml +++ b/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan.xml @@ -59,6 +59,9 @@ + + + @@ -72,7 +75,7 @@ - + @@ -108,21 +111,24 @@ - + - + + + + - + @@ -134,7 +140,7 @@ - + diff --git a/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan2.xml b/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan2.xml new file mode 100755 index 0000000000..f779bcf19f --- /dev/null +++ b/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan2.xml @@ -0,0 +1,146 @@ + + + + + + org.jboss.as.clustering.infinispan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +