KEYCLOAK-9780 Replace XSLT transformations by ant/CLI scripts
This commit is contained in:
parent
d7313d91e5
commit
cf35a4648b
36 changed files with 459 additions and 1171 deletions
|
@ -93,6 +93,7 @@
|
|||
<keycloak.connectionsJpa.user>sa</keycloak.connectionsJpa.user>
|
||||
<keycloak.connectionsJpa.password></keycloak.connectionsJpa.password>
|
||||
<keycloak.connectionsJpa.url>jdbc:h2:mem:test;MVCC=TRUE;DB_CLOSE_DELAY=-1</keycloak.connectionsJpa.url>
|
||||
<keycloak.connectionsJpa.schema>DEFAULT</keycloak.connectionsJpa.schema>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<common.resources>${project.parent.basedir}/common</common.resources>
|
||||
<assembly.xml>${project.parent.basedir}/assembly.xml</assembly.xml>
|
||||
<app.server.jboss.home>${containers.home}/${app.server.jboss.unpacked.folder.name}</app.server.jboss.home>
|
||||
<security.xslt>security.xsl</security.xslt>
|
||||
<oidc-adapter.version>${project.version}</oidc-adapter.version>
|
||||
<saml-adapter.version>${project.version}</saml-adapter.version>
|
||||
<skip.elytron.adapter.installation>true</skip.elytron.adapter.installation>
|
||||
|
@ -740,9 +739,6 @@
|
|||
<value>eap6</value>
|
||||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<security.xslt>security-eap6.xsl</security.xslt>
|
||||
</properties>
|
||||
<modules>
|
||||
<module>eap6</module>
|
||||
</modules>
|
||||
|
|
|
@ -11,7 +11,7 @@ Common configurations of Keycloak server on JBoss-based container (Wildfly/EAP).
|
|||
|
||||
### Submodules
|
||||
|
||||
#### `wildfly` Wildfly 10
|
||||
#### `wildfly` Wildfly latest
|
||||
- Builds keycloak server on top of latest Wildfly.
|
||||
- Activated by __`-Pauth-server-wildfly`__
|
||||
|
||||
|
@ -32,14 +32,10 @@ By setting `-Dserver-overlay=true` you can switch to server overlay instead. See
|
|||
|
||||
Configures Keycloak JDBC datasource in `standalone.xml`. See profile `jpa`.
|
||||
|
||||
### SSL
|
||||
|
||||
Configures SSL in `standalone.xml`. See profile `ssl`.
|
||||
|
||||
### Cluster
|
||||
|
||||
Configures in `standalone-ha.xml`:
|
||||
- h2 datasource over TCP
|
||||
- h2 datasource over TCP (if not executed together with jpa)
|
||||
- parameters of Keycloak Infinispan caches
|
||||
|
||||
See profile `auth-server-cluster`.
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
|
||||
<xsl:variable name="nsDS" select="'urn:jboss:domain:logging:'"/>
|
||||
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='root-logger' and starts-with(namespace-uri(), $nsDS)]">
|
||||
<logger category="org.hibernate.dialect.Dialect">
|
||||
<level name="ALL"/>
|
||||
</logger>
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@* | node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copy everything else. -->
|
||||
<xsl:template match="@* | node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@* | node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,10 +1,25 @@
|
|||
<project>
|
||||
|
||||
<target name="check-configuration-state">
|
||||
<available property="crossdc-configured" file="${project.build.directory}/crossdc-configured"/>
|
||||
<available property="cluster-configured" file="${project.build.directory}/cluster-configured"/>
|
||||
<echo>crossdc-configured: ${crossdc-configured}</echo>
|
||||
<echo>cluster-configured: ${cluster-configured}</echo>
|
||||
<property name="cli.tmp.dir" value="${project.build.directory}/cli" />
|
||||
|
||||
<target name="set-server-config">
|
||||
<condition property="server.config" value="standalone.xml">
|
||||
<equals arg1="${ant.scenario}" arg2="scenario-standalone"/>
|
||||
</condition>
|
||||
<condition property="server.config" value="standalone-ha.xml">
|
||||
<or>
|
||||
<equals arg1="${ant.scenario}" arg2="scenario-cluster"/>
|
||||
<equals arg1="${ant.scenario}" arg2="scenario-crossdc"/>
|
||||
</or>
|
||||
</condition>
|
||||
<fail message="Property $${ant.scenario} must be set.">
|
||||
<condition>
|
||||
<not>
|
||||
<isset property="server.config" />
|
||||
</not>
|
||||
</condition>
|
||||
</fail>
|
||||
<echo>server.config: ${server.config}</echo>
|
||||
</target>
|
||||
|
||||
<macrodef name="bin-chmod">
|
||||
|
@ -26,23 +41,180 @@
|
|||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<target name="crossdc" unless="crossdc-configured" depends="check-configuration-state">
|
||||
<target name="apply-cli-scripts" depends="set-server-config">
|
||||
<concat destfile="${cli.tmp.dir}/result.cli" fixlastline="true">
|
||||
<header filtering="no" trimleading="yes">
|
||||
embed-server --server-config=${server.config}
|
||||
</header>
|
||||
<fileset dir="${cli.tmp.dir}" includes="*.cli"/>
|
||||
</concat>
|
||||
<bin-chmod/>
|
||||
<exec dir="${auth.server.home}/bin" executable="./${jboss.cli.executable}" failonerror="true">
|
||||
<arg value="--file=${common.resources}/jboss-cli/cross-dc-setup.cli"/>
|
||||
<arg value="--file=${cli.tmp.dir}/result.cli"/>
|
||||
</exec>
|
||||
<cleanup/>
|
||||
<touch file="${project.build.directory}/crossdc-configured"/>
|
||||
</target>
|
||||
|
||||
<!-- TODO: will be better if other subsystems are configured through CLI as well rather than XSL -->
|
||||
<target name="undertow-subsystem-cluster" unless="cluster-configured" depends="check-configuration-state">
|
||||
<bin-chmod/>
|
||||
<exec dir="${auth.server.home}/bin" executable="./${jboss.cli.executable}" failonerror="true">
|
||||
<arg value="--file=${common.resources}/jboss-cli/undertow-subsystem-cluster-setup.cli"/>
|
||||
</exec>
|
||||
<cleanup/>
|
||||
<touch file="${project.build.directory}/cluster-configured"/>
|
||||
<target name="scenario-standalone-generate" depends="io-worker-threads, inject-provider-and-truststore">
|
||||
<echo>cli scripts for standalone prepared</echo>
|
||||
</target>
|
||||
|
||||
<target name="scenario-cluster-generate" depends="io-worker-threads,
|
||||
inject-provider-and-truststore,
|
||||
undertow-subsystem-cluster,
|
||||
ispn-cache-owners,
|
||||
ispn-log-level">
|
||||
<echo>cli scripts for cluster prepared</echo>
|
||||
</target>
|
||||
|
||||
<target name="scenario-crossdc-generate" depends="io-worker-threads,
|
||||
inject-provider-and-truststore,
|
||||
cross-dc-setup,
|
||||
ispn-log-level">
|
||||
<echo>cli scripts for crossdc prepared</echo>
|
||||
</target>
|
||||
|
||||
<target name="io-worker-threads">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/io.cli"/>
|
||||
</resources>
|
||||
<filterset>
|
||||
<filter token="IO_WORKER_IO_THREADS" value="${auth.server.worker.io-threads}"/>
|
||||
<filter token="IO_WORKER_TASK_MAX_THREADS" value="${auth.server.worker.task-max-threads}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="inject-provider-and-truststore">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/keycloak-server-subsystem.cli"/>
|
||||
</resources>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="set-manual-migration-strategy">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/set-manual-migration-strategy.cli"/>
|
||||
</resources>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="configure-server-jpa" depends="update-jpa-schema">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/configure-server-jpa.cli"/>
|
||||
</resources>
|
||||
<filterset>
|
||||
<filter token="DATABASE" value="${jdbc.mvn.artifactId}"/>
|
||||
<filter token="DRIVER_VERSION" value="${jdbc.mvn.version}"/>
|
||||
<filter token="DRIVER_TMP_DIR" value="${jdbc.driver.tmp.dir}"/>
|
||||
<filter token="JDBC_URL" value="${keycloak.connectionsJpa.url}"/>
|
||||
<filter token="USER" value="${keycloak.connectionsJpa.user}"/>
|
||||
<filter token="PASSWORD" value="${keycloak.connectionsJpa.password}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="update-jpa-schema" if="update.schema" depends="schema-update-required">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/update-jpa-schema.cli"/>
|
||||
</resources>
|
||||
<filterset>
|
||||
<filter token="SCHEMA" value="${keycloak.connectionsJpa.schema}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="schema-update-required">
|
||||
<condition property="update.schema">
|
||||
<not>
|
||||
<equals arg1="${keycloak.connectionsJpa.schema}" arg2="DEFAULT"/>
|
||||
</not>
|
||||
</condition>
|
||||
<echo>Updating schema?: ${update.schema}</echo>
|
||||
<echo>keycloak.connectionsJpa.schema: ${keycloak.connectionsJpa.schema}</echo>
|
||||
</target>
|
||||
|
||||
<target name="undertow-subsystem-cluster">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/undertow-subsystem-cluster-setup.cli"/>
|
||||
</resources>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="ispn-cache-owners">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/ispn-cache-owners.cli"/>
|
||||
</resources>
|
||||
<filterset>
|
||||
<filter token="SESSION_CACHE_OWNERS" value="${session.cache.owners}"/>
|
||||
<filter token="OFFLINE_SESSION_CACHE_OWNERS" value="${offline.session.cache.owners}"/>
|
||||
<filter token="LOGIN_FAILURE_CACHE_OWNERS" value="${login.failure.cache.owners}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="ispn-log-level" if="set.ispn.log.level" depends="ispn-log-level-update-required">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/add-infinispan-log-level.cli"/>
|
||||
</resources>
|
||||
<filterset>
|
||||
<filter token="INFINISPAN_LOG_LEVEL" value="${infinispan.log.level}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="ispn-log-level-update-required">
|
||||
<condition property="set.ispn.log.level">
|
||||
<or>
|
||||
<equals arg1="${infinispan.log.level}" arg2="DEBUG"/>
|
||||
<equals arg1="${infinispan.log.level}" arg2="TRACE"/>
|
||||
</or>
|
||||
</condition>
|
||||
<echo>Updating infinispan log level?: ${set.ispn.log.level}</echo>
|
||||
<echo>infinispan.log.level: ${infinispan.log.level}</echo>
|
||||
</target>
|
||||
|
||||
<target name="replace-jdbc-url">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/replace-jdbc-url.cli"/>
|
||||
</resources>
|
||||
<filterset>
|
||||
<filter token="JDBC_URL" value="${h2.jdbc.url}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="cross-dc-setup">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/cross-dc-setup.cli"/>
|
||||
</resources>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!--following target is used by testsuite/integration-arquillian/servers/migration-->
|
||||
<target name="configure-server-jpa-legacy">
|
||||
<copy todir="${cli.tmp.dir}">
|
||||
<resources>
|
||||
<file file="${common.resources}/jboss-cli/migration/configure-server-jpa-legacy.cli"/>
|
||||
</resources>
|
||||
<filterset>
|
||||
<filter token="DATABASE" value="${jdbc.mvn.artifactId}"/>
|
||||
<filter token="DRIVER_VERSION" value="${jdbc.mvn.version.legacy}"/>
|
||||
<filter token="DRIVER_TMP_DIR" value="${jdbc.driver.tmp.dir}"/>
|
||||
<filter token="JDBC_URL" value="${keycloak.connectionsJpa.url}"/>
|
||||
<filter token="USER" value="${keycloak.connectionsJpa.user}"/>
|
||||
<filter token="PASSWORD" value="${keycloak.connectionsJpa.password}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
</project>
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
|
||||
<xsl:variable name="nsDS" select="'urn:jboss:domain:datasources:'"/>
|
||||
|
||||
<xsl:param name="pool.name" select="'KeycloakDS'"/>
|
||||
<xsl:param name="jdbc.url" />
|
||||
|
||||
<!-- replace JDBC URL -->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasources' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasource' and starts-with(namespace-uri(), $nsDS) and @pool-name=$pool.name]
|
||||
/*[local-name()='connection-url' and starts-with(namespace-uri(), $nsDS)]">
|
||||
<connection-url>
|
||||
<xsl:value-of select="$jdbc.url"/>
|
||||
</connection-url>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copy everything else. -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,125 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
|
||||
<xsl:variable name="nsDS" select="'urn:jboss:domain:datasources:'"/>
|
||||
<xsl:variable name="nsKS" select="'urn:jboss:domain:keycloak-server'"/>
|
||||
|
||||
<!-- Remove keycloak datasource definition. -->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasources' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasource' and starts-with(namespace-uri(), $nsDS) and @pool-name='KeycloakDS']">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:param name="db.jdbc_url"/>
|
||||
<xsl:param name="driver"/>
|
||||
<xsl:param name="schema"/>
|
||||
|
||||
<xsl:param name="min.poolsize" select="'10'"/>
|
||||
<xsl:param name="max.poolsize" select="'50'"/>
|
||||
<xsl:param name="pool.prefill" select="'true'"/>
|
||||
|
||||
<xsl:param name="username"/>
|
||||
<xsl:param name="password"/>
|
||||
|
||||
<xsl:variable name="newDatasourceDefinition">
|
||||
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" use-java-context="true">
|
||||
<connection-url>
|
||||
<xsl:value-of select="$db.jdbc_url"/>
|
||||
</connection-url>
|
||||
<driver>
|
||||
<xsl:value-of select="$driver"/>
|
||||
</driver>
|
||||
<security>
|
||||
<user-name>
|
||||
<xsl:value-of select="$username"/>
|
||||
</user-name>
|
||||
<password>
|
||||
<xsl:value-of select="$password"/>
|
||||
</password>
|
||||
</security>
|
||||
<pool>
|
||||
<min-pool-size>
|
||||
<xsl:value-of select="$min.poolsize"/>
|
||||
</min-pool-size>
|
||||
<max-pool-size>
|
||||
<xsl:value-of select="$max.poolsize"/>
|
||||
</max-pool-size>
|
||||
<prefill>
|
||||
<xsl:value-of select="$pool.prefill"/>
|
||||
</prefill>
|
||||
</pool>
|
||||
</datasource>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="newSchemaDefinition">
|
||||
<xsl:if test="$schema != 'DEFAULT'">
|
||||
<property name="schema" value="{$schema}"/>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="newDriverDefinition">
|
||||
<xsl:if test="$driver != 'h2'">
|
||||
<driver name="{$driver}" module="test.jdbc.{$driver}" />
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- Add new datasource definition. -->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasources' and starts-with(namespace-uri(), $nsDS)]">
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="$newDatasourceDefinition"/>
|
||||
<xsl:apply-templates select="@* | node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Add new driver definition. -->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasources' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='drivers' and starts-with(namespace-uri(), $nsDS)]">
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="$newDriverDefinition"/>
|
||||
<xsl:apply-templates select="@* | node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='spi' and starts-with(namespace-uri(), $nsKS) and @name='connectionsJpa']
|
||||
/*[local-name()='provider' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='properties' and starts-with(namespace-uri(), $nsKS)]">
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="$newSchemaDefinition"/>
|
||||
<xsl:apply-templates select="@* | node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copy everything else. -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,40 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
<xsl:param name="worker.io-threads" select="'16'"/>
|
||||
<xsl:param name="worker.task-max-threads" select="'128'"/>
|
||||
|
||||
<!--set worker threads-->
|
||||
<xsl:template match="//*[local-name()='worker' and @name='default']">
|
||||
<worker name="default" io-threads="{$worker.io-threads}" task-max-threads="{$worker.task-max-threads}" />
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,54 +0,0 @@
|
|||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:i="urn:jboss:domain:infinispan:7.0"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan i">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
<xsl:variable name="nsDS" select="'urn:jboss:domain:datasources:'"/>
|
||||
|
||||
<xsl:param name="sessionCacheOwners" select="'1'"/>
|
||||
<xsl:param name="offlineSessionCacheOwners" select="'1'"/>
|
||||
<xsl:param name="loginFailureCacheOwners" select="'1'"/>
|
||||
|
||||
<xsl:template match="//i:cache-container/i:distributed-cache[@name='sessions']/@owners">
|
||||
<xsl:attribute name="owners">
|
||||
<xsl:value-of select="$sessionCacheOwners"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="//i:cache-container/i:distributed-cache[@name='authenticationSessions']/@owners">
|
||||
<xsl:attribute name="owners">
|
||||
<xsl:value-of select="$sessionCacheOwners"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="//i:cache-container/i:distributed-cache[@name='clientSessions']/@owners">
|
||||
<xsl:attribute name="owners">
|
||||
<xsl:value-of select="$sessionCacheOwners"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="//i:cache-container/i:distributed-cache[@name='offlineSessions']/@owners">
|
||||
<xsl:attribute name="owners">
|
||||
<xsl:value-of select="$offlineSessionCacheOwners"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="//i:cache-container/i:distributed-cache[@name='offlineClientSessions']/@owners">
|
||||
<xsl:attribute name="owners">
|
||||
<xsl:value-of select="$offlineSessionCacheOwners"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
<xsl:template match="//i:cache-container/i:distributed-cache[@name='loginFailures']/@owners">
|
||||
<xsl:attribute name="owners">
|
||||
<xsl:value-of select="$loginFailureCacheOwners"/>
|
||||
</xsl:attribute>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copy everything else. -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
echo *** Adding infinispan logger ***
|
||||
/subsystem=logging/logger=org.infinispan:add(level=@INFINISPAN_LOG_LEVEL@)
|
||||
/subsystem=logging/console-handler=CONSOLE:change-log-level(level=@INFINISPAN_LOG_LEVEL@)
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
echo *** Creating module.xml in modules ***
|
||||
module add --module-root-dir=../modules/system/layers/base/ \
|
||||
--name=test.jdbc.@DATABASE@ \
|
||||
--resources=@DRIVER_TMP_DIR@/@DATABASE@-@DRIVER_VERSION@.jar \
|
||||
--dependencies=javax.api,javax.transaction.api,javax.xml.bind.api
|
||||
|
||||
echo *** Updating datasource subsystem ***
|
||||
echo ** Adding driver definition **
|
||||
/subsystem=datasources/jdbc-driver=@DATABASE@:add(driver-name=@DATABASE@,driver-module-name=test.jdbc.@DATABASE@)
|
||||
|
||||
echo ** Updating connection properties **
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=connection-url,value="@JDBC_URL@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=driver-name,value="@DATABASE@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=user-name,value="@USER@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=password,value="@PASSWORD@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=min-pool-size,value="10")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=max-pool-size,value="50")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=pool-prefill,value="true")
|
||||
|
||||
echo *** Adding dialect logger ***
|
||||
/subsystem=logging/logger=org.hibernate.dialect:add(level=${org.hibernate.dialect.Dialect:ALL})
|
|
@ -1,8 +1,5 @@
|
|||
embed-server --server-config=standalone-ha.xml
|
||||
|
||||
echo **** Begin ****
|
||||
|
||||
echo *** Update jgoups subsystem ***
|
||||
echo *** Update jgroups subsystem ***
|
||||
/subsystem=jgroups/stack=udp/transport=UDP:write-attribute(name=site, value=${jboss.site.name})
|
||||
|
||||
echo *** Update infinispan subsystem ***
|
||||
|
@ -148,6 +145,3 @@ echo *** Update undertow subsystem ***
|
|||
|
||||
echo *** Update keycloak-server subsystem, infinispan remoteStoreSecurity ***
|
||||
/subsystem=keycloak-server/spi=connectionsInfinispan/provider=default:map-put(name=properties,key=remoteStoreSecurityEnabled,value=${keycloak.connectionsInfinispan.default.remoteStoreSecurityEnabled:true})
|
||||
|
||||
|
||||
echo **** End ****
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
echo *** Update io subsystem ***
|
||||
/subsystem=io/worker=default:write-attribute(name=io-threads,value=@IO_WORKER_IO_THREADS@)
|
||||
/subsystem=io/worker=default:write-attribute(name=task-max-threads,value=@IO_WORKER_TASK_MAX_THREADS@)
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
echo *** Updating infinispan cache owners ***
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions:write-attribute(name=owners, value=@SESSION_CACHE_OWNERS@)
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=authenticationSessions:write-attribute(name=owners, value=@SESSION_CACHE_OWNERS@)
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=clientSessions:write-attribute(name=owners, value=@SESSION_CACHE_OWNERS@)
|
||||
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions:write-attribute(name=owners, value=@OFFLINE_SESSION_CACHE_OWNERS@)
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineClientSessions:write-attribute(name=owners, value=@OFFLINE_SESSION_CACHE_OWNERS@)
|
||||
|
||||
/subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:write-attribute(name=owners, value=@LOGIN_FAILURE_CACHE_OWNERS@)
|
|
@ -0,0 +1,23 @@
|
|||
|
||||
echo *** Updating keycloak-server subsystem ***
|
||||
echo ** Adding truststore spi**
|
||||
/subsystem=keycloak-server/spi=truststore/:add
|
||||
/subsystem=keycloak-server/spi=truststore/provider=file/:add(enabled=true,properties={ \
|
||||
file => "${auth.server.truststore:${jboss.home.dir}/standalone/configuration/keycloak.truststore}", \
|
||||
password => "${auth.server.truststore.password:secret}", \
|
||||
hostname-verification-policy => "WILDCARD", \
|
||||
disabled => "false"})
|
||||
|
||||
echo ** Adding login-protocol spi **
|
||||
/subsystem=keycloak-server/spi=login-protocol/:add
|
||||
/subsystem=keycloak-server/spi=login-protocol/provider=saml/:add(enabled=true,properties={knownProtocols => "[\"http=${auth.server.http.port}\",\"https=${auth.server.https.port}\"]"})
|
||||
|
||||
echo ** Adding theme modules **
|
||||
/subsystem=keycloak-server/theme=defaults/:write-attribute(name=modules,value=[org.keycloak.testsuite.integration-arquillian-testsuite-providers])
|
||||
|
||||
echo ** Adding provider **
|
||||
/subsystem=keycloak-server/:write-attribute(name=providers, \
|
||||
value=[ classpath:${jboss.home.dir}/providers/*, \
|
||||
module:org.keycloak.testsuite.integration-arquillian-testsuite-providers \
|
||||
] \
|
||||
)
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
echo *** Creating module.xml in modules ***
|
||||
module add --name=test.jdbc.@DATABASE@ \
|
||||
--resources=@DRIVER_TMP_DIR@/@DATABASE@-@DRIVER_VERSION@.jar \
|
||||
--dependencies=javax.api,javax.transaction.api,javax.xml.bind.api
|
||||
|
||||
echo *** Updating datasource subsystem ***
|
||||
echo ** Adding driver definition **
|
||||
/subsystem=datasources/jdbc-driver=@DATABASE@:add(driver-name=@DATABASE@,driver-module-name=test.jdbc.@DATABASE@)
|
||||
|
||||
echo ** Updating connection properties **
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=connection-url,value="@JDBC_URL@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=driver-name,value="@DATABASE@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=user-name,value="@USER@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=password,value="@PASSWORD@")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=min-pool-size,value="10")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=max-pool-size,value="50")
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=pool-prefill,value="true")
|
||||
|
||||
echo *** Adding dialect logger ***
|
||||
/subsystem=logging/logger=org.hibernate.dialect:add(level=${org.hibernate.dialect.Dialect:ALL})
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
echo ** Updating jdbc url properties **
|
||||
/subsystem=datasources/data-source=KeycloakDS/:write-attribute(name=connection-url,value="@JDBC_URL@")
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
echo *** Updating keycloak-server subsystem ***
|
||||
echo ** Changing migration strategy to manual **
|
||||
/subsystem=keycloak-server/spi=connectionsJpa/provider=default/:write-attribute(name=properties.migrationStrategy,value=manual)
|
||||
/subsystem=keycloak-server/spi=connectionsJpa/provider=default/:write-attribute(name=properties.initializeEmpty,value=false)
|
|
@ -1,8 +1,3 @@
|
|||
embed-server --server-config=standalone-ha.xml
|
||||
|
||||
echo **** Begin ****
|
||||
|
||||
echo *** Update undertow subsystem ***
|
||||
/subsystem=undertow/server=default-server/http-listener=default:write-attribute(name=proxy-address-forwarding,value=true)
|
||||
|
||||
echo **** End ****
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
|
||||
echo *** Updating schema within keycloak-server subsystem connectionsJpa spi ***
|
||||
/subsystem=keycloak-server/spi=connectionsJpa/provider=default/:write-attribute(name=properties.schema,value=@SCHEMA@)
|
|
@ -1,88 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
<xsl:variable name="nsKS" select="'urn:jboss:domain:keycloak-server'"/>
|
||||
<xsl:variable name="truststoreDefinition">
|
||||
<spi name="truststore">
|
||||
<provider name="file" enabled="true">
|
||||
<properties>
|
||||
<property name="file" value="${{auth.server.truststore}}"/>
|
||||
<property name="password" value="${{auth.server.truststore.password}}"/>
|
||||
<property name="hostname-verification-policy" value="WILDCARD"/>
|
||||
<property name="disabled" value="false"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="samlPortsDefinition">
|
||||
<spi name="login-protocol">
|
||||
<provider name="saml" enabled="true">
|
||||
<properties>
|
||||
<property name="knownProtocols" value="["http=${{auth.server.http.port}}","https=${{auth.server.https.port}}"]"/>
|
||||
</properties>
|
||||
</provider>
|
||||
</spi>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="themeModuleDefinition">
|
||||
<modules>
|
||||
<module>org.keycloak.testsuite.integration-arquillian-testsuite-providers</module>
|
||||
</modules>
|
||||
</xsl:variable>
|
||||
|
||||
<!--inject provider; note: due to ibmjdk issues it tries to find out provider which has no attributes-->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsKS)]//*[local-name()='provider' and not(@*)]">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
<provider>
|
||||
<xsl:text>module:org.keycloak.testsuite.integration-arquillian-testsuite-providers</xsl:text>
|
||||
</provider>
|
||||
</xsl:template>
|
||||
|
||||
<!--inject provider for themes -->
|
||||
<xsl:template match="//*[local-name()='theme']">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
<xsl:copy-of select="$themeModuleDefinition"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!--inject truststore and SAML port-protocol mappings-->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsKS)]">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
<xsl:copy-of select="$truststoreDefinition"/>
|
||||
<xsl:copy-of select="$samlPortsDefinition"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!--copy everything else-->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,57 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
<xsl:param name="migration.strategy" />
|
||||
<xsl:param name="initialize.empty" />
|
||||
|
||||
<xsl:variable name="nsKS" select="'urn:jboss:domain:keycloak-server'"/>
|
||||
|
||||
<!--set migrationStrategy-->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='spi' and starts-with(namespace-uri(), $nsKS) and @name='connectionsJpa']
|
||||
/*[local-name()='provider' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='properties' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='property' and starts-with(namespace-uri(), $nsKS) and @name='migrationStrategy']">
|
||||
<property name="migrationStrategy" value="{$migration.strategy}"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--set initializeEmpty-->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='spi' and starts-with(namespace-uri(), $nsKS) and @name='connectionsJpa']
|
||||
/*[local-name()='provider' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='properties' and starts-with(namespace-uri(), $nsKS)]
|
||||
/*[local-name()='property' and starts-with(namespace-uri(), $nsKS) and @name='initializeEmpty']">
|
||||
<property name="initializeEmpty" value="{$initialize.empty}"/>
|
||||
</xsl:template>
|
||||
|
||||
<!--copy everything else-->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -0,0 +1 @@
|
|||
This file is to mark this Maven project as a valid option for building auth server artifact
|
|
@ -1,54 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" />
|
||||
|
||||
|
||||
<xsl:param name="database" select="''"/>
|
||||
<xsl:param name="version" select="''"/>
|
||||
|
||||
<xsl:variable name="newModuleDefinition">
|
||||
<module xmlns="urn:jboss:module:1.1" name="test.jdbc.{$database}">
|
||||
<resources>
|
||||
<resource-root path="{$database}-{$version}.jar"/>
|
||||
</resources>
|
||||
<dependencies>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($database, 'mssql')">
|
||||
<module name="javax.xml.bind.api"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<module name="javax.api"/>
|
||||
<module name="javax.transaction.api"/>
|
||||
</dependencies>
|
||||
</module>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- clear whole document -->
|
||||
<xsl:template match="/*" />
|
||||
|
||||
<!-- Copy new module definition. -->
|
||||
<xsl:template match="/*">
|
||||
<xsl:copy-of select="$newModuleDefinition"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -61,7 +61,8 @@
|
|||
<!--used in profile auth-server-cluster. profile jpa sets this to true-->
|
||||
<skip.h2.tcp>false</skip.h2.tcp>
|
||||
|
||||
<security.xsl>security.xsl</security.xsl>
|
||||
<!-- default ant scenario -->
|
||||
<ant.scenario>scenario-standalone</ant.scenario>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
|
@ -145,62 +146,6 @@
|
|||
<plugin>
|
||||
<artifactId>maven-enforcer-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>io-worker-threads</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<includes>
|
||||
<include>standalone.xml</include>
|
||||
<include>standalone-ha.xml</include>
|
||||
</includes>
|
||||
<stylesheet>${common.resources}/io.xsl</stylesheet>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>worker.io-threads</name>
|
||||
<value>${auth.server.worker.io-threads}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>worker.task-max-threads</name>
|
||||
<value>${auth.server.worker.task-max-threads}</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>inject-provider-and-truststore</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<includes>
|
||||
<include>standalone.xml</include>
|
||||
<include>standalone-ha.xml</include>
|
||||
</includes>
|
||||
<stylesheet>${common.resources}/keycloak-server-subsystem.xsl</stylesheet>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
|
@ -259,13 +204,45 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>ant-generate-default</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="${ant.scenario}-generate">
|
||||
<!-- These properties become equivalent to properties defined on the command line. -->
|
||||
<!-- Without specifying those the default values would be used regardless what is -->
|
||||
<!-- defined via -Dproperty=value when executing maven command -->
|
||||
<property name="auth.server.worker.io-threads">${auth.server.worker.io-threads}</property>
|
||||
<property name="auth.server.worker.task-max-threads">${auth.server.worker.task-max-threads}</property>
|
||||
<!-- Following properties are cluster specific -->
|
||||
<property name="session.cache.owners">${session.cache.owners}</property>
|
||||
<property name="offline.session.cache.owners">${offline.session.cache.owners}</property>
|
||||
<property name="login.failure.cache.owners">${login.failure.cache.owners}</property>
|
||||
</ant>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>ant-apply-prepared-clis</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="apply-cli-scripts" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
|
@ -356,12 +333,12 @@
|
|||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>jpa</id>
|
||||
<properties>
|
||||
<jdbc.mvn.driver.deployment.dir>${auth.server.home}/modules/system/layers/base/test/jdbc/${jdbc.mvn.artifactId}/main</jdbc.mvn.driver.deployment.dir>
|
||||
<jdbc.driver.tmp.dir>${project.build.directory}/jdbc-driver</jdbc.driver.tmp.dir>
|
||||
<skip.h2.tcp>true</skip.h2.tcp>
|
||||
<keycloak.connectionsJpa.schema>DEFAULT</keycloak.connectionsJpa.schema>
|
||||
</properties>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
|
@ -378,23 +355,26 @@
|
|||
<rules>
|
||||
<requireProperty>
|
||||
<property>jdbc.mvn.groupId</property>
|
||||
<regex>((?!com.h2database).)*</regex>
|
||||
<regexMessage>jdbc.mvn.groupId property is not set correctly: ${jdbc.mvn.groupId}. Profile jpa is not supported for default h2 values!</regexMessage>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>jdbc.mvn.artifactId</property>
|
||||
<regex>((?!h2).)*</regex>
|
||||
<regexMessage>jdbc.mvn.artifactId property is not set correctly: ${jdbc.mvn.artifactId}. Profile jpa is not supported for default h2 values!</regexMessage>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>jdbc.mvn.version</property>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>keycloak.connectionsJpa.user</property>
|
||||
<regex>((?!${h2.version}).)*</regex>
|
||||
<regexMessage>jdbc.mvn.version property is not set correctly: ${jdbc.mvn.version}. Profile jpa is not supported for default h2 values!</regexMessage>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>keycloak.connectionsJpa.password</property>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>keycloak.connectionsJpa.url</property>
|
||||
<regex>^(?!\s*$).+</regex>
|
||||
<regexMessage>keycloak.connectionsJpa.password property cannot be empty string!</regexMessage>
|
||||
</requireProperty>
|
||||
</rules>
|
||||
<fail>true</fail>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@ -404,7 +384,7 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>jdbc-driver</id>
|
||||
<phase>process-resources</phase>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>copy</goal>
|
||||
</goals>
|
||||
|
@ -417,85 +397,37 @@
|
|||
<type>jar</type>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${jdbc.mvn.driver.deployment.dir}</outputDirectory>
|
||||
<outputDirectory>${jdbc.driver.tmp.dir}</outputDirectory>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>configure-wildfly-datasource</id>
|
||||
<phase>process-resources</phase>
|
||||
<id>configure-server-jpa</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<!-- create module.xml in modules -->
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/modules/system/layers/base/com/h2database/h2/main</dir>
|
||||
<stylesheet>src/main/resources/xslt/module.xsl</stylesheet>
|
||||
<includes>
|
||||
<include>module.xml</include>
|
||||
</includes>
|
||||
<outputDir>${jdbc.mvn.driver.deployment.dir}</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>database</name>
|
||||
<value>${jdbc.mvn.artifactId}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>version</name>
|
||||
<value>${jdbc.mvn.version}</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
<!-- add datasource to standalone.xml -->
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<stylesheet>${common.resources}/datasource.xsl</stylesheet>
|
||||
<includes>
|
||||
<include>standalone.xml</include>
|
||||
<include>standalone-ha.xml</include>
|
||||
</includes>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>db.jdbc_url</name>
|
||||
<value>${keycloak.connectionsJpa.url}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>driver</name>
|
||||
<value>${jdbc.mvn.artifactId}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>username</name>
|
||||
<value>${keycloak.connectionsJpa.user}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>password</name>
|
||||
<value>${keycloak.connectionsJpa.password}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>schema</name>
|
||||
<value>${keycloak.connectionsJpa.schema}</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
<!-- add logger for org.hibernate.dialect.Dialect -->
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<stylesheet>${common.resources}/add-dialect-logger.xsl</stylesheet>
|
||||
<includes>
|
||||
<include>standalone.xml</include>
|
||||
</includes>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="configure-server-jpa">
|
||||
<!-- These properties become equivalent to properties defined on the command line. -->
|
||||
<!-- Without specifying those the default values would be used regardless what is -->
|
||||
<!-- defined via -Dproperty=value when executing maven command -->
|
||||
<property name="jdbc.driver.tmp.dir">${jdbc.driver.tmp.dir}</property>
|
||||
<property name="jdbc.mvn.artifactId">${jdbc.mvn.artifactId}</property>
|
||||
<property name="jdbc.mvn.version">${jdbc.mvn.version}</property>
|
||||
<property name="keycloak.connectionsJpa.url">${keycloak.connectionsJpa.url}</property>
|
||||
<property name="keycloak.connectionsJpa.user">${keycloak.connectionsJpa.user}</property>
|
||||
<property name="keycloak.connectionsJpa.password">${keycloak.connectionsJpa.password}</property>
|
||||
<property name="keycloak.connectionsJpa.schema">${keycloak.connectionsJpa.schema}</property>
|
||||
</ant>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@ -517,42 +449,23 @@
|
|||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>set-manual-migration-strategy</id>
|
||||
<phase>process-resources</phase>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip></skip>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<includes>
|
||||
<include>standalone.xml</include>
|
||||
</includes>
|
||||
<stylesheet>${common.resources}/migration-strategy.xsl</stylesheet>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>migration.strategy</name>
|
||||
<value>manual</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>initialize.empty</name>
|
||||
<value>false</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="set-manual-migration-strategy" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
|
@ -598,7 +511,9 @@
|
|||
<profile>
|
||||
<id>auth-servers-crossdc-jboss</id>
|
||||
<properties>
|
||||
<crossdc.jboss.jdbc.url>jdbc:h2:tcp://localhost:9092/mem:keycloak-dc-shared;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</crossdc.jboss.jdbc.url>
|
||||
<ant.scenario>scenario-crossdc</ant.scenario>
|
||||
|
||||
<h2.jdbc.url>jdbc:h2:tcp://localhost:9092/mem:keycloak-dc-shared;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</h2.jdbc.url>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
|
@ -631,55 +546,20 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jpa-h2-tcp</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skip.h2.tcp}</skip>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<includes>
|
||||
<include>standalone-ha.xml</include>
|
||||
</includes>
|
||||
<stylesheet>${common.resources}/datasource-jdbc-url.xsl</stylesheet>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>pool.name</name>
|
||||
<value>KeycloakDS</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>jdbc.url</name>
|
||||
<value>${crossdc.jboss.jdbc.url}</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>configure-crossdc</id>
|
||||
<phase>process-resources</phase>
|
||||
<id>jpa-h2-tcp</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skip.h2.tcp}</skip>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="crossdc" />
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="replace-jdbc-url" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -693,6 +573,8 @@
|
|||
<profile>
|
||||
<id>auth-server-cluster</id>
|
||||
<properties>
|
||||
<ant.scenario>scenario-cluster</ant.scenario>
|
||||
|
||||
<session.cache.owners>1</session.cache.owners>
|
||||
<offline.session.cache.owners>1</offline.session.cache.owners>
|
||||
<login.failure.cache.owners>1</login.failure.cache.owners>
|
||||
|
@ -702,92 +584,25 @@
|
|||
Any other value configures it with dynamic-load-provider using the particular `load.metric`.
|
||||
Supported metrics: https://docs.jboss.org/mod_cluster/1.2.0/html/java.AS7config.html#LoadMetric -->
|
||||
|
||||
<h2.jdbc.url>jdbc:h2:tcp://${jboss.bind.address:localhost}:9092/mem:keycloak;DB_CLOSE_DELAY=-1</h2.jdbc.url>
|
||||
</properties>
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>jpa-h2-tcp</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<includes>
|
||||
<include>standalone-ha.xml</include>
|
||||
</includes>
|
||||
<stylesheet>${common.resources}/datasource-jdbc-url.xsl</stylesheet>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>pool.name</name>
|
||||
<value>KeycloakDS</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>jdbc.url</name>
|
||||
<value>jdbc:h2:tcp://${jboss.bind.address:localhost}:9092/mem:keycloak;DB_CLOSE_DELAY=-1</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
<skip>${skip.h2.tcp}</skip>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>keycloak-ispn-caches</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<transformationSet>
|
||||
<dir>${auth.server.home}/standalone/configuration</dir>
|
||||
<includes>
|
||||
<include>standalone-ha.xml</include>
|
||||
</includes>
|
||||
<stylesheet>${common.resources}/ispn-cache-owners.xsl</stylesheet>
|
||||
<outputDir>${auth.server.home}/standalone/configuration</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>sessionCacheOwners</name>
|
||||
<value>${session.cache.owners}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>offlineSessionCacheOwners</name>
|
||||
<value>${offline.session.cache.owners}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>loginFailureCacheOwners</name>
|
||||
<value>${login.failure.cache.owners}</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>configure-undertow-subsystem</id>
|
||||
<phase>process-resources</phase>
|
||||
<id>jpa-h2-tcp</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<skip>${skip.h2.tcp}</skip>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="undertow-subsystem-cluster" />
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="replace-jdbc-url" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -834,9 +649,6 @@
|
|||
|
||||
<profile>
|
||||
<id>auth-server-wildfly</id>
|
||||
<properties>
|
||||
<security.xsl>security-wildfly.xsl</security.xsl>
|
||||
</properties>
|
||||
<modules>
|
||||
<module>wildfly</module>
|
||||
</modules>
|
||||
|
@ -848,7 +660,6 @@
|
|||
</modules>
|
||||
</profile>
|
||||
|
||||
|
||||
<profile>
|
||||
<id>db-failover-mariadb</id>
|
||||
<properties>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
This file is to mark this Maven project as a valid option for building auth server artifact
|
|
@ -1,55 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
xmlns:m="urn:jboss:module:1.3"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan m">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" />
|
||||
|
||||
|
||||
<xsl:param name="database" select="''"/>
|
||||
<xsl:param name="version" select="''"/>
|
||||
|
||||
<xsl:variable name="newModuleDefinition">
|
||||
<module xmlns="urn:jboss:module:1.3" name="test.jdbc.{$database}">
|
||||
<resources>
|
||||
<resource-root path="{$database}-{$version}.jar"/>
|
||||
</resources>
|
||||
<dependencies>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($database, 'mssql')">
|
||||
<module name="javax.xml.bind.api"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<module name="javax.api"/>
|
||||
<module name="javax.transaction.api"/>
|
||||
</dependencies>
|
||||
</module>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- clear whole document -->
|
||||
<xsl:template match="/*" />
|
||||
|
||||
<!-- Copy new module definition. -->
|
||||
<xsl:template match="/*">
|
||||
<xsl:copy-of select="$newModuleDefinition"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -35,7 +35,6 @@
|
|||
<cache.server.jboss.home>${containers.home}/${cache.server.jboss.unpacked.folder.name}</cache.server.jboss.home>
|
||||
<cache.server.jboss.cache-authorization-disabled>true</cache.server.jboss.cache-authorization-disabled>
|
||||
<cache.server.jboss.jdg-transactions-enabled>true</cache.server.jboss.jdg-transactions-enabled>
|
||||
<security.xslt>security.xsl</security.xslt>
|
||||
</properties>
|
||||
|
||||
<profiles>
|
||||
|
|
|
@ -27,14 +27,14 @@
|
|||
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${keycloak.server.home}</directory>
|
||||
<directory>${auth.server.home}</directory>
|
||||
<outputDirectory>auth-server-migration</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>**/*.sh</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${keycloak.server.home}</directory>
|
||||
<directory>${auth.server.home}</directory>
|
||||
<outputDirectory>auth-server-migration</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*.sh</include>
|
||||
|
|
|
@ -30,8 +30,10 @@
|
|||
<name>Migration Server</name>
|
||||
|
||||
<properties>
|
||||
<keycloak.server.home>${project.build.directory}/unpacked/keycloak-${migrated.auth.server.version}</keycloak.server.home>
|
||||
<jdbc.mvn.driver.deployment.dir>${keycloak.server.home}/modules/system/layers/base/test/jdbc/${jdbc.mvn.artifactId}/main</jdbc.mvn.driver.deployment.dir>
|
||||
<common.resources>${basedir}/../auth-server/jboss/common</common.resources>
|
||||
<ant.scenario>scenario-standalone</ant.scenario>
|
||||
<auth.server.home>${project.build.directory}/unpacked/keycloak-${migrated.auth.server.version}</auth.server.home>
|
||||
<jdbc.driver.tmp.dir>${project.build.directory}/jdbc-driver</jdbc.driver.tmp.dir>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
|
@ -49,24 +51,24 @@
|
|||
<rules>
|
||||
<requireProperty>
|
||||
<property>migrated.auth.server.version</property>
|
||||
<property>jdbc.mvn.version.legacy</property>
|
||||
<property>keycloak.connectionsJpa.user</property>
|
||||
<property>keycloak.connectionsJpa.url</property>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>jdbc.mvn.groupId</property>
|
||||
<regex>((?!com.h2database).)*</regex>
|
||||
<regexMessage>jdbc.mvn.groupId property is not set correctly: ${jdbc.mvn.groupId}. Profile jpa is not supported for default h2 values!</regexMessage>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>jdbc.mvn.artifactId</property>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>jdbc.mvn.version.legacy</property>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>keycloak.connectionsJpa.user</property>
|
||||
<regex>((?!h2).)*</regex>
|
||||
<regexMessage>jdbc.mvn.artifactId property is not set correctly: ${jdbc.mvn.artifactId}. Profile jpa is not supported for default h2 values!</regexMessage>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>keycloak.connectionsJpa.password</property>
|
||||
</requireProperty>
|
||||
<requireProperty>
|
||||
<property>keycloak.connectionsJpa.url</property>
|
||||
<regex>^(?!\s*$).+</regex>
|
||||
<regexMessage>keycloak.connectionsJpa.password property cannot be empty string!</regexMessage>
|
||||
</requireProperty>
|
||||
</rules>
|
||||
</configuration>
|
||||
|
@ -110,80 +112,63 @@
|
|||
<type>jar</type>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${jdbc.mvn.driver.deployment.dir}</outputDirectory>
|
||||
<outputDirectory>${jdbc.driver.tmp.dir}</outputDirectory>
|
||||
<overWriteIfNewer>true</overWriteIfNewer>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>xml-maven-plugin</artifactId>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>configure-wildfly-datasource</id>
|
||||
<phase>process-resources</phase>
|
||||
<id>configure-server-jpa</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>transform</goal>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<transformationSets>
|
||||
<!-- create module.xml in modules -->
|
||||
<transformationSet>
|
||||
<dir>${keycloak.server.home}/modules/system/layers/base/com/h2database/h2/main</dir>
|
||||
<stylesheet>src/main/xslt/module.xsl</stylesheet>
|
||||
<includes>
|
||||
<include>module.xml</include>
|
||||
</includes>
|
||||
<outputDir>${jdbc.mvn.driver.deployment.dir}</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>database</name>
|
||||
<value>${jdbc.mvn.artifactId}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>version</name>
|
||||
<value>${jdbc.mvn.version.legacy}</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
<!-- add datasource to standalone.xml -->
|
||||
<transformationSet>
|
||||
<dir>${keycloak.server.home}/standalone/configuration</dir>
|
||||
<stylesheet>src/main/xslt/datasource.xsl</stylesheet>
|
||||
<includes>
|
||||
<include>standalone.xml</include>
|
||||
</includes>
|
||||
<outputDir>${keycloak.server.home}/standalone/configuration</outputDir>
|
||||
<parameters>
|
||||
<parameter>
|
||||
<name>db.jdbc_url</name>
|
||||
<value>${keycloak.connectionsJpa.url}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>driver</name>
|
||||
<value>${jdbc.mvn.artifactId}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>username</name>
|
||||
<value>${keycloak.connectionsJpa.user}</value>
|
||||
</parameter>
|
||||
<parameter>
|
||||
<name>password</name>
|
||||
<value>${keycloak.connectionsJpa.password}</value>
|
||||
</parameter>
|
||||
</parameters>
|
||||
</transformationSet>
|
||||
<!-- add logger for org.hibernate.dialect.Dialect to standalone.xml-->
|
||||
<transformationSet>
|
||||
<dir>${keycloak.server.home}/standalone/configuration</dir>
|
||||
<stylesheet>src/main/xslt/add-dialect-logger.xsl</stylesheet>
|
||||
<includes>
|
||||
<include>standalone.xml</include>
|
||||
</includes>
|
||||
<outputDir>${keycloak.server.home}/standalone/configuration</outputDir>
|
||||
</transformationSet>
|
||||
</transformationSets>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="configure-server-jpa-legacy">
|
||||
<!-- These properties become equivalent to properties defined on the command line. -->
|
||||
<!-- Without specifying those the default values would be used regardless what is -->
|
||||
<!-- defined via -Dproperty=value when executing maven command -->
|
||||
<property name="jdbc.driver.tmp.dir">${jdbc.driver.tmp.dir}</property>
|
||||
<property name="jdbc.mvn.artifactId">${jdbc.mvn.artifactId}</property>
|
||||
<property name="jdbc.mvn.version.legacy">${jdbc.mvn.version.legacy}</property>
|
||||
<property name="keycloak.connectionsJpa.url">${keycloak.connectionsJpa.url}</property>
|
||||
<property name="keycloak.connectionsJpa.user">${keycloak.connectionsJpa.user}</property>
|
||||
<property name="keycloak.connectionsJpa.password">${keycloak.connectionsJpa.password}</property>
|
||||
<property name="keycloak.connectionsJpa.schema">${keycloak.connectionsJpa.schema}</property>
|
||||
</ant>
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>ant-apply-prepared-clis</id>
|
||||
<phase>process-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<ant antfile="${common.resources}/ant/configure.xml" target="apply-cli-scripts" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<!-- to workaround the fact that in older wildlfy/eap versions was missing the option -->
|
||||
<!-- 'module-root-dir' when adding module we need to move it manually afterwards -->
|
||||
<id>move-driver-module</id>
|
||||
<phase>process-test-resources</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<target>
|
||||
<move file="${auth.server.home}/modules/test" todir="${auth.server.home}/modules/system/layers/base/" verbose="true" />
|
||||
</target>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
@ -238,7 +223,7 @@
|
|||
</property>
|
||||
</activation>
|
||||
<properties>
|
||||
<keycloak.server.home>${project.build.directory}/unpacked/${previous.product.unpacked.folder.name}</keycloak.server.home>
|
||||
<auth.server.home>${project.build.directory}/unpacked/${previous.product.unpacked.folder.name}</auth.server.home>
|
||||
</properties>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ 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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
|
||||
<xsl:variable name="nsDS" select="'urn:jboss:domain:logging:'"/>
|
||||
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='root-logger' and starts-with(namespace-uri(), $nsDS)]">
|
||||
<logger category="org.hibernate.dialect.Dialect">
|
||||
<level name="ALL"/>
|
||||
</logger>
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@* | node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copy everything else. -->
|
||||
<xsl:template match="@* | node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@* | node()"/>
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,106 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" standalone="no"/>
|
||||
<xsl:strip-space elements="*"/>
|
||||
|
||||
<xsl:variable name="nsDS" select="'urn:jboss:domain:datasources:'"/>
|
||||
|
||||
<!-- Remove keycloak datasource definition -->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasources' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasource' and starts-with(namespace-uri(), $nsDS) and @pool-name='KeycloakDS']">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:param name="db.jdbc_url"/>
|
||||
<xsl:param name="driver"/>
|
||||
|
||||
<xsl:param name="min.poolsize" select="'10'"/>
|
||||
<xsl:param name="max.poolsize" select="'50'"/>
|
||||
<xsl:param name="pool.prefill" select="'true'"/>
|
||||
|
||||
<xsl:param name="username"/>
|
||||
<xsl:param name="password"/>
|
||||
|
||||
<xsl:variable name="newDatasourceDefinition">
|
||||
<datasource jndi-name="java:jboss/datasources/KeycloakDS" pool-name="KeycloakDS" enabled="true" use-java-context="true">
|
||||
<connection-url>
|
||||
<xsl:value-of select="$db.jdbc_url"/>
|
||||
</connection-url>
|
||||
<driver>
|
||||
<xsl:value-of select="$driver"/>
|
||||
</driver>
|
||||
<security>
|
||||
<user-name>
|
||||
<xsl:value-of select="$username"/>
|
||||
</user-name>
|
||||
<password>
|
||||
<xsl:value-of select="$password"/>
|
||||
</password>
|
||||
</security>
|
||||
<pool>
|
||||
<min-pool-size>
|
||||
<xsl:value-of select="$min.poolsize"/>
|
||||
</min-pool-size>
|
||||
<max-pool-size>
|
||||
<xsl:value-of select="$max.poolsize"/>
|
||||
</max-pool-size>
|
||||
<prefill>
|
||||
<xsl:value-of select="$pool.prefill"/>
|
||||
</prefill>
|
||||
</pool>
|
||||
</datasource>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="newDriverDefinition">
|
||||
<xsl:if test="$driver != 'h2'">
|
||||
<driver name="{$driver}" module="test.jdbc.{$driver}"/>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- Add new datasource definition. -->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasources' and starts-with(namespace-uri(), $nsDS)]">
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="$newDatasourceDefinition"/>
|
||||
<xsl:apply-templates select="@* | node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Add new driver definition. -->
|
||||
<xsl:template match="//*[local-name()='subsystem' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='datasources' and starts-with(namespace-uri(), $nsDS)]
|
||||
/*[local-name()='drivers' and starts-with(namespace-uri(), $nsDS)]">
|
||||
<xsl:copy>
|
||||
<xsl:copy-of select="$newDriverDefinition"/>
|
||||
<xsl:apply-templates select="@* | node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Copy everything else. -->
|
||||
<xsl:template match="@*|node()">
|
||||
<xsl:copy>
|
||||
<xsl:apply-templates select="@*|node()" />
|
||||
</xsl:copy>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,54 +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.
|
||||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xalan="http://xml.apache.org/xalan"
|
||||
version="2.0"
|
||||
exclude-result-prefixes="xalan">
|
||||
|
||||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xalan:indent-amount="4" />
|
||||
|
||||
|
||||
<xsl:param name="database" select="''"/>
|
||||
<xsl:param name="version" select="''"/>
|
||||
|
||||
<xsl:variable name="newModuleDefinition">
|
||||
<module xmlns="urn:jboss:module:1.3" name="test.jdbc.{$database}">
|
||||
<resources>
|
||||
<resource-root path="{$database}-{$version}.jar"/>
|
||||
</resources>
|
||||
<dependencies>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($database, 'mssql')">
|
||||
<module name="javax.xml.bind.api"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
<module name="javax.api"/>
|
||||
<module name="javax.transaction.api"/>
|
||||
</dependencies>
|
||||
</module>
|
||||
</xsl:variable>
|
||||
|
||||
<!-- clear whole document -->
|
||||
<xsl:template match="/*" />
|
||||
|
||||
<!-- Copy new module definition. -->
|
||||
<xsl:template match="/*">
|
||||
<xsl:copy-of select="$newModuleDefinition"/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -36,13 +36,8 @@
|
|||
<eap6.version>7.5.21.Final-redhat-1</eap6.version>
|
||||
<eap71.version>7.1.5.GA-redhat-00002</eap71.version>
|
||||
<jboss.as.version>7.1.1.Final</jboss.as.version>
|
||||
<karaf3.version>3.0.3</karaf3.version>
|
||||
<fuse61.version>6.1.0.redhat-379</fuse61.version>
|
||||
<!--<fuse62.version>6.2.0.redhat-133</fuse62.version>-->
|
||||
<fuse62.version>6.2.1.redhat-084</fuse62.version>
|
||||
|
||||
<!-- cache server versions -->
|
||||
<!--<infinispan.version>8.2.8.Final</infinispan.version>--><!-- Use same infinspan-server version as our version -->
|
||||
<jdg.version>9.4.6.Final-redhat-00002</jdg.version><!-- JDG 7.3.0 -->
|
||||
|
||||
<jboss.default.worker.io-threads>16</jboss.default.worker.io-threads>
|
||||
|
|
|
@ -18,11 +18,12 @@ public class H2TestEnricher {
|
|||
protected final Logger log = Logger.getLogger(this.getClass());
|
||||
|
||||
boolean runH2 = Boolean.parseBoolean(System.getProperty("run.h2", "false"));
|
||||
boolean dockerDatabaseSkip = Boolean.parseBoolean(System.getProperty("docker.database.skip", "true"));
|
||||
|
||||
private Server server = null;
|
||||
|
||||
public void startH2(@Observes(precedence = 3) BeforeSuite event) throws SQLException {
|
||||
if (runH2) {
|
||||
if (runH2 && dockerDatabaseSkip) {
|
||||
log.info("Starting H2 database.");
|
||||
server = Server.createTcpServer();
|
||||
server.start();
|
||||
|
@ -31,7 +32,7 @@ public class H2TestEnricher {
|
|||
}
|
||||
|
||||
public void stopH2(@Observes(precedence = -2) AfterSuite event) {
|
||||
if (runH2 && server.isRunning(false)) {
|
||||
if (runH2 && dockerDatabaseSkip && server.isRunning(false)) {
|
||||
log.info("Stopping H2 database.");
|
||||
server.stop();
|
||||
assert !server.isRunning(false);
|
||||
|
|
|
@ -1180,6 +1180,7 @@
|
|||
<configuration>
|
||||
<systemPropertyVariables>
|
||||
<run.h2>true</run.h2>
|
||||
<docker.database.skip>${docker.database.skip}</docker.database.skip>
|
||||
|
||||
<auth.server.jboss>false</auth.server.jboss>
|
||||
|
||||
|
|
Loading…
Reference in a new issue