diff --git a/adapters/saml/pom.xml b/adapters/saml/pom.xml index 950a0d520c..79afdb442f 100755 --- a/adapters/saml/pom.xml +++ b/adapters/saml/pom.xml @@ -33,24 +33,11 @@ core-public core + jetty undertow tomcat wildfly servlet-filter wildfly-elytron - - - - community - - - !product - - - - jetty - - - diff --git a/common/src/main/java/org/keycloak/common/Profile.java b/common/src/main/java/org/keycloak/common/Profile.java index 9c66517b29..2a6ded3c0f 100755 --- a/common/src/main/java/org/keycloak/common/Profile.java +++ b/common/src/main/java/org/keycloak/common/Profile.java @@ -34,12 +34,9 @@ import org.jboss.logging.Logger; */ public class Profile { - public static final String PRODUCT_NAME = ProductValue.RHSSO.getName(); - public static final String PROJECT_NAME = ProductValue.KEYCLOAK.getName(); private static final Logger logger = Logger.getLogger(Profile.class); private static Profile CURRENT; - private final ProductValue product; private final ProfileValue profile; private final Set disabledFeatures = new HashSet<>(); private final Set previewFeatures = new HashSet<>(); @@ -50,12 +47,11 @@ public class Profile { this.propertyResolver = resolver; Config config = new Config(); - product = PRODUCT_NAME.toLowerCase().equals(Version.NAME) ? ProductValue.RHSSO : ProductValue.KEYCLOAK; profile = ProfileValue.valueOf(config.getProfile().toUpperCase()); for (Feature f : Feature.values()) { Boolean enabled = config.getConfig(f); - Type type = product.equals(ProductValue.RHSSO) ? f.getTypeProduct() : f.getTypeProject(); + Type type = f.getType(); switch (type) { case DEFAULT: @@ -142,10 +138,6 @@ public class Profile { return !getInstance().disabledFeatures.contains(feature); } - public static boolean isProduct() { - return getInstance().profile.equals(ProfileValue.PRODUCT); - } - public enum Type { DEFAULT, DISABLED_BY_DEFAULT, @@ -195,55 +187,25 @@ public class Profile { JS_ADAPTER("Host keycloak.js and keycloak-authz.js through the Keycloak sever", Type.DEFAULT); - private final Type typeProject; - private final Type typeProduct; + private final Type type; private String label; Feature(String label, Type type) { - this(label, type, type); - } - - Feature(String label, Type typeProject, Type typeProduct) { this.label = label; - this.typeProject = typeProject; - this.typeProduct = typeProduct; + this.type = type; } public String getLabel() { return label; } - public Type getTypeProject() { - return typeProject; - } - - public Type getTypeProduct() { - return typeProduct; - } - - public boolean hasDifferentProductType() { - return typeProject != typeProduct; - } - } - - private enum ProductValue { - KEYCLOAK("Keycloak"), - RHSSO("RH-SSO"); - - private final String name; - - ProductValue(String name) { - this.name = name; - } - - public String getName() { - return name; + public Type getType() { + return type; } } private enum ProfileValue { - COMMUNITY, - PRODUCT, + DEFAULT, PREVIEW } @@ -281,10 +243,14 @@ public class Profile { profile = properties.getProperty("profile"); if (profile != null) { + if (profile.equals("community")) { + profile = "default"; + } + return profile; } - return Version.DEFAULT_PROFILE; + return ProfileValue.DEFAULT.name(); } public Boolean getConfig(Feature feature) { diff --git a/common/src/main/java/org/keycloak/common/Version.java b/common/src/main/java/org/keycloak/common/Version.java index 5766ca3a0b..21280bb8c1 100755 --- a/common/src/main/java/org/keycloak/common/Version.java +++ b/common/src/main/java/org/keycloak/common/Version.java @@ -27,25 +27,17 @@ import java.util.Properties; */ public class Version { public static final String UNKNOWN = "UNKNOWN"; - public static String NAME; - public static String NAME_FULL; - public static String NAME_HTML; + public static final String NAME = "Keycloak"; + public static final String NAME_HTML = "Keycloak"; public static String VERSION; - public static String VERSION_KEYCLOAK; public static String RESOURCES_VERSION; public static String BUILD_TIME; - public static String DEFAULT_PROFILE; static { try (InputStream is = Version.class.getResourceAsStream("/keycloak-version.properties")) { Properties props = new Properties(); props.load(is); - Version.NAME = props.getProperty("name"); - Version.NAME_FULL = props.getProperty("name-full"); - Version.NAME_HTML = props.getProperty("name-html"); - Version.DEFAULT_PROFILE = props.getProperty("default-profile"); Version.VERSION = props.getProperty("version"); - Version.VERSION_KEYCLOAK = props.getProperty("version-keycloak"); Version.BUILD_TIME = props.getProperty("build-time"); Version.RESOURCES_VERSION = Version.VERSION.toLowerCase(); diff --git a/common/src/main/resources/keycloak-version.properties b/common/src/main/resources/keycloak-version.properties index 41bc1a915c..518a78547b 100755 --- a/common/src/main/resources/keycloak-version.properties +++ b/common/src/main/resources/keycloak-version.properties @@ -14,11 +14,5 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -name=${product.name} -name-full=${product.name.full} -name-html=${product.name-html} -version=${product.version} -version-keycloak=${project.version} -build-time=${product.build-time} -default-profile=${product.default-profile} \ No newline at end of file +version=${project.version} +build-time=${project.build-time} \ No newline at end of file diff --git a/common/src/test/java/org/keycloak/common/ProfileTest.java b/common/src/test/java/org/keycloak/common/ProfileTest.java index 8163312ca1..95f7f1a69a 100644 --- a/common/src/test/java/org/keycloak/common/ProfileTest.java +++ b/common/src/test/java/org/keycloak/common/ProfileTest.java @@ -1,20 +1,16 @@ package org.keycloak.common; -import static org.junit.Assert.assertTrue; - import org.junit.Assert; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; +import org.keycloak.common.Profile.Feature; -import java.io.File; -import java.io.IOException; -import java.io.PrintWriter; import java.util.Arrays; import java.util.Comparator; -import java.util.Properties; import java.util.Set; -import org.keycloak.common.Profile.Feature; + +import static org.junit.Assert.assertTrue; public class ProfileTest { @@ -22,31 +18,15 @@ public class ProfileTest { public TemporaryFolder temporaryFolder = new TemporaryFolder(); @Test - public void checkDefaultsKeycloak() { - Assert.assertEquals("community", Profile.getName()); + public void checkDefaults() { + Assert.assertEquals("default", Profile.getName()); assertEquals(Profile.getDisabledFeatures(), Profile.Feature.ADMIN, Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ, Profile.Feature.DYNAMIC_SCOPES, Profile.Feature.DOCKER, Profile.Feature.RECOVERY_CODES, Profile.Feature.SCRIPTS, Profile.Feature.TOKEN_EXCHANGE, Profile.Feature.OPENSHIFT_INTEGRATION, Profile.Feature.MAP_STORAGE, Profile.Feature.DECLARATIVE_USER_PROFILE, Feature.CLIENT_SECRET_ROTATION, Feature.UPDATE_EMAIL); assertEquals(Profile.getPreviewFeatures(), Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ, Profile.Feature.RECOVERY_CODES, Profile.Feature.SCRIPTS, Profile.Feature.TOKEN_EXCHANGE, Profile.Feature.OPENSHIFT_INTEGRATION, Profile.Feature.DECLARATIVE_USER_PROFILE, Feature.CLIENT_SECRET_ROTATION, Feature.UPDATE_EMAIL); } - @Test - public void checkDefaultsRH_SSO() { - System.setProperty("keycloak.profile", "product"); - String backUpName = Version.NAME; - Version.NAME = Profile.PRODUCT_NAME.toLowerCase(); - Profile.init(); - - Assert.assertEquals("product", Profile.getName()); - assertEquals(Profile.getDisabledFeatures(), Profile.Feature.ADMIN, Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ, Profile.Feature.DYNAMIC_SCOPES, Profile.Feature.DOCKER, Profile.Feature.RECOVERY_CODES, Profile.Feature.SCRIPTS, Profile.Feature.TOKEN_EXCHANGE, Profile.Feature.OPENSHIFT_INTEGRATION, Profile.Feature.MAP_STORAGE, Profile.Feature.DECLARATIVE_USER_PROFILE, Feature.CLIENT_SECRET_ROTATION, Feature.UPDATE_EMAIL); - assertEquals(Profile.getPreviewFeatures(), Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ, Profile.Feature.RECOVERY_CODES, Profile.Feature.SCRIPTS, Profile.Feature.TOKEN_EXCHANGE, Profile.Feature.OPENSHIFT_INTEGRATION, Profile.Feature.DECLARATIVE_USER_PROFILE, Feature.CLIENT_SECRET_ROTATION, Feature.UPDATE_EMAIL); - - System.setProperty("keycloak.profile", "community"); - Version.NAME = backUpName; - Profile.init(); - } - @Test public void configWithSystemProperties() { - Assert.assertEquals("community", Profile.getName()); + Assert.assertEquals("default", Profile.getName()); Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.DOCKER)); Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.OPENSHIFT_INTEGRATION)); assertTrue(Profile.isFeatureEnabled(Profile.Feature.IMPERSONATION)); @@ -71,38 +51,6 @@ public class ProfileTest { Profile.init(); } - @Test - public void configWithPropertiesFile() throws IOException { - Assert.assertEquals("community", Profile.getName()); - Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.DOCKER)); - assertTrue(Profile.isFeatureEnabled(Profile.Feature.IMPERSONATION)); - - File d = temporaryFolder.newFolder(); - File f = new File(d, "profile.properties"); - - Properties p = new Properties(); - p.setProperty("profile", "preview"); - p.setProperty("feature.docker", "enabled"); - p.setProperty("feature.impersonation", "disabled"); - p.setProperty("feature.upload_scripts", "enabled"); - PrintWriter pw = new PrintWriter(f); - p.list(pw); - pw.close(); - - System.setProperty("jboss.server.config.dir", d.getAbsolutePath()); - - Profile.init(); - - Assert.assertEquals("preview", Profile.getName()); - assertTrue(Profile.isFeatureEnabled(Profile.Feature.DOCKER)); - assertTrue(Profile.isFeatureEnabled(Profile.Feature.OPENSHIFT_INTEGRATION)); - Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.IMPERSONATION)); - - System.getProperties().remove("jboss.server.config.dir"); - - Profile.init(); - } - public static void assertEquals(Set actual, Profile.Feature... expected) { Profile.Feature[] a = actual.toArray(new Profile.Feature[actual.size()]); Arrays.sort(a, new FeatureComparator()); diff --git a/distribution/adapters/js-adapter-npm-zip/pom.xml b/distribution/adapters/js-adapter-npm-zip/pom.xml index e71d01043e..6f46e9c6e0 100755 --- a/distribution/adapters/js-adapter-npm-zip/pom.xml +++ b/distribution/adapters/js-adapter-npm-zip/pom.xml @@ -85,19 +85,4 @@ - - - - product - - - product - - - - ${product.name}-${product.filename.version}-js-adapter - - - - diff --git a/distribution/adapters/js-adapter-zip/assembly.xml b/distribution/adapters/js-adapter-zip/assembly.xml index 5330d29d85..e35b6b6e8e 100755 --- a/distribution/adapters/js-adapter-zip/assembly.xml +++ b/distribution/adapters/js-adapter-zip/assembly.xml @@ -38,15 +38,15 @@ - src/main/resources/licenses/${product.slot} - docs/licenses-${product.slot}-adapter + src/main/resources/licenses/keycloak + docs/licenses-keycloak-adapter licenses.xml target/licenses - docs/licenses-${product.slot}-adapter + docs/licenses-keycloak-adapter diff --git a/distribution/adapters/js-adapter-zip/pom.xml b/distribution/adapters/js-adapter-zip/pom.xml index 6a7a694caa..3944333462 100755 --- a/distribution/adapters/js-adapter-zip/pom.xml +++ b/distribution/adapters/js-adapter-zip/pom.xml @@ -89,19 +89,4 @@ - - - - product - - - product - - - - ${product.name}-${product.filename.version}-js-adapter - - - - diff --git a/distribution/adapters/pom.xml b/distribution/adapters/pom.xml index bf29d463e8..b3fce30d0c 100755 --- a/distribution/adapters/pom.xml +++ b/distribution/adapters/pom.xml @@ -33,21 +33,8 @@ js-adapter-zip wildfly-adapter + tomcat-adapter-zip + jetty94-adapter-zip + js-adapter-npm-zip - - - - community - - - !product - - - - tomcat-adapter-zip - jetty94-adapter-zip - js-adapter-npm-zip - - - diff --git a/distribution/adapters/wildfly-adapter/pom.xml b/distribution/adapters/wildfly-adapter/pom.xml index 7531b9c18b..ba9dfbc3e3 100644 --- a/distribution/adapters/wildfly-adapter/pom.xml +++ b/distribution/adapters/wildfly-adapter/pom.xml @@ -29,6 +29,7 @@ 1.2.13.Final 15.0.1.Final 5.1.3.Final + assembly.xml keycloak-wildfly-adapter-dist @@ -89,36 +90,4 @@ - - - - community - - - !product - - - - ${wildfly.build-tools.version} - assembly.xml - - - - - product - - - product - - - - assembly.xml - %regex[(docs/contrib.*)|(docs/examples.*)|(docs/schema.*)] - - - ${product.name}-${product.filename.version}-eap7-adapter - - - - diff --git a/distribution/api-docs-dist/pom.xml b/distribution/api-docs-dist/pom.xml index 5b61c91649..2772f40285 100755 --- a/distribution/api-docs-dist/pom.xml +++ b/distribution/api-docs-dist/pom.xml @@ -30,9 +30,51 @@ - ${product.name.full} ${product.version} + Keycloak ${project.version} + + + org.keycloak + keycloak-dependencies-server-all + pom + + + org.keycloak + keycloak-admin-client + + + org.keycloak + keycloak-authz-client + + + + org.keycloak + keycloak-model-build-processor + ${project.version} + + + org.jboss.logging + jboss-logging-annotations + + + net.java.dev.jna + jna + + + + com.googlecode.owasp-java-html-sanitizer + owasp-java-html-sanitizer + + + org.infinispan.protostream + protostream-processor + ${infinispan.protostream.processor.version} + + + keycloak-api-docs-${project.version} @@ -75,165 +117,28 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + + + aggregate-javadoc + + true + + org.keycloak:* + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + - - - - community - - - !product - - - - - org.keycloak - keycloak-dependencies-server-all - pom - - - org.keycloak - keycloak-admin-client - - - org.keycloak - keycloak-authz-client - - - - org.keycloak - keycloak-model-build-processor - ${project.version} - - - org.jboss.logging - jboss-logging-annotations - - - net.java.dev.jna - jna - - - - com.googlecode.owasp-java-html-sanitizer - owasp-java-html-sanitizer - - - org.infinispan.protostream - protostream-processor - ${infinispan.protostream.processor.version} - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - aggregate-javadoc - - true - - org.keycloak:* - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - - - - - product - - - product - - - - - - org.keycloak - keycloak-server-spi - - - org.keycloak - keycloak-common - - - org.keycloak - keycloak-core - - - org.keycloak - keycloak-saml-core-public - - - org.keycloak - keycloak-adapter-spi - - - org.keycloak - keycloak-adapter-core - - - org.keycloak - keycloak-saml-adapter-api-public - - - org.keycloak - keycloak-admin-client - - - org.keycloak - keycloak-authz-client - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - aggregate-javadoc - - ${javadoc.branding} public API - ${javadoc.branding} public API - ${javadoc.branding} - - false - - - org.keycloak:keycloak-server-spi - org.keycloak:keycloak-common - org.keycloak:keycloak-core - org.keycloak:keycloak-saml-core-public - org.keycloak:keycloak-adapter-spi - org.keycloak:keycloak-adapter-core - org.keycloak:keycloak-saml-adapter-api-public - org.keycloak:keycloak-admin-client - org.keycloak:keycloak-authz-client - - - - - - - - - - diff --git a/distribution/downloads/pom.xml b/distribution/downloads/pom.xml index 85a6935f28..48c8325248 100755 --- a/distribution/downloads/pom.xml +++ b/distribution/downloads/pom.xml @@ -29,46 +29,36 @@ Keycloak Release Downloads - - - community - - - !product - - - - - - org.apache.maven.plugins - maven-deploy-plugin + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + org.codehaus.mojo + exec-maven-plugin + + + server-downloads + package + + java + - true + CopyDependencies + + ${settings.localRepository} + ${project.build.directory} + ${project.version} + - - - org.codehaus.mojo - exec-maven-plugin - - - server-downloads - package - - java - - - CopyDependencies - - ${settings.localRepository} - ${project.build.directory} - ${project.version} - - - - - - - - - + + + + + diff --git a/distribution/feature-packs/adapter-feature-pack/assembly.xml b/distribution/feature-packs/adapter-feature-pack/assembly.xml index e1e18e1ade..bf20b3ac28 100644 --- a/distribution/feature-packs/adapter-feature-pack/assembly.xml +++ b/distribution/feature-packs/adapter-feature-pack/assembly.xml @@ -31,15 +31,15 @@ - src/main/resources/licenses/${product.slot} - content/docs/licenses-${product.slot} + src/main/resources/licenses/keycloak + content/docs/licenses-keycloak licenses.xml target/licenses - content/docs/licenses-${product.slot} + content/docs/licenses-keycloak diff --git a/distribution/feature-packs/adapter-feature-pack/pom.xml b/distribution/feature-packs/adapter-feature-pack/pom.xml index fac3f88155..9d6585a32d 100755 --- a/distribution/feature-packs/adapter-feature-pack/pom.xml +++ b/distribution/feature-packs/adapter-feature-pack/pom.xml @@ -27,6 +27,10 @@ 1.2.13.Final 15.0.1.Final 5.1.3.Final + org.wildfly:wildfly-feature-pack + 4.0.0 @@ -150,6 +154,13 @@ + + + org.wildfly + wildfly-feature-pack + ${wildfly.version} + zip + @@ -205,53 +216,4 @@ - - - - - community - - - !product - - - - - ${wildfly.build-tools.version} - org.wildfly:wildfly-feature-pack - - - - - org.wildfly - wildfly-feature-pack - ${wildfly.version} - zip - - - - - - product - - - product - - - - - org.jboss.eap:wildfly-feature-pack - - - - - org.jboss.eap - wildfly-feature-pack - ${eap.version} - zip - - - - - diff --git a/distribution/maven-plugins/licenses-processor/src/main/groovy/LicenseProcessMojo.groovy b/distribution/maven-plugins/licenses-processor/src/main/groovy/LicenseProcessMojo.groovy index 38be55980d..4a1bb705cd 100644 --- a/distribution/maven-plugins/licenses-processor/src/main/groovy/LicenseProcessMojo.groovy +++ b/distribution/maven-plugins/licenses-processor/src/main/groovy/LicenseProcessMojo.groovy @@ -27,7 +27,7 @@ class LicenseProcessMojo extends AbstractMojo { // Property configuration with defaults def outputDirectoryRaw = project.properties['outputDirectory'] ?: "${project.build.directory}/licenses" - def xmlFileSource = project.properties['xmlFileSource'] ?: "${project.basedir}/src/main/resources/licenses/${project.properties['product.slot']}/licenses.xml" + def xmlFileSource = project.properties['xmlFileSource'] ?: "${project.basedir}/src/main/resources/licenses/keycloak/licenses.xml" def licenseName = project.properties['licenseName'] ?: "Apache Software License 2.0" def licenseUrl = project.properties['licenseUrl'] ?: "https://raw.githubusercontent.com/keycloak/keycloak/${project.version}/LICENSE.txt" def groupId = project.properties['groupId'] ?: "org.keycloak" @@ -91,7 +91,7 @@ class LicenseProcessMojo extends AbstractMojo { InputStream input = this.class.getResourceAsStream("keycloak-licenses-common/licenses.xsl") transformer = TransformerFactory.newInstance().newTemplates(new StreamSource(input)).newTransformer() } - transformer.setParameter("productname", project.properties['product.name.full']) + transformer.setParameter("productname", "Keycloak") transformer.setParameter("version", project.version) outputLicensesXmlFile.withInputStream() { inStream -> def input = new StreamSource(inStream) diff --git a/distribution/saml-adapters/pom.xml b/distribution/saml-adapters/pom.xml index 3afc850e8d..c7053ed175 100755 --- a/distribution/saml-adapters/pom.xml +++ b/distribution/saml-adapters/pom.xml @@ -32,21 +32,8 @@ wildfly-adapter + jetty94-adapter-zip + tomcat-adapter-zip - - - community - - - !product - - - - jetty94-adapter-zip - tomcat-adapter-zip - - - - diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml index 46185248d6..dd99dca163 100755 --- a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/assembly.xml @@ -34,7 +34,7 @@ ${project.build.directory}/unpacked/licenses - docs/licenses-${product.slot} + docs/licenses-keycloak diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml index 2dd724ff6a..c113fb6e7e 100755 --- a/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-adapter-zip/pom.xml @@ -89,19 +89,4 @@ - - - - product - - - product - - - - ${product.name}-${product.filename.version}-saml-eap7-adapter - - - - diff --git a/distribution/saml-adapters/wildfly-adapter/wildfly-modules/assembly.xml b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/assembly.xml index e392cd204f..9d38002cfe 100755 --- a/distribution/saml-adapters/wildfly-adapter/wildfly-modules/assembly.xml +++ b/distribution/saml-adapters/wildfly-adapter/wildfly-modules/assembly.xml @@ -25,7 +25,7 @@ - src/main/resources/licenses/${product.slot} + src/main/resources/licenses/keycloak licenses licenses.xml diff --git a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Features.java b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Features.java index 7da37356ea..5ac77a2712 100644 --- a/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Features.java +++ b/docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Features.java @@ -13,7 +13,7 @@ public class Features { public Features() { this.features = Arrays.stream(Profile.Feature.values()) - .filter(f -> !f.getTypeProject().equals(Profile.Type.EXPERIMENTAL)) + .filter(f -> !f.getType().equals(Profile.Type.EXPERIMENTAL)) .map(f -> new Feature(f)) .sorted(Comparator.comparing(Feature::getName)) .collect(Collectors.toList()); @@ -52,7 +52,7 @@ public class Features { } private Profile.Type getType() { - return profileFeature.getTypeProject(); + return profileFeature.getType(); } } diff --git a/docs/pom.xml b/docs/pom.xml index 8d536d77d3..f90fc35d0b 100755 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -29,19 +29,8 @@ keycloak-docs-parent pom - - - quarkus - - [11,) - - !product - - - - maven-plugin - guides - - - + + maven-plugin + guides + diff --git a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/__init__.py b/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/__init__.py deleted file mode 100644 index 5a6b1b092f..0000000000 --- a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/__init__.py +++ /dev/null @@ -1,1436 +0,0 @@ -# -# Copyright 2020 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. -# -# - -""" -Keycloak package for Python to assists with upgrading of Keycloak to -particular Wildfly tag / release. - -Copyright 2020 Red Hat, Inc. and/or its affiliates -and other contributors as indicated by the @author tags. - -To use, simply 'import wildfly.upgrade' and call the necessary routines. -""" - -import colorlog, copy, itertools, logging, lxml.etree, os, os.path, re, sys - -from importlib import import_module -from shutil import copyfileobj -from subprocess import check_call, check_output -from tempfile import NamedTemporaryFile -from urllib.request import HTTPError, urlopen - -__all__ = [ - 'getElementsByXPath', - 'getElementsByXPathFromRemoteXml', - 'getKeycloakGitRepositoryRoot', - 'getModuleLogger', - 'getStepLogger', - 'getTaskLogger', - 'getPomDependencyByArtifactId', - 'getPomProperty', - 'getPomPropertyFromRemoteXml', - 'getVersionOfPomDependency', - 'getXmlRoot', - 'isWellFormedWildflyTag', - 'loadGavDictionaryFromGavFile', - 'loadGavDictionaryFromXmlFile', - 'saveUrlToNamedTemporaryFile', - 'updateAdapterLicenseFile', - 'performMainKeycloakPomFileUpdateTask', - 'performAdapterGalleonPackPomFileUpdateTask', - 'performKeycloakAdapterLicenseFilesUpdateTask', - 'synchronizeInfinispanSubsystemXmlNamespaceWithWildfly' -] - -__author__ = "Jan Lieskovsky " -__loglevel__ = logging.INFO -__status__ = "Alpha" -__version__ = "0.0.2" - -# -# Various constants / data structures for the module -# - -# Empty string -_empty_string = '' -# Base URL of the Keycloak's main pom.xml file from GitHub master branch -_keycloak_github_master_main_pom_base_url = "https://raw.githubusercontent.com/keycloak/keycloak/master/pom.xml" -# Python implementation of the Maven artifact versions comparator -_maven_version_comparator_ = import_module( - 'lib.wildfly.upgrade.dependencies.3rd_party.fabric8-analytics-version-comparator.f8a_version_comparator' -) -# GitHub raw form of the base URL to the specific Wildfly tag repository root -# Note: To get the final version of the URL '%s' format specifier needs to be -# expanded to a particular Wildfly tag / release! -_wildfly_github_raw_base_url_for_tag = ( - 'https://raw.githubusercontent.com/wildfly/wildfly/%s/' -) -# Base URL of the Wildfly's main pom.xml XML file from GitHub tag branch -_wildfly_github_tag_main_pom_base_url = ( - _wildfly_github_raw_base_url_for_tag + - 'pom.xml' -) -# Base URL of the Wildfly's Infinispan subsystem-template XML file from GitHub -# tag branch -_wildfly_github_tag_ispn_subtempl_base_url = ( - _wildfly_github_raw_base_url_for_tag + - 'clustering/infinispan/extension/src/main/resources/subsystem-templates/infinispan.xml' -) - -# POM namespace prefix definition for lxml -_pom_ns = "http://maven.apache.org/POM/4.0.0" - -# Module loggers -_moduleLoggers = {} - -# Maven GAV (groupId:artifactId:version) related constants / data structures -_gav_delimiter = ':' -_gav_elements = ['groupId', 'artifactId', 'version'] - -# -# Various base helper routines -# - -def getKeycloakGitRepositoryRoot(): - """ - Return the absolute path to the Keycloak git repository clone. - """ - return check_output(['git', 'rev-parse', '--show-toplevel']).decode('utf-8').rstrip() - -def isWellFormedWildflyTag(tag): - """ - Well formed Wildfly & Wildfly Core tag seems to follow the patterns: - 1) First a digit followed by a dot both of them exactly three times. - 2) Followed: - a) Either by a "Final" suffix, e.g.: "20.0.0.Final", - b) Or by one of "Alpha", "Beta", "CR" suffices, followed by one digit - - Verifies the tag provided as routine argument follows this schema. - - Exits with error if not. - """ - if tag and not re.search(r'(\d\.){3}((Alpha|Beta|CR)\d|Final)', tag): - getModuleLogger().error("Invalid Wildfly tag '%s', exiting!" % tag) - sys.exit(1) - else: - return tag - -def saveUrlToNamedTemporaryFile(baseUrl): - """ - Fetch URL specified as routine argument to named temporary file and - return the name of that file. - - Otherwise, log an error and exit with failure if HTTP error occurred. - """ - try: - with urlopen(baseUrl) as response: - with NamedTemporaryFile(delete=False) as outfile: - copyfileobj(response, outfile) - return outfile.name - except HTTPError: - getModuleLogger().error("Failed to download the file from '%s'!. Double-check the URL and retry!" % baseUrl) - sys.exit(1) - - return None - -def _emptyNewLine(): - """ - Print additional new line. - """ - print() - -def _logErrorAndExitIf(errorMessage, condition, logger = None): - """ - Log particular error message using either the default or custom logger - specified via the 'logger' parameter, and exit with error if the specified - condition was met. - """ - # Use the default logger if a custom one wasn't requested - if logger is None: - logger = getModuleLogger() - if condition: - _emptyNewLine() - logger.error(errorMessage) - _emptyNewLine() - sys.exit(1) - -# -# Logging facility for the module -# - -def setupLogger(loggerName = 'upgrade-wildfly', loggerFormatter = '%(log_color)s[%(levelname)s] %(name)s: %(message)s'): - """ - Initialize logger with custom 'loggerName' and custom 'loggerFormatter'. - """ - stdOutLogHandler = logging.StreamHandler(sys.stdout) - loggerFormatter = colorlog.ColoredFormatter(loggerFormatter) - stdOutLogHandler.setFormatter(loggerFormatter) - logger = logging.getLogger(loggerName) - logger.addHandler(stdOutLogHandler) - logger.setLevel(__loglevel__) - - return logger - -def getLogger(loggerName = 'Upgrade Wildfly for Keycloak', loggerFormatter = '%(log_color)s[%(levelname)s] [%(name)s]: %(message)s'): - """ - Return instance of a logger with custom 'loggerName' and custom - 'loggerFormatter' or setup such a logger if it doesn't exist yet. - """ - global _moduleLoggers - if not loggerName in _moduleLoggers: - _moduleLoggers[loggerName] = setupLogger(loggerName, loggerFormatter) - - return _moduleLoggers[loggerName] - -def getModuleLogger(): - """ - Return global logger for the module. - """ - return getLogger() - -def getTaskLogger(taskLoggerName): - """ - Return custom logger handling (sub)tasks. - """ - taskLogFormatter = '\n%(log_color)s[%(levelname)s] [%(name)s]\n\n\t%(message)s\n' - return getLogger(loggerName = taskLoggerName, loggerFormatter = taskLogFormatter) - -def getStepLogger(): - """ - Return custom logger handling steps within tasks. - """ - stepLoggerName = 'step' - stepLoggerFormatter = '\t%(log_color)s[%(levelname)s]: %(message)s' - - return getLogger(stepLoggerName, stepLoggerFormatter) - -# -# Various XML search related helper routines -# - -def getElementsByXPath(xmlTree, xPath, nameSpace = { "pom" : "%s" % _pom_ns }): - """ - Given the XML tree return the list of elements matching the 'xPath' from - the XML 'nameSpace'. - - 'nameSpace' is optional argument. If not specified defaults to the POM XML - namespace. - - Returns empty list if no such element matching the specified by 'xPath' is - found. - """ - return xmlTree.xpath(xPath, namespaces = nameSpace) - -def getElementsByXPathFromRemoteXml(xmlUrl, xPath, nameSpace = { "pom" : "%s" % _pom_ns }, errorMessage = None, expectedElementsCount = None): - """ - Given the URL of the remote XML file as 'xmlUrl' return the list of - elements matching the 'xPath' from the XML 'nameSpace'. - - 'nameSpace' is optional argument. If not specified defaults to the POM XML - namespace. - - Returns empty list if no such element matching the specified by 'xPath' is - found. - """ - xmlFile = saveUrlToNamedTemporaryFile(xmlUrl) - xmlRoot = getXmlRoot(xmlFile) - xmlElements = getElementsByXPath(xmlRoot, xPath, nameSpace = nameSpace) - if None not in (errorMessage, expectedElementsCount) and len(xmlElements) != expectedElementsCount: - _logErrorAndExitIf(errorMessage, True) - - return xmlElements - -def getPomDependencyByArtifactId(xmlTree, artifactIdText): - """ - Given the XML tree return list of POM dependency elements matching - 'artifactIdText' in the text of the element. - - Returns empty list if no such element with 'artifactIdText' is found. - """ - return xmlTree.xpath('/pom:project/pom:dependencyManagement/pom:dependencies/pom:dependency/pom:artifactId[text()="%s"]' % artifactIdText, namespaces = { "pom" : "%s" % _pom_ns }) - -def getPomProperty(xmlTree, propertyText): - """ - Given the XML tree return list of POM property elements matching - 'propertyText' in the text of the element. - - Returns empty list if no such element with 'propertyText' is found. - """ - return xmlTree.xpath('/pom:project/pom:properties/pom:%s' % propertyText, namespaces = { "pom" : "%s" % _pom_ns }) - -def getPomPropertyFromRemoteXml(xmlUrl, propertyText, errorMessage = None, expectedElementsCount = None): - """ - Given the URL of the remote XML file as 'xmlUrl' and name of the property - to be retrieved from the XML file as 'propertyText' perform: - * Save the remote XML to local file, - * Obtain the XML root from the content, - * Locate the specified POM property element within the file. - - Moreover, if both 'errorMessage' and 'expectedElementsCount' are provided, - display the 'errorMessage' error message and exit with failure if the count - of found elements matching the 'propertyText' doesn't match the - 'expectedElemsCount' value. - - Returns list of matching property elements or exits with error if count - other than specified in 'expectedElementsCount' is found. - """ - - xmlFile = saveUrlToNamedTemporaryFile(xmlUrl) - xmlRoot = getXmlRoot(xmlFile) - propertyElement = getPomProperty(xmlRoot, propertyText) - if None not in (errorMessage, expectedElementsCount) and len(propertyElement) != expectedElementsCount: - _logErrorAndExitIf(errorMessage, True) - - return propertyElement - -def getVersionOfPomDependency(xmlElem, groupIdText, artifactIdText): - """ - Given the list of XML POM dependency elements, return the value of - '' subelement if 'groupIdText' and 'artifactIdText' match the - value of groupId and artifactId subelements in the dependency. - - Otherwise, return None. - """ - version = None - for entry in xmlElem: - dependencyElem = entry.getparent() - for subelem in list(dependencyElem): - if subelem.tag == '{%s}groupId' % _pom_ns and subelem.text != groupIdText: - break - if subelem.tag == '{%s}artifactId' % _pom_ns and subelem.text != artifactIdText: - break - if subelem.tag == '{%s}version' % _pom_ns: - version = subelem.text - break - - return version - -def getXmlRoot(filename): - """ - Return root element of the XML tree by parsing the content of 'filename'. - - Exit with error in the case of a failure. - """ - try: - xmlRoot = lxml.etree.parse(filename).getroot() - return xmlRoot - except lxml.etree.XMLSyntaxError: - getXmlRootFailureMessage = ( - "Failed to get the root element of the XML tree from '%s' file! " - "Ensure the file is not opened in another process, and retry!" % - filename - ) - getModuleLogger().error(getXmlRootFailureMessage) - sys.exit(1) - -# -# Common helper routines utilized by various tasks -# performed within a Wildfly upgrade -# - -def compareMavenVersions(updatedVersion, currentVersion): - """ - Compare 'updatedVersion' with 'currentVersion' using the generic Maven - version comparison method. - - Return a negative integer, zero, or a positive integer as the - 'updatedVersion' is less than, equal to, or greater than the - 'currentVersion'. - """ - comparableVersion = ( - _maven_version_comparator_ - .comparable_version - .ComparableVersion(updatedVersion) - ) - - return comparableVersion.compare_to(currentVersion) - -def getProductNamesForKeycloakPomProfile(profile = 'community'): - """ - Return values of and elements - of the specified Keycloak main pom.xml 'profile' - """ - (productName, productNameFull) = (None, None) - - _logErrorAndExitIf( - "Invalid profile name '%s'! It can be only one of 'community' or 'product'!" % profile, - profile not in ['community', 'product'] - ) - - # Absolute path to main Keycloak pom.xml within the repo - mainKeycloakPomPath = getKeycloakGitRepositoryRoot() + "/pom.xml" - keycloakPomXmlTreeRoot = getXmlRoot(mainKeycloakPomPath) - pomProfileIdElem = getElementsByXPath(keycloakPomXmlTreeRoot, '/pom:project/pom:profiles/pom:profile/pom:id[text()="%s"]' % profile) - _logErrorAndExitIf( - "Can't locate the '%s' profile in main Keycloak pom.xml file!" % profile, - len(pomProfileIdElem) != 1 - ) - - pomProfileElem = pomProfileIdElem[0].getparent() - pomProductNameElem = getElementsByXPath(pomProfileElem, './pom:properties/pom:product.name') - _logErrorAndExitIf( - "Can't determine product name from '%s' profile of main Keycloak pom.xml file!" % profile, - len(pomProductNameElem) != 1 - ) - productName = pomProductNameElem[0].text - pomProductNameFullElem = getElementsByXPath(pomProfileElem, './pom:properties/pom:product.name') - _logErrorAndExitIf( - "Can't determine the full product name from '%s' profile of main Keycloak pom.xml file!" % profile, - len(pomProductNameFullElem) != 1 - ) - productNameFull = pomProductNameFullElem[0].text - - return (productName, productNameFull) - -def getNumericArtifactVersion(gavDictionary, gavDictionaryKey): - """ - Extract the numeric version of the 'gavDictionaryKey' GA artifact - from 'gavDictionary'. - - 1) Return dictionary value of 'gavDictionaryKey' directly - if it's type is not a dictionary again. - - 2) If the 'gavDictionaryKey' value is a child dictionary - containing exactly one key, namely the name of the POM - to which the numeric version corresponds - to, return the numeric artifact version from the - subdictionary value. - """ - gavDictionaryValue = gavDictionary[gavDictionaryKey] - if not isinstance(gavDictionaryValue, dict): - # First check if obtained artifact version is really numeric - _logErrorAndExitIf( - "Extracted '%s' artifact version isn't numeric: '%s'!" % (gavDictionaryKey, gavDictionaryValue), - not re.match(r'\d.*', gavDictionaryValue) - ) - return gavDictionaryValue - - else: - subKey = gavDictionaryValue.keys() - # Python starting from 3.3.1 returns dict_keys instead of a list when - # calling dictionary items(). Convert dict_keys back to list if needed - if not isinstance(subKey, list): - subKey = list(subKey) - # Sanity check if there's just one candidate numeric version for - # the artifact. This shouldn't ever happen, but better to check - _logErrorAndExitIf( - "Artifact '%s' can't have more than just one versions!" % gavDictionaryKey, - len(subKey) != 1 - ) - # Fetch the numeric artifact version from the subdictionary value - gavDictionaryValue = gavDictionary[gavDictionaryKey][subKey[0]] - # Finally check if obtained artifact version is really numeric - _logErrorAndExitIf( - "Extracted '%s' artifact version isn't numeric: '%s'!" % (gavDictionaryKey, gavDictionaryValue), - not re.match(r'\d.*', gavDictionaryValue) - ) - return gavDictionaryValue - -def loadGavDictionaryFromGavFile(gavFile): - """ - Load the content of 'gavFile' into Maven GAV Python dictionary, where - dictionary key is reppresented by 'groupId:artifactId' part of the GAV - entry, and value is represented by the 'version' field of the GAV entry. - """ - gavDictionary = {} - with open(gavFile) as inputFile: - for line in inputFile: - try: - groupId, artifactId, version = line.rstrip().split(_gav_delimiter, 3) - gavDictionaryKey = groupId + _gav_delimiter + artifactId - gavDictionaryValue = version - # Exit with error if obtained artifact version doesn't start - # with a number - _logErrorAndExitIf( - "Extracted '%s' artifact version isn't numeric: '%s'!" % (gavDictionaryKey, gavDictionaryValue), - not re.match(r'\d.*', gavDictionaryValue) - ) - gavDictionary[gavDictionaryKey] = gavDictionaryValue - except ValueError: - # Ignore malformed GAV entries containing more than three - # fields separated by the ':' character - continue - - return gavDictionary - -def loadGavDictionaryFromXmlFile(xmlFile, xPathPrefix = '/pom:project/pom:dependencyManagement/pom:dependencies/pom:dependency/pom:', nameSpace = { "pom" : "%s" % _pom_ns }): - """ - Convert XML dependencies from 'xmlFile' into Maven GAV - (groupId:artifactId:version) Python dictionary, where - dictionary key is represented by 'groupId:artifactId' - part of the GAV entry, and value is: - - * Either 'version' field of the GAV entry directly, - if the version is numeric, - - * Or another child dictionary in the case the 'version' field - of the GAV entry represents a property within the - XML file. In this case, the key of the child dictionary - item is the name of such a XML element. - The value of the child dictionary item is the - value of the itself. - - Returns GAV dictionary corresponding to 'xmlFile' - or exits with error in case of a failure - """ - xmlRoot = getXmlRoot(xmlFile) - # Construct the final union xPath query returning all three - # (GAV) subelements of a particular dependency element - gavXPathQuery = '|'.join(map(lambda x: xPathPrefix + x, _gav_elements)) - xmlDependencyElements = getElementsByXPath(xmlRoot, gavXPathQuery, nameSpace) - _logErrorAndExitIf( - "Failed to load dependencies from XML file '%s'!" % xmlFile, - len(xmlDependencyElements) == 0 - ) - gavDictionary = {} - # Divide original list into sublists by three elements -- one sublist per GAV entry - for gavEntry in [xmlDependencyElements[i:i + 3] for i in range(0, len(xmlDependencyElements), 3)]: - (groupIdElem, artifactIdElem, versionElem) = (gavEntry[0], gavEntry[1], gavEntry[2]) - _logErrorAndExitIf( - "Failed to load '%s' dependency from XML file!" % gavEntry, - groupIdElem is None or artifactIdElem is None or versionElem is None - ) - gavDictKey = groupIdElem.text + _gav_delimiter + artifactIdElem.text - gavDictValue = versionElem.text - if re.match(r'\d.*', gavDictValue): - # Store the numeric artifact version into GAV dictionary - gavDictionary[gavDictKey] = gavDictValue - else: - childDictKey = gavDictValue - while not re.match(r'\d.*', gavDictValue): - gavDictValue = re.sub(r'^\${', '', gavDictValue) - gavDictValue = re.sub(r'}$', '', gavDictValue) - propertyElem = getPomProperty(xmlRoot, gavDictValue) - # Handle corner case when artifact version isn't value of some POM element, - # but rather value of some xPath within the XML file. Like for example the case of - # 'project.version' value. Create a custom XPath query to fetch the actual numeric value - if not propertyElem: - # Build xpath from version value, turn e.g. 'project.version' to '/pom:project/pom:version' - customXPath = _empty_string.join(list(map(lambda x: '/pom:' + x, gavDictValue.split('.')))) - # Fetch the numeric version - propertyElem = getElementsByXPath(xmlRoot, customXPath) - # Exit with error if it wasn't possible to determine the artifact version even this way - _logErrorAndExitIf( - "Unable to determine the version of the '%s' GA artifact, exiting!" % gavDictKey, - len(propertyElem) != 1 - ) - # Assign the value of POM or result of custom XPath - # back to 'gavDictValue' field and check again - gavDictValue = propertyElem[0].text - - # Store the numeric artifact version into GAV dictionary, keeping - # the original POM name as the key of the child dictionary - gavDictionary[gavDictKey] = { '%s' % childDictKey : '%s' % gavDictValue } - - return gavDictionary - -def mergeTwoGavDictionaries(firstGavDictionary, secondGavDictionary): - """ - Return a single output GAV dictionary containing the united content of - 'firstGavDictionary' and 'secondGavDictionary' input GAV dictionaries. - - The process of merge is performed as follows: - - 1) Distinct keys from both GAV dictionaries are copied into the output - dictionary. - - 2) If the key is present in both input GAV dictionaries (IOW it's shared), - the value of the higher version from both input dictionaries is used - as the final value for the united dictionary entry. - """ - unitedGavDictionary = copy.deepcopy(firstGavDictionary) - for secondDictKey in secondGavDictionary.keys(): - try: - # Subcase when dictionary key from second GAV dictionary is - # already present in the resulting GAV dictionary - - # Value of the key from resulting GAV dictionary might be a child - # dictionary again. Get the numeric version of the artifact first - currentValue = getNumericArtifactVersion(unitedGavDictionary, secondDictKey) - # Vaue of the key from second GAV dictionary might be a child - # dictionary again. Get the numeric version of the artifact first - secondDictValue = getNumericArtifactVersion(secondGavDictionary, secondDictKey) - - # Update the artifact version in resulting GAV dictionary only if - # the value from the second dictionary is higher than the current - # one - if compareMavenVersions(secondDictValue, currentValue) > 0: - unitedGavDictionary[secondDictKey] = secondDictValue - - except KeyError: - # Subcase when dictionary key from the second GAV dictionary is - # not present in the resulting GAV dictionary. Insert it - unitedGavDictionary[secondDictKey] = secondGavDictionary[secondDictKey] - - return unitedGavDictionary - -# -# Data structures and routines to assist with the updates of -# the main Keycloak pom.xml necessary for Wildfly upgrade -# - -# List of artifacts from main Keycloak pom.xml excluded from upgrade even though they would -# be usually applicable for the update. This allows to handle special / corner case like for -# example the ones below: -# -# * The version / release tag of specific artifact, as used by upstream of that artifact is -# actually higher than the version, currently used in Wildfly / Wildfly Core. But the Python -# version comparing algorithm used by this script, treats it as a lower one -# (the cache of ApacheDS artifact below), -# * Explicitly avoid the update of certain artifact due whatever reason -# -# Add new entries to this list by moving them out of the _keycloakToWildflyProperties -# dictionary as necessary -_excludedProperties = [ - # Intentionally avoid Apache DS downgrade from "2.0.0.AM26" to Wildfly's current - # "2.0.0-M24" version due to recent KEYCLOAK-14162 - "apacheds.version", - # KEYCLOAK-17585 Prevent microprofile-metrics-api upgrades from version "2.3" due to: - # https://issues.redhat.com/browse/KEYCLOAK-17585?focusedCommentId=16002705&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-16002705 - "microprofile-metrics-api.version" -] - -# List of Keycloak specific properties listed in main Keycloak pom.xml file. These entries: -# -# * Either don't represent an artifact version (e.g. "product.rhsso.version" below), -# * Or represent an artifact version, but aren't used listed in Wildfly's or -# Wildfly-Core's POMs (the artifact is either not referenced in those POM files at all -# or explicitly excluded in some of them) -_keycloakSpecificProperties = [ - "product.rhsso.version", - "product.build-time", - "eap.version", - "jboss.as.version", - "jboss.as.subsystem.test.version", - "jboss.aesh.version", - "jackson.databind.version", - "jackson.annotations.version", - "resteasy.undertow.version", - "owasp.html.sanitizer.version", - "sun.xml.ws.version", - "jetty94.version", - "ua-parser.version", - "version.com.openshift.openshift-restclient-java", - "apacheds.codec.version", - "google.zxing.version", - "freemarker.version", - "jetty9.version", - "liquibase.version", - "mysql.version", - "osgi.version", - "pax.web.version", - "postgresql.version", - "mariadb.version", - "mssql.version", - "twitter4j.version", - "jna.version", - "greenmail.version", - "jmeter.version", - "selenium.version", - "xml-apis.version", - "subethasmtp.version", - "replacer.plugin.version", - "jboss.as.plugin.version", - "jmeter.plugin.version", - "jmeter.analysis.plugin.version", - "minify.plugin.version", - "osgi.bundle.plugin.version", - "nexus.staging.plugin.version", - "frontend.plugin.version", - "docker.maven.plugin.version", - "surefire.memory.Xms", - "surefire.memory.Xmx", - "surefire.memory.metaspace", - "surefire.memory.metaspace.max", - "surefire.memory.settings", - "tomcat8.version", - "tomcat9.version", - "spring-boot24.version", - "spring-boot26.version", - "webauthn4j.version", - "org.apache.kerby.kerby-asn1.version", -] - -# Mapping of artifact name as used in the main Keycloak pom.xml file to the name -# of the same artifact listed in Wildfly's or Wildfly-Core's pom.xml file -_keycloakToWildflyProperties = { - "wildfly.version" : "version", - "wildfly.build-tools.version" : "version.org.wildfly.build-tools", - # Skip "eap.version" since Keycloak specific - "wildfly.core.version" : "version.org.wildfly.core", - # Skip "jboss.as.version" since Keycloak specific - # Skip "jboss.as.subsystem.test.version" since Keycloak specific - # Skip "jboss.aesh.version" since Keycloak specific - "aesh.version" : "version.org.aesh", - "apache.httpcomponents.version" : "version.org.apache.httpcomponents.httpclient", - "apache.httpcomponents.httpcore.version" : "version.org.apache.httpcomponents.httpcore", - "apache.mime4j.version" : "version.org.apache.james.apache-mime4j", - "jboss.dmr.version" : "version.org.jboss.jboss-dmr", - "bouncycastle.version" : "version.org.bouncycastle", - "cxf.version" : "version.org.apache.cxf", - "cxf.jetty.version" : "version.org.apache.cxf", - "cxf.jaxrs.version" : "version.org.apache.cxf", - "cxf.undertow.version" : "version.org.apache.cxf", - "dom4j.version" : "version.dom4j", - "h2.version" : "version.com.h2database", - "jakarta.persistence.version" : "version.jakarta.persistence", - "hibernate.core.version" : "version.org.hibernate", - "hibernate.c3p0.version" : "version.org.hibernate", - "infinispan.version" : "version.org.infinispan", - "jackson.version" : "version.com.fasterxml.jackson", - # Skip "jackson.databind.version" and "jackson.annotations.version" since they are derived from ${jackson.version}" above - "jakarta.mail.version" : "version.jakarta.mail", - "jboss.marshalling.version" : "version.org.jboss.marshalling.jboss-marshalling", - "jboss.logging.version" : "version.org.jboss.logging.jboss-logging", - "jboss.logging.tools.version" : "version.org.jboss.logging.jboss-logging-tools", - "jboss-jaxrs-api_2.1_spec" : "version.org.jboss.spec.javax.ws.jboss-jaxrs-api_2.1_spec", - "jboss-transaction-api_1.3_spec" : "version.org.jboss.spec.javax.transaction.jboss-transaction-api_1.3_spec", - "jboss.spec.javax.xml.bind.jboss-jaxb-api_2.3_spec.version" : "version.org.jboss.spec.javax.xml.bind.jboss-jaxb-api_2.3_spec", - "jboss.spec.javax.servlet.jsp.jboss-jsp-api_2.3_spec.version" : "version.org.jboss.spec.javax.servlet.jsp.jboss-jsp-api_2.3_spec", - "log4j.version" : "version.log4j", - "resteasy.version" : "version.org.jboss.resteasy", - # Skip "resteasy.undertow.version" since it's derived from ${resteasy.version} above - # Skip "owasp.html.sanitizer.version" since Keycloak specific - "slf4j-api.version" : "version.org.slf4j", - "slf4j.version" : "version.org.slf4j", - "sun.istack.version" : "version.com.sun.istack", - "sun.xml.bind.version" : "version.sun.jaxb", - "javax.xml.bind.jaxb.version" : "version.javax.xml.bind.jaxb-api", - # Skip "sun.xml.ws.version" since Keycloak specific - "sun.activation.version" : "version.com.sun.activation.jakarta.activation", - "sun.xml.bind.version" : "version.sun.jaxb", - "org.glassfish.jaxb.xsom.version" : "version.sun.jaxb", - "undertow.version" : "version.io.undertow", - "elytron.version" : "version.org.wildfly.security.elytron", - "elytron.undertow-server.version" : "version.org.wildfly.security.elytron-web", - "woodstox.version" : "version.org.codehaus.woodstox.woodstox-core", - "xmlsec.version" : "version.org.apache.santuario", - "glassfish.json.version" : "version.org.glassfish.jakarta.json", - "wildfly.common.version" : "version.org.wildfly.common", - # Skip "ua-parser.version" since Keycloak specific - "picketbox.version" : "version.org.picketbox", - "google.guava.version" : "version.com.google.guava", - # Skip "version.com.openshift.openshift-restclient-java" since Keycloak specific - "commons-lang.version" : "version.commons-lang", - "commons-lang3.version" : "version.commons-lang3", - "commons-io.version" : "version.commons-io", - "apacheds.version" : "version.org.apache.ds", - # Skip "apacheds.codec.version" since Keycloak specific - # Skip "google.zxing.version" since Keycloak specific - # Skip "freemarker.version" since Keycloak specific - # Skip "jetty9.version" since Keycloak specific - # Skip "liquibase.version" since Keycloak specific - # Skip "mysql.version" since Keycloak specific - # Skip "osgi.version" since Keycloak specific - # Skip "pax.web.version" since Keycloak specific - # Skip "postgresql.version" since Keycloak specific - # Skip "mariadb.version" since Keycloak specific - # Skip "mssql.version" since Keycloak specific - "servlet.api.30.version" : "version.org.jboss.spec.javax.xml.soap.jboss-saaj-api_1.4_spec", - "servlet.api.40.version" : "version.org.jboss.spec.javax.servlet.jboss-servlet-api_4.0_spec", - # Skip "twitter4j.version" since Keycloak specific - # Skip "jna.version" since Keycloak specific - # Skip "greenmail.version" since Keycloak specific - "hamcrest.version" : "version.org.hamcrest", - # Skip "jmeter.version" since Keycloak specific - "junit.version" : "version.junit", - "picketlink.version" : "version.org.picketlink", - # Skip "selenium.version" since Keycloak specific - # Skip "xml-apis.version" since intentionally excluded in Wildfly - # Skip "subethasmtp.version" since Keycloak specific - "microprofile-metrics-api.version" : "version.org.eclipse.microprofile.metrics.api", - # Skip "replacer.plugin.version" since Keycloak specific - # Skip "jboss.as.plugin.version" since Keycloak specific - # Skip "jmeter.plugin.version" since Keycloak specific - # Skip "jmeter.analysis.plugin.version" since Keycloak specific - # Skip "minify.plugin.version" since Keycloak specific - # Skip "osgi.bundle.plugin.version" since Keycloak specific - "wildfly.plugin.version" : "version.org.wildfly.plugin", - # Skip "nexus.staging.plugin.version" since Keycloak specific - # Skip "frontend.plugin.version" since Keycloak specific - # Skip "docker.maven.plugin.version" since Keycloak specific - # Skip "tomcat8.version", and "tomcat9.version" since Keycloak specific - # Skip "spring-boot24.version" and "spring-boot26.version" since Keycloak specific - # Skip "webauthn4j.version" since Keycloak specific - # Skip "org.apache.kerby.kerby-asn1.version" since Keycloak specific -} - -def _scanMainKeycloakPomFileForUnknownArtifacts(): - """ - Verify each artifact listed as property in the main Keycloak pom.xml file is present one of the: - - * _excludedProperties list -- explicitly requesting the update to be skipped due some reason, - * _keycloakSpecificProperties list -- artifact is Keycloak specific, - * _keycloakToWildflyProperties dictionary -- there's a clear mapping of Keycloak - artifact property name to corresponding artifact property name as used in Wildfly / - Wildfly Core - - Logs error message and exits with error if action for a particular artifact is unknown. - """ - # Absolute path to main Keycloak pom.xml within the repo - mainKeycloakPomPath = getKeycloakGitRepositoryRoot() + "/pom.xml" - - unknownArtifactMessage = ( - "Found so far unknown '%s' artifact in the main Keycloak pom.xml file!\n" - "There's no clearly defined action on how to process this artifact yet!\n" - "It's not an excluded one, not listed as Keycloak specific one, and not\n" - "present in the set of those to be processed. Add it to one of:\n\n" - " * _excludedProperties,\n" - " * _keycloakSpecificProperties,\n" - " * or _keycloakToWildflyProperties \n\n" - "data structures in \"wildfly/upgrade/__init__.py\" to dismiss this error!\n" - "Rerun the script once done." - ) - for xmlTag in getElementsByXPath(getXmlRoot(mainKeycloakPomPath), '//pom:project/pom:properties/pom:*'): - artifactName = xmlTag.tag.replace("{%s}" % _pom_ns, "") - _logErrorAndExitIf ( - unknownArtifactMessage % artifactName, - artifactName not in itertools.chain(_excludedProperties, _keycloakSpecificProperties, _keycloakToWildflyProperties.keys()) - ) - - -def performMainKeycloakPomFileUpdateTask(wildflyPomFile, wildflyCorePomFile, forceUpdates = False): - """ - Synchronize the versions of artifacts listed as properties in the main - Keycloak pom.xml file with their counterparts taken from 'wildflyPomFile' - or 'wildflyCorePomFile'. - """ - wildflyXmlTreeRoot = getXmlRoot(wildflyPomFile) - wildflyCoreXmlTreeRoot = getXmlRoot(wildflyCorePomFile) - - # Absolute path to main Keycloak pom.xml within the repo - mainKeycloakPomPath = getKeycloakGitRepositoryRoot() + "/pom.xml" - keycloakXmlTreeRoot = getXmlRoot(mainKeycloakPomPath) - - taskLogger = getTaskLogger('Update main Keycloak pom.xml') - taskLogger.info('Synchronizing Wildfly (Core) artifact versions to the main Keycloak pom.xml file...') - - stepLogger = getStepLogger() - - _scanMainKeycloakPomFileForUnknownArtifacts() - - for keycloakElemName, wildflyElemName in _keycloakToWildflyProperties.items(): - - if keycloakElemName == "wildfly.version": - wildflyElem = getElementsByXPath(wildflyXmlTreeRoot, '/pom:project/pom:version') - else: - # Try to fetch updated artifact version from Wildfly Core's pom.xml first - wildflyElem = getPomProperty(wildflyCoreXmlTreeRoot, wildflyElemName) - # If not found, fetch it from Wildfly's pom.xml file - if not wildflyElem: - wildflyElem = getPomProperty(wildflyXmlTreeRoot, wildflyElemName) - - if wildflyElem: - keycloakElem = getPomProperty(keycloakXmlTreeRoot, keycloakElemName) - if keycloakElem: - if keycloakElemName in _excludedProperties: - stepLogger.debug( - "Not updating version of '%s' from '%s' to '%s' since the artifact is excluded!" % - (keycloakElemName, keycloakElem[0].text, wildflyElem[0].text) - ) - elif ( - forceUpdates or - compareMavenVersions(wildflyElem[0].text, keycloakElem[0].text) > 0 - ): - stepLogger.debug( - "Updating version of '%s' artifact to '%s'. Current '%s' version is less than that." % - (keycloakElemName, wildflyElem[0].text, keycloakElem[0].text) - ) - keycloakElem[0].text = wildflyElem[0].text - else: - stepLogger.debug( - "Not updating version of '%s' artifact to '%s'. Current '%s' version is already up2date." % - (keycloakElemName, wildflyElem[0].text, keycloakElem[0].text) - ) - else: - stepLogger.error( - "Unable to locate element with name: '%s' in '%s' or '%s'" % - (wildflyElemName, wildflyPomFile, wildflyCorePomFile) - ) - sys.exit(1) - - lxml.etree.ElementTree(keycloakXmlTreeRoot).write(mainKeycloakPomPath, encoding = "UTF-8", pretty_print = True, xml_declaration = True) - stepLogger.info("Done syncing artifact version changes to: '%s'!" % mainKeycloakPomPath.replace(getKeycloakGitRepositoryRoot(), '.')) - stepLogger.debug("Wrote updated main Keycloak pom.xml file to: '%s'" % mainKeycloakPomPath) - - -def performAdapterGalleonPackPomFileUpdateTask(wildflyCorePomFile, forceUpdates = False): - """ - Synchronize Keycloak's version of 'version.org.wildfly.galleon-plugins' artifact in the adapter Galleon pack - with its corresponding version from Wildfly Core - """ - wildflyGalleonMavenPluginProperty = "version.org.wildfly.galleon-plugins" - - wildflyCoreXmlTreeRoot = getXmlRoot(wildflyCorePomFile) - wildflyGalleonMavenPluginWildflyCoreElem = getPomProperty(wildflyCoreXmlTreeRoot, wildflyGalleonMavenPluginProperty) - wildflyGalleonMavenPluginWildflyCoreVersion = wildflyGalleonMavenPluginWildflyCoreElem[0].text - - # Absolute path to the pom.xml file of the adapter Galleon pack within the repo - adapterGalleonPackPomPath = getKeycloakGitRepositoryRoot() + "/distribution/galleon-feature-packs/adapter-galleon-pack/pom.xml" - adapterGalleonPackXmlTreeRoot = getXmlRoot(adapterGalleonPackPomPath) - wildflyGalleonMavenPluginAdapterGalleonPackElem = getPomProperty(adapterGalleonPackXmlTreeRoot, wildflyGalleonMavenPluginProperty) - wildflyGalleonMavenPluginKeycloakVersion = wildflyGalleonMavenPluginAdapterGalleonPackElem[0].text - - taskLogger = getTaskLogger('Update pom.xml of adapter Galleon pack') - taskLogger.info('Synchronizing Wildfly Core artifact versions to the pom.xml file of Keycloak adapter Galleon pack...') - stepLogger = getStepLogger() - if ( - forceUpdates or - compareMavenVersions(wildflyGalleonMavenPluginWildflyCoreVersion, wildflyGalleonMavenPluginKeycloakVersion) > 0 - ): - stepLogger.debug( - "Updating version of '%s' artifact to '%s'. Current '%s' version is less than that." % - (wildflyGalleonMavenPluginProperty, wildflyGalleonMavenPluginWildflyCoreVersion, wildflyGalleonMavenPluginKeycloakVersion) - ) - wildflyGalleonMavenPluginAdapterGalleonPackElem[0].text = wildflyGalleonMavenPluginWildflyCoreElem[0].text - lxml.etree.ElementTree(adapterGalleonPackXmlTreeRoot).write(adapterGalleonPackPomPath, encoding = "UTF-8", pretty_print = True, xml_declaration = True) - stepLogger.info("Done syncing artifact version changes to: '%s'!" % adapterGalleonPackPomPath.replace(getKeycloakGitRepositoryRoot(), '.')) - stepLogger.debug("Wrote updated pom.xml file to: '%s'" % adapterGalleonPackPomPath) - else: - stepLogger.debug( - "Not updating version of '%s' artifact to '%s'. Current '%s' version is already up2date." % - (wildflyGalleonMavenPluginProperty, wildflyGalleonMavenPluginWildflyCoreVersion, wildflyGalleonMavenPluginKeycloakVersion) - ) - - -# -# Routing handling necessary updates of various -# adapter license files related with a Wildfly upgrade -# - -def updateAdapterLicenseFile(gavDictionary, xPathPrefix, nameSpace, licenseFile, forceLicenseFileUpdates = False): - """ - Save GAV dictionary 'gavDictionary' back to XML 'licenseFile'. - """ - licenseFileXmlTreeRoot = getXmlRoot(licenseFile) - LICENSE_FILE_PARENT_DIR = os.path.dirname(licenseFile) - stepLogger = getStepLogger() - - if not nameSpace: - nsPrefix = '' - dependencyElemXPath = '|'.join(map(lambda e: xPathPrefix + '/%s' % e, _gav_elements)) - else: - nsPrefix = nameSpace.keys() - dependencyElemXPath = '|'.join(map(lambda e: xPathPrefix + '/%s:%s' % (nsPrefix, e), _gav_elements)) - - xmlDependencyElements = getElementsByXPath(licenseFileXmlTreeRoot, dependencyElemXPath, nameSpace) - # Divide original list into sublists by three elements -- one sublist per GAV entry - for gavEntry in [xmlDependencyElements[i:i + 3] for i in range(0, len(xmlDependencyElements), 3)]: - currentArtifactVersion = expectedArtifactVersion = None - groupIdElem, artifactIdElem, versionElem = gavEntry[0], gavEntry[1], gavEntry[2] - _logErrorAndExitIf( - "Failed to update '%s' XML dependency!" % gavEntry, - groupIdElem is None or artifactIdElem is None or versionElem is None, - logger = stepLogger - ) - # KEYCLOAK-16202 Per: - # - # * https://github.com/keycloak/keycloak/pull/7463#discussion_r517346730 and - # * https://github.com/keycloak/keycloak/pull/7463#discussion_r517346766 - # - # skip automated updates of versions of "org.apache.httpcomponents:httpclient" - # and "org.apache.httpcomponents:httpcore" dependencies in the Fuse adapter - # license file(s) as part of the upgrade script run - if ( - 'fuse-adapter-zip' in licenseFile and - groupIdElem.text == 'org.apache.httpcomponents' and - artifactIdElem.text in ['httpclient', 'httpcore'] - ): - - httpComponentsFuseAdapterSpecificMessage = ( - "Not updating version of '%s:%s' artifact in the Fuse adapter license file," % - (groupIdElem.text, artifactIdElem.text), - " since this adapter can work properly only with a specific,\n\t\tpreviously approved version!" - " See '' and ''", - " properties in the main Keycloak pom.xml file\n\t\tfor further details." - ) - stepLogger.info(_empty_string.join(httpComponentsFuseAdapterSpecificMessage)) - continue - - currentArtifactVersion = versionElem.text - gavDictKey = groupIdElem.text + _gav_delimiter + artifactIdElem.text - try: - # Value of the artifact version might be a child dictionary again. - # Get numeric artifact version first - expectedArtifactVersion = getNumericArtifactVersion(gavDictionary, gavDictKey) - - # Update the version of artifact if version from GAV dictionary is higher - if ( - expectedArtifactVersion != currentArtifactVersion and - forceLicenseFileUpdates or - compareMavenVersions(expectedArtifactVersion, versionElem.text) > 0 - ): - - updatingArtifactVersionMessage = ( - "Updating the version of '%s, %s' artifact in the '%s' license file from: '%s' to: '%s'" % - (groupIdElem.text, artifactIdElem.text, licenseFile, currentArtifactVersion, expectedArtifactVersion) - ) - stepLogger.debug(updatingArtifactVersionMessage) - versionElem.text = expectedArtifactVersion - # Subtask: Rename existing license text files tracked in this repository to the filename with the updated artifact version - repositoryRoot = getKeycloakGitRepositoryRoot() - for root, dirs, files in os.walk(LICENSE_FILE_PARENT_DIR): - for filename in files: - if re.search(re.escape(artifactIdElem.text) + r',' + re.escape(currentArtifactVersion), filename): - currentFilename = filename - currentFileName = currentFilename.replace(repositoryRoot, '').rstrip() - newFilename = currentFilename.replace(currentArtifactVersion, expectedArtifactVersion) - # Delete & recreate the TXT file if it previously existed (be idempotent) - if os.path.isfile(os.path.join(root, newFilename)): - os.remove(os.path.join(root, newFilename)) - check_call(['git', 'mv', "%s" % os.path.join(root, currentFilename), "%s" % os.path.join(root, newFilename)], cwd = repositoryRoot) - # Subtask: Update artifact version in license URL to the expected one - dependencyElem = groupIdElem.getparent() - urlElements = getElementsByXPath(dependencyElem, './licenses/license/url', nameSpace) - _logErrorAndExitIf( - "Failed to retrieve element of the '%s' artifact!" % gavDictKey, - len(urlElements) != 1, - logger = stepLogger - ) - urlElem = urlElements[0] - # Strip the '.redhat-\d+' suffix from artifact versions when processing RH-SSO adapters - # since upstream URLs don't contain those - if 'rh-sso' in licenseFile: - expectedArtifactVersion = re.sub(r'.redhat-\d+$', '', expectedArtifactVersion) - # First handle special form of version numbers in release URLs used by org.bouncycastle artifacts - if artifactIdElem.text.endswith('jdk15on'): - bouncyCastleMajorVersion = re.match(r'^(\d)\.', expectedArtifactVersion).group(1) - bouncyCastleMinorVersion = re.match(r'^\d+\.(\d+)', expectedArtifactVersion).group(1) - if bouncyCastleMajorVersion and bouncyCastleMinorVersion: - urlNotationOfExpectedBouncyCastleVersion = 'r' + bouncyCastleMajorVersion + 'rv' + bouncyCastleMinorVersion - try: - # Extract older (even archaic) 'major.minor.micro' artifact version substring from the URL - oldMajorMinorMicroVersion = re.search(r'(r\d+rv\d{2,})', urlElem.text).group(1) - if oldMajorMinorMicroVersion: - stepLogger.debug( - "Replacing former '%s' of '%s' artifact version in the URL with the new '%s' version" % - (oldMajorMinorMicroVersion, gavDictKey, expectedArtifactVersion) - ) - urlElem.text = re.sub(r'r\d+rv\d{2,}', urlNotationOfExpectedBouncyCastleVersion, urlElem.text) - except AttributeError: - # Ignore generic URLs not containing 'major.minor.micro' information of this specific artifact - pass - else: - _logErrorAndExitIf( - "Unable to locate previous '%s' artifact version in the URL!" % gavDictKey, - True, - logger = stepLogger - ) - else: - try: - # Extract older (even archaic) 'major.minor.micro' artifact version substring from the URL - oldMajorMinorMicroVersion = re.search(r'(\d+\.\d+\.\d+)', urlElem.text).group(1) - if oldMajorMinorMicroVersion: - stepLogger.debug( - "Replacing former '%s' version of the '%s' artifact in the URL with the new '%s' version" % - (oldMajorMinorMicroVersion, gavDictKey, expectedArtifactVersion) - ) - urlElem.text = re.sub(oldMajorMinorMicroVersion, expectedArtifactVersion, urlElem.text) - else: - _logErrorAndExitIf( - "Unable to locate previous '%s' artifact version in the URL!" % gavDictKey, - True, - logger = stepLogger - ) - except AttributeError: - # Ignore generic URLs not containing 'major.minor.micro' information of this specific artifact - pass - else: - artifactVersionAlreadyHigherMessage = ( - "Not updating version of '%s, %s' artifact to '%s'. Current '%s' version is already up2date." % - (groupIdElem.text, artifactIdElem.text, expectedArtifactVersion, currentArtifactVersion) - ) - stepLogger.debug(artifactVersionAlreadyHigherMessage) - - except KeyError: - # Cover the case when particular Keycloak / RH-SSO dependency isn't present in the GAV - # file created from the list of all Maven artifacts used by Wildfly (Core) / JBoss EAP - if 'keycloak' in licenseFile: - productName = 'Keycloak' - parentProductName = 'Wildfly (Core)' - elif 'rh-sso' in licenseFile: - productName = 'RH-SSO' - parentProductName = 'JBoss EAP' - else: - productName = parentProductName = None - _logErrorAndExitIf( - "Failed to determine the product name while updating the '%s' license file!" % licenseFile, - productName is None, - logger = stepLogger - ) - # Ignore artifacts not found in the Gav dictionary - stepLogger.debug( - "Skipping '%s' specific '%s' license dependency since not present in '%s' list of all Maven artifacts!" % - (productName, gavDictKey, parentProductName) - ) - pass - - lxml.etree.ElementTree(licenseFileXmlTreeRoot).write(licenseFile, encoding = "UTF-8", pretty_print = True, xml_declaration = True) - relativeLicenseFilePath = licenseFile.replace(getKeycloakGitRepositoryRoot(), '.') - stepLogger.info("Done syncing artifact version changes to: '%s'!" % relativeLicenseFilePath) - stepLogger.debug("Wrote updated license file to: '%s'" % licenseFile) - -# -# Routines performing particular tasks within a Wildfly upgrade -# - -def performKeycloakAdapterLicenseFilesUpdateTask(wildflyPomFile, wildflyCorePomFile, forceUpdates = False): - """ - Update artifacts versions of selected dependencies utilized by various - Keycloak adapter license XML files. Also update the location of the - corresponding license text files within the repository so their names - reflect the updated artifacts versions. - """ - # Operate on Keycloak adapters - PROFILE = 'community' - - # Load XML dependencies from Wildfly (Core) POM files into GAV dictionary - wildflyCoreXmlDependenciesGav = loadGavDictionaryFromXmlFile(wildflyCorePomFile) - wildflyXmlDependenciesGav = loadGavDictionaryFromXmlFile(wildflyPomFile) - # Merge both Wildfly and Wildfly Core GAV dictionaries into a united one, - # containing all Wildfly (Core) artifacts and their versions - unitedGavDictionary = mergeTwoGavDictionaries( - wildflyCoreXmlDependenciesGav, - wildflyXmlDependenciesGav - ) - - isTaskLogged = False - (productName, productNameFull) = getProductNamesForKeycloakPomProfile(profile = PROFILE) - taskLogger = getTaskLogger('Update %s Adapters' % productNameFull) - gitRepositoryRoot = getKeycloakGitRepositoryRoot() - for root, dirs, files in os.walk(gitRepositoryRoot): - if not isTaskLogged: - taskLabel = ( - "Updating artifacts versions in license XML files and locations of the license TXT files" + - "\n\tfor the %s adapters in the '%s' directory..." % (productName, root) - ) - taskLogger.info(taskLabel) - isTaskLogged = True - for filename in files: - if re.search(r'distribution.*/src/main/resources/licenses/%s/licenses.xml' % productName.lower(), os.path.join(root, filename)): - updateAdapterLicenseFile( - unitedGavDictionary, - xPathPrefix = '/licenseSummary/dependencies/dependency', - nameSpace = {}, - licenseFile = os.path.join(root, filename), - forceLicenseFileUpdates = forceUpdates - ) - -def performRhssoAdapterLicenseFilesUpdateTask(wildflyPomFile, wildflyCorePomFile, forceUpdates = False): - """ - Update artifacts versions of selected dependencies utilized by various - RH-SSO adapter license XML files. Also update the location of the - corresponding license text files within the repository so their names - reflect the updated artifacts versions. - """ - # Operate on RH-SSO adapters - PROFILE = 'product' - - isTaskLogged = False - (productName, productNameFull) = getProductNamesForKeycloakPomProfile(profile = PROFILE) - taskLogger = getTaskLogger('Update %s Adapters' % productNameFull) - - gavFileUrl = None - print("\nPlease specify the URL of the GAV file to use for %s adapter updates:" % productNameFull.upper()) - gavFileUrl = sys.stdin.readline().rstrip() - - _logErrorAndExitIf( - "Invalid URL '%s'! Please provide valid URL to the GAV file and retry!" % gavFileUrl, - not gavFileUrl or not gavFileUrl.startswith('http://') and not gavFileUrl.startswith('https://') - ) - gavFile = saveUrlToNamedTemporaryFile(gavFileUrl) - taskLogger.debug("Downloaded content of provided GAV file to '%s'" % gavFile) - gavDictionary = loadGavDictionaryFromGavFile(gavFile) - - gitRepositoryRoot = getKeycloakGitRepositoryRoot() - for root, dirs, files in os.walk(gitRepositoryRoot): - if not isTaskLogged: - taskLabel = ( - "Updating artifacts versions in license XML files and locations of the license TXT files" + - "\n\tfor the %s adapters in the '%s' directory..." % (productName.upper(), root) - ) - taskLogger.info(taskLabel) - isTaskLogged = True - for filename in files: - if re.search(r'distribution.*/src/main/resources/licenses/%s/licenses.xml' % productName.lower(), os.path.join(root, filename)): - updateAdapterLicenseFile( - gavDictionary, - xPathPrefix = '/licenseSummary/dependencies/dependency', - nameSpace = {}, - licenseFile = os.path.join(root, filename), - forceLicenseFileUpdates = forceUpdates - ) - -def performDeprecatedWildflyTestingModuleUpdateTask(forceUpdates = False): - """ - Update the properties of the deprecated Wildfly testing module present in - the Arquillian testsuite if necessary. The properties are needed to be - updated if and only if the Wildfly and Wildfly Core versions in the main - Keycloak pom.xml file from the local Keycloak git clone are higher than - Widfly and Wildfly Core versions in the main Keycloak pom.xml file of the - master branch of official Keycloak GitHub repository (IOW if and only the - main Keycloak pom.xml file in the local repository got already updated with - new Wildfly and Wildfly Core artifact versions from the new tag) - """ - # Prepare / hold the expected future values of the properties of the - # deprecated Wildfly testing module present in Arquillian testsuite - deprecatedWildflyModuleProperties = {} - - deprecatedWildflyModuleProperties['wildfly.deprecated.version'] = getPomPropertyFromRemoteXml( - _keycloak_github_master_main_pom_base_url, - 'wildfly.version', - errorMessage = "Unable to locate 'wildfly.version' property element in the remote XML file!", - expectedElementsCount = 1 - )[0].text - - deprecatedWildflyModuleProperties['wildfly.deprecated.wildfly.core.version'] = getPomPropertyFromRemoteXml( - _keycloak_github_master_main_pom_base_url, - 'wildfly.core.version', - errorMessage = "Unable to locate 'wildfly.core.version' property element in the remote XML file!", - expectedElementsCount = 1 - )[0].text - - deprecatedWildflyModuleProperties['wildfly.deprecated.arquillian.wildfly.container'] = getPomPropertyFromRemoteXml( - _wildfly_github_tag_main_pom_base_url % deprecatedWildflyModuleProperties['wildfly.deprecated.version'], - 'version.org.wildfly.arquillian', - errorMessage = "Unable to locate 'version.org.wildfly.arquillian' property element in the remote XML file!", - expectedElementsCount = 1 - )[0].text - - taskLogger = getTaskLogger('Update Deprecated Wildfly Testing Module') - taskLogger.info('Updating properties of the deprecated Wildfly testing module...') - stepLogger = getStepLogger() - - # Absolute path to main Keycloak pom.xml within the local repo - mainKeycloakPomPath = getKeycloakGitRepositoryRoot() + "/pom.xml" - mainKeycloakPomXmlRoot = getXmlRoot(mainKeycloakPomPath) - # Absolute path to pom.xml file of the Arquillian testsuite within the local repo - arqTestSuitePomPath = getKeycloakGitRepositoryRoot() + "/testsuite/integration-arquillian/pom.xml" - arqTestSuitePomXmlRoot = getXmlRoot(arqTestSuitePomPath) - - # Determine the current value of the 'wildfly.version' property element - # from the main pom.xml file of the local Keycloak git repository clone - currentLocalWildflyVersionElem = getPomProperty(mainKeycloakPomXmlRoot, 'wildfly.version') - _logErrorAndExitIf( - "Unable to determine the value of the 'wildfly.version' property element in the main Keycloak pom.xml file!", - len(currentLocalWildflyVersionElem) != 1, - logger = stepLogger - ) - currentLocalWildflyVersion = currentLocalWildflyVersionElem[0].text - # Determine the current value of the 'wildfly.core.version' property - # element from the main pom.xml file of the local Keycloak git repository - # clone - currentLocalWildflyCoreVersionElem = getPomProperty(mainKeycloakPomXmlRoot, 'wildfly.core.version') - _logErrorAndExitIf( - "Unable to determine the value of the 'wildfly.core.version' property element in the main Keycloak pom.xml file!", - len(currentLocalWildflyCoreVersionElem) != 1, - logger = stepLogger - ) - currentLocalWildflyCoreVersion = currentLocalWildflyCoreVersionElem[0].text - # Update the properties of the deprecated Wildfly testing module present - # in the Arquillian testsuite if the local Wildfly and Wildfly Core version - # is higher than their counterparts currently present in the master branch - # of the Keycloak GitHub repository (IOW only if main Keycloak's pom.xml - # got previously already updated with artifact versions from the new - # Wildfly tag) - if ( - forceUpdates or - compareMavenVersions(currentLocalWildflyVersion, deprecatedWildflyModuleProperties['wildfly.deprecated.version']) > 0 and - compareMavenVersions(currentLocalWildflyCoreVersion, deprecatedWildflyModuleProperties['wildfly.deprecated.wildfly.core.version']) > 0 - ): - - for deprecatedProperty in deprecatedWildflyModuleProperties.keys(): - arqTestSuitePropertyElem = getPomProperty(arqTestSuitePomXmlRoot, deprecatedProperty) - _logErrorAndExitIf( - "Unable to locate the '%s' element in the pom.xml file of the Arquillian testsuite!", - len(arqTestSuitePropertyElem) != 1, - logger = stepLogger - ) - stepLogger.debug( - "Updating value of the '%s' property of the deprecated Wildfly module to '%s'" % - (deprecatedProperty, deprecatedWildflyModuleProperties[deprecatedProperty]) - ) - arqTestSuitePropertyElem[0].text = deprecatedWildflyModuleProperties[deprecatedProperty] - else: - updateNotNecessaryMessage = ( - "Not updating the values of the properties of the deprecated Wildfly testing module!" - "\n\t\t Versions of Wildfly and Wildfly Core artifacts found in the main pom.xml file" - "\n\t\t of this repository are equal, or lower when compared to their respective versions" - "\n\t\t currently present in the 'master' branch of the upstream GitHub Keycloak repository." - "\n\t\t Update is not needed." - ) - stepLogger.debug(_empty_string.join(updateNotNecessaryMessage)) - - lxml.etree.ElementTree(arqTestSuitePomXmlRoot).write(arqTestSuitePomPath, encoding = "UTF-8", pretty_print = True, xml_declaration = True) - stepLogger.info('Done syncing necessary changes to the deprecated Wildfly testing module!') - -def performJbossParentVersionUpdateTask(wildflyTag, wildflyPomFile, wildflyCorePomFile, forceUpdates = False): - taskLogger = getTaskLogger('Update Version of jboss-parent') - taskLogger.info("Checking if the 'jboss-parent' version needs to be updated...") - stepLogger = getStepLogger() - - # Absolute path to main Keycloak pom.xml within the local repo - mainKeycloakPomPath = getKeycloakGitRepositoryRoot() + "/pom.xml" - mainKeycloakPomXmlRoot = getXmlRoot(mainKeycloakPomPath) - # Absolute path to the Keycloak's 'boms/pom.xml' location within the local repo - keycloakBomsPomPath = getKeycloakGitRepositoryRoot() + "/boms/pom.xml" - keycloakBomsPomXmlRoot = getXmlRoot(keycloakBomsPomPath) - - # Retrieve the current versions of the 'jboss-parent' from the: - jbossParentVersionElems = {} - # Main pom.xml file of the Wildfly repository - jbossParentVersionElems['from.main.wildfly.pom'] = getElementsByXPath(getXmlRoot(wildflyPomFile), '/pom:project/pom:parent/pom:version') - # Main pom.xml file of the Wildfly Core repository - jbossParentVersionElems['from.main.wildfly.core.pom'] = getElementsByXPath(getXmlRoot(wildflyCorePomFile), '/pom:project/pom:parent/pom:version') - # Main pom.xml file of the local Keycloak repository - jbossParentVersionElems['from.main.keycloak.pom'] = getElementsByXPath(mainKeycloakPomXmlRoot, '/pom:project/pom:parent/pom:version') - # The boms/pom.xml file of the local Keycloak repository - jbossParentVersionElems['from.keycloak.boms.pom'] = getElementsByXPath(keycloakBomsPomXmlRoot, '/pom:project/pom:parent/pom:version') - - # Sanity check if jboss-parent elements were retrieved correctly from all of the four files - # (in each case there should be exactly one 'jboss-parent' element present in the pom.xml) - for key, value in jbossParentVersionElems.items(): - location = ( - key - .replace('boms.pom', "'boms/pom'") - .replace('keycloak', 'Keycloak') - .replace('wildfly', 'Wildfly') - .replace('core', 'Core') - .replace('from', 'from the') - .replace('pom', 'pom.xml') - .replace('.', ' ') - ) - - _logErrorAndExitIf( - "Unable to determine the version of the 'jboss-parent' element %s file!" % location, - len(value) != 1, - logger = stepLogger - ) - # Turn list containing one XML element into just the XML element itself - jbossParentVersionElems[key] = value[0] - - # Synchronize the jboss-parent version in both the main Keycloak pom.xml file and in the 'boms/pom.xml' file - # (if their version differs from the current versions used by Wildfly / Wildfly Core) - if ( - forceUpdates or - jbossParentVersionElems['from.main.wildfly.pom'].text == jbossParentVersionElems['from.main.wildfly.core.pom'].text and - jbossParentVersionElems['from.main.wildfly.pom'].text != jbossParentVersionElems['from.main.keycloak.pom'].text or - jbossParentVersionElems['from.main.wildfly.pom'].text != jbossParentVersionElems['from.keycloak.boms.pom'].text - ): - - updatedJBossParentVersion = jbossParentVersionElems['from.main.wildfly.pom'].text - stepLogger.info("Updating version of 'jboss-parent' in the main Keycloak pom.xml file...") - jbossParentVersionElems['from.main.keycloak.pom'].text = updatedJBossParentVersion - lxml.etree.ElementTree(mainKeycloakPomXmlRoot).write(mainKeycloakPomPath, encoding = "UTF-8", pretty_print = True, xml_declaration = True) - stepLogger.info("'jboss-parent' version updated to '%s' to match the version used by Wildfly '%s'!" % (updatedJBossParentVersion, wildflyTag)) - - stepLogger.info("Updating version of 'jboss-parent' in the Keycloak's 'boms/pom.xml' file...") - jbossParentVersionElems['from.keycloak.boms.pom'].text = updatedJBossParentVersion - lxml.etree.ElementTree(keycloakBomsPomXmlRoot).write(keycloakBomsPomPath, encoding = "UTF-8", pretty_print = True, xml_declaration = True) - stepLogger.info("'jboss-parent' version updated to '%s' to match the version used by Wildfly '%s'!" % (updatedJBossParentVersion, wildflyTag)) - - # No update necessary ('jboss-parent' versions are already equal) - else: - jbossParentVersionUpdateNotNecessaryMsg = ( - "Update of the 'jboss-parent' version is not necessary!", - "\n\t\tCurrent '%s' version used by Keycloak already matches the current '%s' version used by Wildfly '%s'." % - (jbossParentVersionElems['from.main.keycloak.pom'].text, jbossParentVersionElems['from.main.wildfly.pom'].text, wildflyTag) - ) - stepLogger.info(_empty_string.join(jbossParentVersionUpdateNotNecessaryMsg)) - -def synchronizeInfinispanSubsystemXmlNamespaceWithWildfly(wildflyTag): - """ - Update the XML namespace of the 'subsystem' element of the Keycloak - Infinispan subsystem template with its current value as used by Wildfly. - """ - taskLogger = getTaskLogger("Update 'urn:jboss:domain:infinispan:*' version") - taskLogger.info('Synchronizing XML namespace of Infinispan subsystem from Wildfly to Keycloak...') - stepLogger = getStepLogger() - - wildflyInfinispanSubsystemElementErrorMessage = ( - "Unable to locate 'subsystem' XML element in the remote XML file!" - ) - # Retrieve 'subsystem' element from the Wildfly's Infinispan - # subsystem-template XML file - wildflyInfinispanSubsystemElement = list(filter( - lambda elem: 'subsystem' in elem.tag, - getElementsByXPathFromRemoteXml( - _wildfly_github_tag_ispn_subtempl_base_url % wildflyTag, - xPath = '/config/*', - nameSpace = {} - ) - )) - # Sanity check - _logErrorAndExitIf( - wildflyInfinispanSubsystemElementErrorMessage, - len(wildflyInfinispanSubsystemElement) != 1 - ) - # Retrieve namespace value of that 'subsystem' element - wildflyInfinispanSubsystemElementNamespace = ( - lxml.etree.QName(wildflyInfinispanSubsystemElement[0]).namespace - ) - # Absolute path to the Infinispan subsystem template XML file - # within local Keycloak git repository - keycloakInfinispanSubsystemTemplateXmlPath = ( - getKeycloakGitRepositoryRoot() + - '/wildfly/server-subsystem/src/main/resources/subsystem-templates/keycloak-infinispan.xml' - ) - # XML root of the Keycloak Infinispan subsystem template XML file - keycloakInfinispanSubsystemTemplateXmlRoot = getXmlRoot( - keycloakInfinispanSubsystemTemplateXmlPath - ) - keycloakInfinispanSubsystemElementErrorMessage = ( - "Unable to locate 'subsystem' XML element in the local XML file!", - ) - # Retrieve 'subsystem' element from the Keycloak's Infinispan - # subsystem-template XML file - keycloakInfinispanSubsystemElement = list(filter( - lambda elem: 'subsystem' in elem.tag, - getElementsByXPath( - keycloakInfinispanSubsystemTemplateXmlRoot, - xPath = '/config/*', - nameSpace = {} - ) - )) - # Sanity check - _logErrorAndExitIf( - keycloakInfinispanSubsystemElementErrorMessage, - len(keycloakInfinispanSubsystemElement) != 1 - ) - # Update namespace of Keycloak's Infinispan 'subsystem' element in - # subsystem-template XML file to match namespace value from Wildfly - keycloakInfinispanSubsystemElementParent = keycloakInfinispanSubsystemElement[0].getparent() - keycloakInfinispanSubsystemElementIndex = keycloakInfinispanSubsystemElementParent.index( - keycloakInfinispanSubsystemElement[0] - ) - keycloakInfinispanSubsystemElementParent.remove(keycloakInfinispanSubsystemElement[0]) - keycloakInfinispanSubsystemElementParent.insert( - keycloakInfinispanSubsystemElementIndex, - wildflyInfinispanSubsystemElement[0] - ) - # Write the changes back to Keycloak Infinispan subsystem-template XML file - lxml.etree.ElementTree(keycloakInfinispanSubsystemTemplateXmlRoot).write( - keycloakInfinispanSubsystemTemplateXmlPath, - encoding = "UTF-8", - pretty_print = True, - xml_declaration = True - ) - stepLogger.info( - "Updated XML namespace of the Keycloak's Infinispan subsystem to '%s'" % - lxml.etree.QName(wildflyInfinispanSubsystemElement[0]).namespace - ) diff --git a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/README.md b/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/README.md deleted file mode 100644 index 316683231d..0000000000 --- a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# fabric8-analytics-version-comparator/f8a\_version\_comparator - -Python module/library implementing generic Maven version comparison: - - https://github.com/apache/maven/blob/master/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/ComparableVersion.java - -The "f8a\_version\_comparator" Python module implementation was taken -from "fabric8-analytics/fabric8-analytics-version-comparator" repository: - - https://github.com/fabric8-analytics/fabric8-analytics-version-comparator diff --git a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/__init__.py b/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/__init__.py deleted file mode 100644 index 99a9b0e902..0000000000 --- a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/__init__.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright © 2018 Red Hat Inc. -# -# 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. -# -# Author: Geetika Batra -# - -"""Initialize Module.""" - -__all__ = [ - "base", - "comparable_version", - "item_object", -] - -from . import base -from . import comparable_version -from . import item_object diff --git a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/base.py b/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/base.py deleted file mode 100644 index cd92b23216..0000000000 --- a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/base.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright © 2018 Red Hat Inc. -# -# 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. -# -# Author: Geetika Batra -# - -"""Item class acting as base class for various item types.""" - -from abc import ABCMeta, abstractmethod - - -class Item(metaclass=ABCMeta): - """Base class for maven version comparator tasks.""" - - @abstractmethod - def compare_to(self, _item): - """Compare two maven versions.""" diff --git a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/comparable_version.py b/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/comparable_version.py deleted file mode 100644 index 79489e2465..0000000000 --- a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/comparable_version.py +++ /dev/null @@ -1,213 +0,0 @@ -# Copyright © 2018 Red Hat Inc. -# -# 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. -# -# Author: Geetika Batra -# - -"""Module to implement Comparable Version class.""" - -import typing - -from .item_object import IntegerItem -from .item_object import StringItem -from .item_object import ListItem - - -class ComparableVersion: - """Class for Comparable Version.""" - - def __init__(self, version: str): - """Initialize comparable version class. - - :version: Version supplied as a string - """ - if not isinstance(version, str): - raise TypeError( - "Invalid type {got!r} of argument `version`, expected {expected!r}".format( - got=type(version), - expected=str - )) - - self.version = version - self.items = self.parse_version() - - def __repr__(self): - """Return representation of ComparableVersion object.""" - return "{cls!s}(version={version!r})".format( - cls=self.__class__.__name__, - version=self.version - ) - - def __str__(self): - """Return version string held by ComparableVersion object.""" - return "{version!s}".format( - version=self.version - ) - - def __eq__(self, other): - """Compare ComparableVersion objects for equality. - - This rich comparison implies whether self == other - """ - # don't call compare_to(None) - if other is None: - return False - - return self.compare_to(other) == 0 - - def __ne__(self, other): - """Compare ComparableVersion objects for equality. - - This rich comparison implies whether self != other - """ - # don't call compare_to(None) - if other is None: - return True - - return self.compare_to(other) != 0 - - def __lt__(self, other): - """Compare ComparableVersion objects. - - This rich comparison implies whether self < other - """ - # don't call compare_to(None) - if other is None: - return False - - return self.compare_to(other) == -1 - - def __le__(self, other): - """Compare ComparableVersion objects. - - This rich comparison implies whether self <= other - """ - # don't call compare_to(None) - if other is None: - return False - - return self.compare_to(other) <= 0 - - def __gt__(self, other): - """Compare ComparableVersion objects. - - This rich comparison implies whether self > other - """ - # don't call compare_to(None) - if other is None: - return True - - return self.compare_to(other) == 1 - - def __ge__(self, other): - """Compare ComparableVersion objects. - - This rich comparison implies whether self >= other - """ - # don't call compare_to(None) - if other is None: - return True - - return self.compare_to(other) >= 0 - - def parse_version(self): - """Parse version.""" - # TODO: reduce cyclomatic complexity - ref_list = ListItem() - items = ref_list - parse_stack = list() - version = self.version.lower() - parse_stack.append(ref_list) - _is_digit = False - - _start_index = 0 - - for _ch in range(0, len(version)): - - ver_char = version[_ch] - - if ver_char == ".": - - if _ch == _start_index: - ref_list.add_item(IntegerItem(0)) - else: - ref_list.add_item(self.parse_item(_is_digit, version[_start_index: _ch])) - - _start_index = _ch + 1 - - elif ver_char == "-": - if _ch == _start_index: - ref_list.add_item(IntegerItem(0)) - else: - ref_list.add_item(self.parse_item(_is_digit, version[_start_index: _ch])) - _start_index = _ch + 1 - - temp = ListItem() - ref_list.add_item(temp) - ref_list = temp - parse_stack.append(ref_list) - elif ver_char.isdigit(): - if not _is_digit and _ch > _start_index: - ref_list.add_item(StringItem(version[_start_index: _ch], True)) - _start_index = _ch - - temp = ListItem() - ref_list.add_item(temp) - ref_list = temp - parse_stack.append(ref_list) - _is_digit = True - else: - if _is_digit and _ch > _start_index: - ref_list.add_item(self.parse_item(True, version[_start_index:_ch])) - _start_index = _ch - temp = ListItem() - ref_list.add_item(temp) - ref_list = temp - parse_stack.append(ref_list) - _is_digit = False - - if len(version) > _start_index: - ref_list.add_item(self.parse_item(_is_digit, version[_start_index:])) - - while parse_stack: - ref_list = parse_stack.pop() - ref_list.normalize() - - return items - - @staticmethod - def parse_item(_is_digit, buf): - """Wrap items in version in respective object class.""" - # TODO: make this function static (it does not need 'self') - if _is_digit: - return IntegerItem(buf) - - return StringItem(buf, False) - - def compare_to(self, obj: typing.Union["ComparableVersion", str]): - """Compare two ComparableVersion objects.""" - if isinstance(obj, ComparableVersion): - # compare two objects of the same type - cmp_result = self.items.compare_to(obj.items) - elif isinstance(obj, str): - # compare against string - cmp_result = self.items.compare_to(ComparableVersion(obj).items) - else: - raise TypeError( - "Invalid type {got!r} of argument `obj`, expected <{expected}>".format( - got=type(obj), - expected=typing.Union["ComparableVersion", str] - )) - - return cmp_result diff --git a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/item_object.py b/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/item_object.py deleted file mode 100644 index 14a9e18ad1..0000000000 --- a/misc/scripts/upgrade-wildfly/lib/wildfly/upgrade/dependencies/3rd_party/fabric8-analytics-version-comparator/f8a_version_comparator/item_object.py +++ /dev/null @@ -1,204 +0,0 @@ -# Copyright © 2018 Red Hat Inc. -# -# 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. -# -# Author: Geetika Batra -# - -"""Module to implement methods item types.""" - -from .base import Item -# TODO: setup logging - - -class IntegerItem(Item): - """Integer Item class for maven version comparator tasks.""" - - def __init__(self, str_version): - """Initialize integer from string value of version. - - :str_version: part of version supplied as string - """ - self.value = int(str_version) - - def int_cmp(self, cmp_value): - """Compare two integers.""" - if self.value.__lt__(cmp_value): - return -1 - if self.value.__gt__(cmp_value): - return 1 - return 0 - - def compare_to(self, item): - """Compare two maven versions.""" - if item is None: - return 0 if self.value == 0 else 1 - - if isinstance(item, IntegerItem): - return self.int_cmp(item.value) # check if this value thing works - if isinstance(item, StringItem): - return 1 - if isinstance(item, ListItem): - return 1 - else: - raise ValueError("invalid item" + str(type(item))) - - def to_string(self): - """Return string value of version.""" - return str(self.value) - - def __str__(self): - """Return string value of version - Pythonish variant.""" - return str(self.value) - - -class StringItem(Item): - """String Item class for maven version comparator tasks.""" - - def __init__(self, str_version, followed_by_digit): - """Initialize string value of version. - - :str_value: part of version supplied as string - :followed_by_digit: True if str_version is followed by digit - """ - self.qualifiers = ["alpha", "beta", "milestone", "rc", "snapshot", "", "sp"] - - self.aliases = { - "ga": "", - "final": "", - "cr": "rc" - } - - self.release_version_index = str(self.qualifiers.index("")) - self._decode_char_versions(str_version, followed_by_digit) - - def _decode_char_versions(self, value, followed_by_digit): - """Decode short forms of versions.""" - if followed_by_digit and len(value) == 1: - if value.startswith("a"): - value = "alpha" - elif value.startswith("b"): - value = "beta" - elif value.startswith("m"): - value = "milestone" - - self.value = self.aliases.get(value, value) - - def comparable_qualifier(self, qualifier): - """Get qualifier that is comparable.""" - q_index = None - if qualifier in self.qualifiers: - q_index = self.qualifiers.index(qualifier) - q_index_not_found = str(len(self.qualifiers)) + "-" + qualifier - - return str(q_index) if q_index is not None else q_index_not_found - - def str_cmp(self, val1, val2): - """Compare two strings.""" - if val1.__lt__(val2): - return -1 - if val1.__gt__(val2): - return 1 - return 0 - - def compare_to(self, item): - """Compare two maven versions.""" - if item is None: - temp = self.str_cmp(self.comparable_qualifier(self.value), self.release_version_index) - return temp - if isinstance(item, IntegerItem): - return -1 - if isinstance(item, StringItem): - return self.str_cmp( - self.comparable_qualifier( - self.value), self.comparable_qualifier( - item.value)) - if isinstance(item, ListItem): - return -1 - else: - raise ValueError("invalid item" + str(type(item))) - - def to_string(self): - """Return value in string form.""" - return str(self.value) - - def __str__(self): - """Return string value of version - Pythonish variant.""" - return str(self.value) - - -class ListItem(Item): - """List Item class for maven version comparator tasks.""" - - def __init__(self): - """Initialize string value of version.""" - self.array_list = list() - - def add_item(self, item): - """Add item to array list.""" - self.array_list.append(item) - - def get_list(self): - """Get object list items.""" - return self.array_list - - def normalize(self): - """Remove trailing items: 0, "", empty list.""" - red_list = [0, None, ""] - i = len(self.array_list) - 1 - while i >= 0: - last_item = self.array_list[i] - - if not isinstance(last_item, ListItem): - - if last_item.value in red_list: - self.array_list.pop(i) - else: - break - - i = i - 1 - - def compare_to(self, item): - """Compare two maven versions.""" - # TODO: reduce cyclomatic complexity - if item is None: - if len(self.array_list) == 0: - return 0 - first = self.array_list[0] - return first.compare_to(None) - - if isinstance(item, IntegerItem): - return -1 - if isinstance(item, StringItem): - return 1 - if isinstance(item, ListItem): - left_iter = iter(self.array_list) - right_iter = iter(item.get_list()) - - while True: - l_obj = next(left_iter, None) - r_obj = next(right_iter, None) - if l_obj is None and r_obj is None: - break - result = 0 - if l_obj is None: - if r_obj is not None: - result = -1 * r_obj.compare_to(l_obj) - else: - result = l_obj.compare_to(r_obj) - if result != 0: - return result - - return 0 - else: - raise ValueError("invalid item" + str(type(item))) diff --git a/misc/scripts/upgrade-wildfly/upgrade-keycloak-to-wildfly-tag.py b/misc/scripts/upgrade-wildfly/upgrade-keycloak-to-wildfly-tag.py deleted file mode 100755 index 6c659c0226..0000000000 --- a/misc/scripts/upgrade-wildfly/upgrade-keycloak-to-wildfly-tag.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python - -# * -# * Copyright 2020 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. -# * -# * - -import click, logging, os, sys - -import lib.wildfly.upgrade as wu - -CONTEXT_SETTINGS = dict(help_option_names = ['-h', '--help']) -FORCE_OPTION_HELP = """ - Force elements / files updates. - - In common mode of operation (without the "-f" or "--force" options) the - script upgrades the version of the Keycloak characteristic in question - (POM property, dependency, or some other XML element shared with Wildfly - application server) ONLY if the new version is HIGHER than the version of - the corresponding element currently present in the local copy of the - Keycloak repository, the script is operating on. - - The -f, --force options instruct the script to allow an upgrade to replace - newer version of a particular Keycloak characteristic with an older one. - Useful to perform e.g. Keycloak downgrades to previous Wildfly versions. -""" - -RHSSO_ADAPTERS_OPTION_HELP = """ - Update artifacts versions of selected dependencies utilized by various - RH-SSO adapter license XML files. Also update the location of the - corresponding license text files within the repository so their names - reflect the updated artifacts versions. -""" - -@click.command(context_settings=CONTEXT_SETTINGS) -@click.argument('tag', required = True, type=click.STRING) -@click.option('-f', '--force', help=FORCE_OPTION_HELP, is_flag=True) -@click.option('-r', '--update-rh-sso-adapters', help=RHSSO_ADAPTERS_OPTION_HELP, is_flag=True) -@click.option('-v', '--verbose', help='Enable verbose output.', is_flag=True) -@click.version_option(prog_name=sys.argv[0], version=wu.__version__) -def processParameters(tag, verbose, force, update_rh_sso_adapters): - """ - NAME - - upgrade-keycloak-to-wildfly-tag.py - Rebase Keycloak on top of the - specified Wildfly tag (release) - - DESCRIPTION - - Update the versions of various Keycloak characteristics (versions of - POM properties, adapter dependencies, and other attributes actually - binding the Keycloak POM build configuration to the particular Wildfly - tag) to their corresponding values as used by the Wildfly application - server of version matching the tag / release, passed to the script as - argument. - - EXAMPLES - - Upgrade Keycloak to Wildfly 20 (using "20.0.1.Final" Wildfly tag): - - $ python upgrade-keycloak-to-wildfly-tag.py 20.0.1.Final - - Downgrade Keycloak to Wildfly 16 (using "16.0.0.Final" Wildfly tag, - script verbose mode to display the details about elements being - updated, and force option to perform the actual downgrade): - - $ python upgrade-keycloak-to-wildfly-tag.py -v -f 16.0.0.Final - """ - - # Set loglevel to debug if '-v' or '--verbose' option was specified - wu.__loglevel__ = logging.DEBUG if verbose else logging.INFO - - upgradeKeycloakToWildflyTag(tag, forceUpdates = force, ssoAdapters = update_rh_sso_adapters) - -def upgradeKeycloakToWildflyTag(tag, forceUpdates = False, ssoAdapters = False): - wildflyTag = wu.isWellFormedWildflyTag(tag) - wildflyPomBaseUrl = "https://github.com/wildfly/wildfly/raw/%s/pom.xml" % wildflyTag - - taskLogger = wu.getTaskLogger("Rebase Keycloak on top of Wildfly '%s'" % wildflyTag) - taskLogger.info("Retrieving Wildfly's pom.xml for tag: %s" % wildflyTag) - wildflyPomFile = wu.saveUrlToNamedTemporaryFile(wildflyPomBaseUrl) - wildflyPomXmlRoot = wu.getXmlRoot(wildflyPomFile) - - wildflyCoreTag = wu.isWellFormedWildflyTag( wu.getPomProperty(wildflyPomXmlRoot, "version.org.wildfly.core")[0].text ) - wildflyCorePomBaseUrl = "https://github.com/wildfly/wildfly-core/raw/%s/pom.xml" % wildflyCoreTag - taskLogger.info("Retrieving Wildfly-Core pom.xml for tag: %s" % wildflyCoreTag) - wildflyCorePomFile = wu.saveUrlToNamedTemporaryFile(wildflyCorePomBaseUrl) - - if wildflyPomFile != None and wildflyCorePomFile != None: - - # Subtask - Update main Keycloak pom.xml file - wu.performMainKeycloakPomFileUpdateTask(wildflyPomFile, wildflyCorePomFile, forceUpdates) - # Subtask - Update adapter-galleon-pack pom.xml file if necessary - wu.performAdapterGalleonPackPomFileUpdateTask(wildflyCorePomFile, forceUpdates) - # Subtask - Update Keycloak adapters - wu.performKeycloakAdapterLicenseFilesUpdateTask(wildflyPomFile, wildflyCorePomFile, forceUpdates) - - if ssoAdapters: - # Subtask - Update RH-SSO adapters - wu.performRhssoAdapterLicenseFilesUpdateTask(wildflyPomFile, wildflyCorePomFile, forceUpdates) - else: - skipRhSsoAdapterUpdatesMessage = ( - "Skipping RH-SSO adapters updates since their changes weren't requested!", - "\n\tRerun the script with '-r' or '--update-rh-sso-adapters' option to request them." - ) - taskLogger.warning(wu._empty_string.join(skipRhSsoAdapterUpdatesMessage)) - - # Subtask - Update properties of the deprecated Wildfly testing module if necessary - wu.performDeprecatedWildflyTestingModuleUpdateTask(forceUpdates) - # Subtask - Update version of jboss-parent if necessary - wu.performJbossParentVersionUpdateTask(wildflyTag, wildflyPomFile, wildflyCorePomFile, forceUpdates) - # Subtask - Synchronize the XML namespace of the 'subsystem' element of the Keycloak - # Infinispan subsystem template with its current value as used by Wildfly - wu.synchronizeInfinispanSubsystemXmlNamespaceWithWildfly(wildflyTag) - - for filename in [wildflyPomFile, wildflyCorePomFile]: - os.remove(filename) - - rebaseDoneMessage = ( - "Done rebasing Keycloak to Wildfly '%s' release!" % wildflyTag, - "\n\tRun 'git status' to list the changed files and 'git diff ' to inspect changes done to a specific file." - ) - taskLogger.info(wu._empty_string.join(rebaseDoneMessage)) - -if __name__ == '__main__': - processParameters() diff --git a/model/legacy-private/src/main/java/org/keycloak/exportimport/util/ExportUtils.java b/model/legacy-private/src/main/java/org/keycloak/exportimport/util/ExportUtils.java index 444e004517..8ab3fed0f6 100755 --- a/model/legacy-private/src/main/java/org/keycloak/exportimport/util/ExportUtils.java +++ b/model/legacy-private/src/main/java/org/keycloak/exportimport/util/ExportUtils.java @@ -79,7 +79,7 @@ public class ExportUtils { ModelToRepresentation.exportRequiredActions(realm, rep); // Project/product version - rep.setKeycloakVersion(Version.VERSION_KEYCLOAK); + rep.setKeycloakVersion(Version.VERSION); // Client Scopes rep.setClientScopes(realm.getClientScopesStream().map(ModelToRepresentation::toRepresentation).collect(Collectors.toList())); diff --git a/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java b/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java index caf00b2402..e236928f27 100644 --- a/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java +++ b/model/legacy-private/src/main/java/org/keycloak/storage/datastore/LegacyMigrationManager.java @@ -120,7 +120,7 @@ public class LegacyMigrationManager implements MigrationManager { session.setAttribute(Constants.STORAGE_BATCH_SIZE, Integer.getInteger("keycloak.migration.batch-size")); MigrationModel model = session.getProvider(DeploymentStateProvider.class).getMigrationModel(); - ModelVersion currentVersion = new ModelVersion(Version.VERSION_KEYCLOAK); + ModelVersion currentVersion = new ModelVersion(Version.VERSION); ModelVersion latestUpdate = migrations[migrations.length-1].getVersion(); ModelVersion databaseVersion = model.getStoredVersion() != null ? new ModelVersion(model.getStoredVersion()) : null; diff --git a/pom.xml b/pom.xml index 6c393e5a3f..e6799a06ab 100644 --- a/pom.xml +++ b/pom.xml @@ -43,26 +43,15 @@ 2.13.2.Final - - - 7.5.0.GA - - ${timestamp} 26.1.1.Final 1.2.13.Final - 7.4.0.GA-redhat-00005 18.1.1.Final + 4.5.2 + 4.4.4 + org.wildfly + ${wildfly.version} 7.2.0.Final 7.5.22.Final-redhat-1 @@ -1907,29 +1896,6 @@ - - community - - - !product - - - - Keycloak - Keycloak - keycloak - main - \u003Cdiv class="kc-logo-text"\u003E\u003Cspan\u003EKeycloak\u003C\u002Fspan\u003E\u003C\u002Fdiv\u003E - ${project.version} - community - 4.5.2 - 4.4.4 - org.wildfly - ${wildfly.version} - ${project.version} - - - jdk9 @@ -1942,57 +1908,6 @@ - - product - - - product - - - - Red Hat Single Sign-On - rh-sso - rh-sso - eap - \u003Cstrong\u003ERed Hat\u003C\u002Fstrong\u003E\u003Csup\u003E\u00AE\u003C\u002Fsup\u003E Single Sign On - ${product.rhsso.version} - 4.5.2.redhat-2 - 4.4.4.redhat-2 - product - org.jboss.eap - ${eap.version} - - ${product.name} - - ${product.filename.version} - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.7 - - - set-product-filename-version - - regex-property - - initialize - - product.filename.version - ${product.rhsso.version} - ^(\d+(\.\d+)?).*?$ - $1 - true - - - - - - - - testsuite diff --git a/quarkus/dist/src/main/version.txt b/quarkus/dist/src/main/version.txt index 64db51aec2..b2ac2cf0db 100644 --- a/quarkus/dist/src/main/version.txt +++ b/quarkus/dist/src/main/version.txt @@ -1 +1 @@ -Keycloak - Version ${product.version} +Keycloak - Version ${project.version} diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakMain.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakMain.java index eb6b0e557d..4db4681979 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakMain.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakMain.java @@ -63,7 +63,7 @@ public class KeycloakMain implements QuarkusApplication { private static final String KEYCLOAK_ADMIN_PASSWORD_ENV_VAR = "KEYCLOAK_ADMIN_PASSWORD"; public static void main(String[] args) { - System.setProperty("kc.version", Version.VERSION_KEYCLOAK); + System.setProperty("kc.version", Version.VERSION); List cliArgs = Picocli.parseArgs(args); if (cliArgs.isEmpty()) { diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/resources/QuarkusWelcomeResource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/resources/QuarkusWelcomeResource.java index 7bc37401a2..bfe78a58b3 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/resources/QuarkusWelcomeResource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/resources/QuarkusWelcomeResource.java @@ -176,7 +176,6 @@ public class QuarkusWelcomeResource { map.put("adminConsoleEnabled", isAdminConsoleEnabled()); map.put("productName", Version.NAME); - map.put("productNameFull", Version.NAME_FULL); map.put("properties", theme.getProperties()); map.put("adminUrl", session.getContext().getUri(UrlType.ADMIN).getBaseUriBuilder().path("/admin/").build()); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/legacy/database/LegacyJpaConnectionProviderFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/legacy/database/LegacyJpaConnectionProviderFactory.java index 6db176247c..0a1b1128a5 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/legacy/database/LegacyJpaConnectionProviderFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/legacy/database/LegacyJpaConnectionProviderFactory.java @@ -252,7 +252,7 @@ public class LegacyJpaConnectionProviderFactory extends AbstractJpaConnectionPro JpaUpdaterProvider updater = session.getProvider(JpaUpdaterProvider.class); - boolean requiresMigration = version == null || !version.equals(new ModelVersion(Version.VERSION_KEYCLOAK).toString()); + boolean requiresMigration = version == null || !version.equals(new ModelVersion(Version.VERSION).toString()); session.setAttribute(VERIFY_AND_RUN_MASTER_CHANGELOG, requiresMigration); JpaUpdaterProvider.Status status = updater.validate(connection, schema); diff --git a/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java b/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java index 9cb357b589..be2c6fd2cf 100644 --- a/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java +++ b/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/DockerKeycloakDistribution.java @@ -28,7 +28,7 @@ public final class DockerKeycloakDistribution implements KeycloakDistribution { private String stderr = ""; private ToStringConsumer backupConsumer = new ToStringConsumer(); - private File distributionFile = new File("../../dist/target/keycloak-" + Version.VERSION_KEYCLOAK + ".tar.gz"); + private File distributionFile = new File("../../dist/target/keycloak-" + Version.VERSION + ".tar.gz"); private File dockerFile = new File("../../container/Dockerfile"); private GenericContainer> keycloakContainer = null; diff --git a/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java b/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java index 217b6a3720..8559a76ff3 100644 --- a/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java +++ b/quarkus/tests/integration/src/main/java/org/keycloak/it/utils/RawKeycloakDistribution.java @@ -343,7 +343,7 @@ public final class RawKeycloakDistribution implements KeycloakDistribution { Path distRootPath = Paths.get(System.getProperty("java.io.tmpdir")).resolve("kc-tests"); distRootPath.toFile().mkdirs(); - File distFile = new File("../../dist/" + File.separator + "target" + File.separator + "keycloak-" + Version.VERSION_KEYCLOAK + ".zip"); + File distFile = new File("../../dist/" + File.separator + "target" + File.separator + "keycloak-" + Version.VERSION + ".zip"); if (!distFile.exists()) { throw new RuntimeException("Distribution archive " + distFile.getAbsolutePath() +" doesn't exist"); } diff --git a/services/src/docs/swagger/apiinfo.json b/services/src/docs/swagger/apiinfo.json index 870e294748..575955f57d 100644 --- a/services/src/docs/swagger/apiinfo.json +++ b/services/src/docs/swagger/apiinfo.json @@ -1,4 +1,4 @@ { - "title": "${product.name.full} Admin REST API", - "description": "This is a REST API reference for the ${product.name.full} Admin" + "title": "Keycloak Admin REST API", + "description": "This is a REST API reference for the Keycloak Admin" } \ No newline at end of file diff --git a/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java b/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java index 8b0fcd8d0a..b02dcfb7e0 100755 --- a/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java +++ b/services/src/main/java/org/keycloak/services/resources/WelcomeResource.java @@ -179,7 +179,6 @@ public class WelcomeResource { map.put("adminConsoleEnabled", isAdminConsoleEnabled()); map.put("productName", Version.NAME); - map.put("productNameFull", Version.NAME_FULL); map.put("properties", theme.getProperties()); map.put("adminUrl", session.getContext().getUri(UrlType.ADMIN).getBaseUriBuilder().path("/admin/").build()); diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java index cd53997d43..f586674f16 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java @@ -966,7 +966,7 @@ public class TestingResourceProvider implements RealmResourceProvider { * KEYCLOAK-12958 */ private void disableFeatureProperties(Profile.Feature feature) { - Profile.Type type = Profile.getName().equals("product") ? feature.getTypeProduct() : feature.getTypeProject(); + Profile.Type type = feature.getType(); if (type.equals(Profile.Type.DEFAULT)) { System.setProperty("keycloak.profile.feature." + feature.toString().toLowerCase(), "disabled"); } else { diff --git a/testsuite/integration-arquillian/servers/migration/pom.xml b/testsuite/integration-arquillian/servers/migration/pom.xml index 87cbe6b211..1fedd34cc9 100644 --- a/testsuite/integration-arquillian/servers/migration/pom.xml +++ b/testsuite/integration-arquillian/servers/migration/pom.xml @@ -152,39 +152,4 @@ - - - - community - - - !product - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - - - - - productized-server - - - previous.product.unpacked.folder.name - - - - ${project.build.directory}/unpacked/${previous.product.unpacked.folder.name} - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/pom.xml b/testsuite/integration-arquillian/servers/pom.xml index 1db1a7323e..46b4afe2dd 100644 --- a/testsuite/integration-arquillian/servers/pom.xml +++ b/testsuite/integration-arquillian/servers/pom.xml @@ -33,6 +33,7 @@ sh + 7.4.0.GA-redhat-00005 7.1.5.GA-redhat-00002 7.1.1.Final diff --git a/testsuite/integration-arquillian/tests/base/pom.xml b/testsuite/integration-arquillian/tests/base/pom.xml index 491c6f733b..a714827edb 100644 --- a/testsuite/integration-arquillian/tests/base/pom.xml +++ b/testsuite/integration-arquillian/tests/base/pom.xml @@ -405,25 +405,6 @@ - - product - - - product - - - - - - com.igormaznitsa - mvn-golang-wrapper - - true - - - - - app-server-jetty94 diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java index a5725c1bbc..b8eff6e2b5 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/AbstractKeycloakTest.java @@ -729,16 +729,6 @@ public abstract class AbstractKeycloakTest { return in; } - /** - * Get product/project name - * - * @return f.e. 'RH-SSO' or 'Keycloak' - */ - protected String getProjectName() { - final boolean isProduct = adminClient.serverInfo().getInfo().getProfileInfo().getName().equals("product"); - return isProduct ? Profile.PRODUCT_NAME : Profile.PROJECT_NAME; - } - /** * MapRealmProvider uses session.invalidate() instead of calling e.g. * session.clients().removeClients(realm); for clients (where clients are being removed one by one) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBaseBrokerTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBaseBrokerTest.java index 6693829fc8..026a37c1da 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBaseBrokerTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/AbstractBaseBrokerTest.java @@ -417,7 +417,7 @@ public abstract class AbstractBaseBrokerTest extends AbstractKeycloakTest { } protected void waitForAccountManagementTitle() { - final String title = getProjectName().toLowerCase() + " account management"; + final String title = "Keycloak account management"; waitForPage(driver, title, true); } diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java index 046dd99698..cf0c8ad7eb 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/ResetPasswordTest.java @@ -1137,7 +1137,7 @@ public class ResetPasswordTest extends AbstractTestRealmKeycloakTest { final String REQUIRED_URI = OAuthClient.AUTH_SERVER_ROOT + "/realms/test/account/applications"; final String REDIRECT_URI = getAccountRedirectUrl() + "?path=applications"; final String CLIENT_ID = "account"; - final String ACCOUNT_MANAGEMENT_TITLE = getProjectName() + " Account Management"; + final String ACCOUNT_MANAGEMENT_TITLE = "Keycloak Account Management"; try (BrowserTabUtil tabUtil = BrowserTabUtil.getInstanceAndSetEnv(driver)) { assertThat(tabUtil.getCountOfTabs(), Matchers.is(1)); diff --git a/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java b/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java index b61e16aab6..d4be78a637 100644 --- a/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java +++ b/testsuite/model/src/test/java/org/keycloak/testsuite/model/MigrationModelTest.java @@ -58,7 +58,7 @@ public class MigrationModelTest extends KeycloakModelTest { public void test() { inComittedTransaction(1, (session , i) -> { - String currentVersion = new ModelVersion(Version.VERSION_KEYCLOAK).toString(); + String currentVersion = new ModelVersion(Version.VERSION).toString(); JpaConnectionProvider p = session.getProvider(JpaConnectionProvider.class); EntityManager em = p.getEntityManager(); diff --git a/testsuite/performance/pom.xml b/testsuite/performance/pom.xml index 9383d98e91..ad5b567c83 100644 --- a/testsuite/performance/pom.xml +++ b/testsuite/performance/pom.xml @@ -32,7 +32,7 @@ pom - ${product.version} + ${project.version} false diff --git a/testsuite/pom.xml b/testsuite/pom.xml index 70fd954269..2d7d5459b8 100755 --- a/testsuite/pom.xml +++ b/testsuite/pom.xml @@ -46,6 +46,13 @@ true + + org.apache.maven.plugins + maven-deploy-plugin + + true + + diff --git a/themes/pom.xml b/themes/pom.xml index 1ab5e9f80a..d671e1b049 100755 --- a/themes/pom.xml +++ b/themes/pom.xml @@ -69,6 +69,9 @@ **/keycloak.v2/account/src/** + + src/main/resources-community + @@ -190,43 +193,6 @@ - - - community - - - !product - - - - - - src/main/resources-community - - - - - - product - - - product - - - - - - src/main/resources-product - - - src/main/resources - - **/node_modules/rcue/** - - - - - diff --git a/themes/src/main/resources-product/META-INF/keycloak-themes.json b/themes/src/main/resources-product/META-INF/keycloak-themes.json deleted file mode 100755 index 5b4c77fb12..0000000000 --- a/themes/src/main/resources-product/META-INF/keycloak-themes.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "themes": [{ - "name" : "base", - "types": [ "admin", "account", "login", "email" ] - }, { - "name" : "keycloak", - "types": [ "admin", "account", "login", "common", "email", "welcome" ] - }, { - "name" : "rh-sso", - "types": [ "admin", "account", "login", "common", "email", "welcome" ] - }, { - "name" : "keycloak.v2", - "types": [ "account" ] - }, { - "name" : "rh-sso.v2", - "types": [ "account" ] - }] -} \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/base/account/theme.properties b/themes/src/main/resources-product/theme/base/account/theme.properties deleted file mode 100644 index 41e974fb1c..0000000000 --- a/themes/src/main/resources-product/theme/base/account/theme.properties +++ /dev/null @@ -1 +0,0 @@ -locales=en \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/base/admin/theme.properties b/themes/src/main/resources-product/theme/base/admin/theme.properties deleted file mode 100644 index a479a13545..0000000000 --- a/themes/src/main/resources-product/theme/base/admin/theme.properties +++ /dev/null @@ -1,2 +0,0 @@ -import=common/keycloak -locales=en \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/base/email/theme.properties b/themes/src/main/resources-product/theme/base/email/theme.properties deleted file mode 100644 index 41e974fb1c..0000000000 --- a/themes/src/main/resources-product/theme/base/email/theme.properties +++ /dev/null @@ -1 +0,0 @@ -locales=en \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/base/login/theme.properties b/themes/src/main/resources-product/theme/base/login/theme.properties deleted file mode 100644 index 41e974fb1c..0000000000 --- a/themes/src/main/resources-product/theme/base/login/theme.properties +++ /dev/null @@ -1 +0,0 @@ -locales=en \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/rh-sso.v2/account/messages/messages_en.properties b/themes/src/main/resources-product/theme/rh-sso.v2/account/messages/messages_en.properties deleted file mode 100644 index 8bffc28d8f..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso.v2/account/messages/messages_en.properties +++ /dev/null @@ -1,4 +0,0 @@ -# Put new messages for Account Console Here -# Feel free to use any existing messages from the base theme -accountManagementWelcomeMessage=Welcome to RH-SSO Account Management -accountManagementTitle=RH-SSO Account Management \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/favicon.ico b/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/favicon.ico deleted file mode 100644 index 11c5cd2619..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/favicon.ico and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/layout.css b/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/layout.css deleted file mode 100644 index c943e1eb33..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/layout.css +++ /dev/null @@ -1,3 +0,0 @@ -.brand { - height: 16px; -} \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/logo.svg b/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/logo.svg deleted file mode 100644 index a908d8c006..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso.v2/account/resources/public/logo.svg +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/themes/src/main/resources-product/theme/rh-sso.v2/account/theme.properties b/themes/src/main/resources-product/theme/rh-sso.v2/account/theme.properties deleted file mode 100644 index 2d72a63947..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso.v2/account/theme.properties +++ /dev/null @@ -1 +0,0 @@ -parent=keycloak.v2 diff --git a/themes/src/main/resources-product/theme/rh-sso/account/messages/messages_en.properties b/themes/src/main/resources-product/theme/rh-sso/account/messages/messages_en.properties deleted file mode 100644 index dfe4ef623c..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/account/messages/messages_en.properties +++ /dev/null @@ -1 +0,0 @@ -accountManagementTitle=RH-SSO Account Management diff --git a/themes/src/main/resources-product/theme/rh-sso/account/resources/css/account.css b/themes/src/main/resources-product/theme/rh-sso/account/resources/css/account.css deleted file mode 100644 index 56a03789cb..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/account/resources/css/account.css +++ /dev/null @@ -1,279 +0,0 @@ -html { - height: 100%; -} - -body { - background-color: #F9F9F9; - margin: 0; - padding: 0; - height: 100%; -} - -header .navbar { - margin-bottom: 0; - min-height: inherit; -} - -.header .container { - position: relative; -} - -.navbar-title { - background-image: url('../img/brand.svg'); - height: 25px; - background-repeat: no-repeat; - width: 172px; - margin: 3px 10px 5px; - text-indent: -99999px; - position: relative; - top: 8px; -} - -.navbar-pf .navbar-utility { - right: 20px; - top: -34px; - font-size: 12px; -} - -.navbar-pf .navbar-utility > li > a { - color: #fff !important; - padding-bottom: 12px; - padding-top: 11px; - border-left: medium none; -} - -.container { - height: 100%; -} - -.content-area { - background-color: #fff; - border-color: #CECECE; - border-style: solid; - border-width: 0 1px; - height: 100%; - padding: 0 30px; -} - -.margin-bottom { - margin-bottom: 10px; -} - -/* Sidebar */ - -.bs-sidebar { - background-color: #f9f9f9; - padding-top: 44px; - padding-right: 0; - padding-left: 0; - z-index: 20; -} -.bs-sidebar ul { - list-style: none; - padding-left: 12px; -} - -.bs-sidebar ul li { - margin-bottom: 0.5em; - margin-left: -1em; -} -.bs-sidebar ul li a { - font-size: 14px; - padding-left: 25px; - color: #4d5258; - line-height: 28px; - display: block; - border-width: 1px 0 1px 1px; - border-style: solid; - border-color: #f9f9f9; -} -.bs-sidebar ul li a:hover, -.bs-sidebar ul li a:focus { - text-decoration: none; - color: #777777; - border-right: 2px solid #aaa; -} -.bs-sidebar ul li.active a { - background-color: #c7e5f0; - border-color: #56bae0; - font-weight: bold; - background-image: url(../img/icon-sidebar-active.png); - background-repeat: no-repeat; - background-position: right center; -} - -.bs-sidebar ul li.active a:hover { - border-right: none; -} - - -.content-area h2 { - font-family: "Open Sans", sans-serif; - font-weight: 100; - font-size: 24px; - margin-bottom: 25px; - margin-top: 25px; -} - -.subtitle { - text-align: right; - margin-top: 30px; - color: #909090; -} - -.required { - color: #CB2915; -} - - -.alert { - margin-top: 30px; - margin-bottom: 0; -} - -.feedback-aligner .alert { - background-position: 1.27273em center; - background-repeat: no-repeat; - border-radius: 2px; - border-width: 1px; - color: #4D5258; - display: inline-block; - font-size: 1.1em; - line-height: 1.4em; - margin: 0; - padding: 0.909091em 3.63636em; - position: relative; - text-align: left; -} -.alert.alert-success { - background-color: #E4F1E1; - border-color: #4B9E39; -} -.alert.alert-error { - background-color: #F8E7E7; - border-color: #B91415; -} -.alert.alert-warning { - background-color: #FEF1E9; - border-color: #F17528; -} -.alert.alert-info { - background-color: #E4F3FA; - border-color: #5994B2; -} - -.form-horizontal { - border-top: 1px solid #E9E8E8; - padding-top: 23px; -} - -.form-horizontal .control-label { - color: #909090; - line-height: 1.4em; - padding-top: 5px; - position: relative; - text-align: right; - width: 100%; -} - -.form-group { - position: relative; -} - -.control-label + .required { - position: absolute; - right: -2px; - top: 0; -} - -#kc-form-buttons { - text-align: right; - margin-top: 10px; -} - -#kc-form-buttons .btn-primary { - float: right; - margin-left: 8px; -} - -/* Authenticator page */ - -ol { - padding-left: 40px; -} - -ol li { - font-size: 13px; - margin-bottom: 10px; - position: relative; -} - -ol li img { - margin-top: 15px; - margin-bottom: 5px; - border: 1px solid #eee; -} - -hr + .form-horizontal { - border: none; - padding-top: 0; -} - -.kc-dropdown{ - position: relative; -} -.kc-dropdown > a{ - display:block; - padding: 11px 10px 12px; - line-height: 12px; - font-size: 12px; - color: #fff !important; - text-decoration: none; -} -.kc-dropdown > a::after{ - content: "\2c5"; - margin-left: 4px; -} -.kc-dropdown:hover > a{ - background-color: rgba(0,0,0,0.2); -} -.kc-dropdown ul li a{ - padding: 1px 11px; - font-size: 12px; - color: #000 !important; - border: 1px solid #fff; - text-decoration: none; - display:block; - line-height: 20px; -} -.kc-dropdown ul li a:hover{ - color: #4d5258; - background-color: #d4edfa; - border-color: #b3d3e7; -} -.kc-dropdown ul{ - position: absolute; - z-index: 2000; - list-style:none; - display:none; - padding: 5px 0px; - margin: 0px; - background-color: #fff !important; - border: 1px solid #b6b6b6; - border-radius: 1px; - -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); - background-clip: padding-box; - min-width: 100px; -} -.kc-dropdown:hover ul{ - display:block; -} - - -#kc-totp-secret-key { - border: 1px solid #eee; - font-size: 16px; - padding: 10px; - margin: 50px 0; -} diff --git a/themes/src/main/resources-product/theme/rh-sso/account/resources/img/icon-sidebar-active.png b/themes/src/main/resources-product/theme/rh-sso/account/resources/img/icon-sidebar-active.png deleted file mode 100644 index e7b9b08283..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/account/resources/img/icon-sidebar-active.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/account/theme.properties b/themes/src/main/resources-product/theme/rh-sso/account/theme.properties deleted file mode 100644 index c90d2714a8..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/account/theme.properties +++ /dev/null @@ -1,4 +0,0 @@ -parent=keycloak - -styles=css/account.css -stylesCommon=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css diff --git a/themes/src/main/resources-product/theme/rh-sso/admin/messages/admin-messages_en.properties b/themes/src/main/resources-product/theme/rh-sso/admin/messages/admin-messages_en.properties deleted file mode 100644 index 24d6e16a33..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/admin/messages/admin-messages_en.properties +++ /dev/null @@ -1 +0,0 @@ -consoleTitle=RH-SSO Admin Console diff --git a/themes/src/main/resources-product/theme/rh-sso/admin/resources/css/styles.css b/themes/src/main/resources-product/theme/rh-sso/admin/resources/css/styles.css deleted file mode 100644 index 72f7cba22c..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/admin/resources/css/styles.css +++ /dev/null @@ -1,411 +0,0 @@ -html,body { - height: 100%; -} - -form { - margin-top: 20px; -} - -table { - margin-top: 20px; -} - -.required { - color: #f00; -} - -.tooltip-inner { - min-width: 200px; -} - -.margin-top { - margin-top: 20px; -} - -.no-margin-top { - margin-top: 0px !important; -} - -table { - max-width: 100%; -} - -td.clip { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - max-width: 0; -} - -th.w-10 { - width: 10%; -} - -th.w-15 { - width: 15%; -} - -th.w-20 { - width: 20%; -} - - -th.w-25 { - width: 25%; -} - -th.w-30 { - width: 30%; -} - - -th.w-35 { - width: 35%; -} - -th.w-40 { - width: 40%; -} - -/*********** Loading ***********/ - -.loading { - background-color: #f5f5f5; - border: 1px solid #eee; - position: absolute; - bottom: 0px; - left: 0px; - padding: 2px 200px 2px 5px; -} - -/*********** Feedback ***********/ - -.feedback-aligner { - position: fixed; - top: 15px; - text-align: center; - width: 100%; - height: 0; - z-index: 100; -} -.feedback-aligner .alert { - border-radius: 2px; - border-width: 1px; - display: inline-block; - position: relative; -} - -/*********** On-Off Switch ***********/ - -.onoffswitch { - -moz-user-select: none; - height: 26px; - position: relative; - width: 62px; -} -.onoffswitch .onoffswitch-checkbox { - display: none; -} -.onoffswitch .onoffswitch-label { - border: 1px solid #bbb; - border-radius: 2px; - cursor: pointer; - display: block; - overflow: hidden; - width: 62px; -} -.onoffswitch .onoffswitch-inner { - display: block; - margin-left: -100%; - transition: margin 0.3s ease-in 0s; - width: 200%; -} -.onoffswitch .onoffswitch-inner > span { - -moz-box-sizing: border-box; - color: white; - float: left; - font-size: 11px; - font-family: "Open Sans", sans-serif; - font-weight: bold; - height: 24px; - line-height: 24px; - padding: 0; - width: 50%; -} -.onoffswitch .onoffswitch-switch { - background-image: linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -o-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -moz-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -webkit-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -ms-linear-gradient(top, #fafafa 0%, #ededed 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fafafa), color-stop(1, 0, #ededed)); - border: 1px solid #aaa; - border-radius: 2px; - bottom: 0; - margin: 0; - position: absolute; - right: 39px; - top: 0; - transition: all 0.3s ease-in 0s; - -webkit-transition: all 0.3s ease-in 0s; - width: 23px; -} -.onoffswitch .onoffswitch-inner .onoffswitch-active { - background-image: linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -o-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -moz-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -webkit-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -ms-linear-gradient(top, #00a9ec 0%, #009bd3 100%); - background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #00a9ec), color-stop(1, 0, #009bd3)); - color: #FFFFFF; - padding-left: 10px; -} -.onoffswitch-checkbox:disabled + .onoffswitch-label .onoffswitch-inner .onoffswitch-active, -.onoffswitch-checkbox:disabled + .onoffswitch-label .onoffswitch-inner .onoffswitch-inactive { - background-image: none; - background-color: #e5e5e5; - color: #9d9fa1; -} -.onoffswitch .onoffswitch-inner .onoffswitch-inactive { - background: linear-gradient(#fefefe, #e8e8e8) repeat scroll 0 0 transparent; - color: #4d5258; - padding-right: 10px; - text-align: right; -} -.onoffswitch .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-inner { - margin-left: 0; -} -.onoffswitch .onoffswitch-checkbox:checked + .onoffswitch-label .onoffswitch-switch { - right: 0; -} - - -/*********** Select 2 ***********/ - -.select2-container { - width: 100%; -} - -.select2-container-multi .select2-choices .select2-search-field { - height: 26px; -} - - -/*********** New Menu ***********/ - - -.sidebar-pf-left{ - background: #292e34; -} - -.sidebar-pf .nav-pills > li a i, .sidebar-pf .nav-pills > li a span{ - color: #72767b; - display: inline-block; - margin-right: 10px; -} -.sidebar-pf .nav-pills > li > a{ - color: #dbdada; - padding: 0px 20px 0 30px!important; - line-height: 30px; - border-left-width: 12px; - border-left-style: solid; - border-left-color: #292e34; - margin-left: -6px; -} - -.sidebar-pf .nav-pills > li > a:hover{ - background: #393f44; - border-color:#292e34; - border-left-color: #393f44; - color: #fff; -} - -.sidebar-pf .nav-pills > li > a:after{ - display: none!important; -} - - -.sidebar-pf .nav-pills > li.active > a { - color: #fff; - background: #393f44!important; - border-bottom: 1px solid #000!important; - border-top: 1px solid #000!important; - border-left-color: #39a5dc!important; -} - -.sidebar-pf .nav-pills > li.active a i, .sidebar-pf .nav-pills > li.active a span{ - color: #39a5dc; -} - -/*********** Realm selector ***********/ - -.realm-selector{ - color: #fff; - margin: 0 -20px; - position: relative; -} - -.realm-dropmenu{ - display: none; - cursor: pointer; - position: absolute; - top: 60px; - left: 0; - right: 0; - z-index: 999; - background: #fff; -} - -.realm-selector:hover .realm-dropmenu{ - display: block; -} - -.realm-add{ - padding: 10px; -} - -.realm-selector h2{ - font-size: 16px; - line-height: 60px; - padding: 0 20px; - margin: 0; - border-bottom: 1px solid #d5d5d6; -} - -.realm-selector h2 i{ - display: inline-block; - float: right; - line-height: 60px; -} - - -.realm-selector ul{ - padding-left: 0; - margin: 0; - list-style: none; - max-height: 200px; - overflow-y:auto; -} - - -.realm-selector ul li a{ - line-height: 60px; - padding: 0 20px; - border-bottom: 1px solid #d5d5d6; - line-height: 39px; - display: block; - font-size: 14px; -} - - -/*********** Overwrites header defaults ***********/ - -.navbar-pf{ - border-top: none!important; -} - -.navbar-pf .navbar-header { - height: 56px; -} - -.navbar-pf .navbar-brand { - padding: 0; - height: 56px; - line-height: 56px; - background-position: center center; - background-image: url('../img/brand.svg'); - background-size: 172px 10px; - background-repeat: no-repeat; - width: 176px; - position: relative; - top: 50%; - -webkit-transform: translateY(-50%); - -ms-transform: translateY(-50%); - transform: translateY(-50%); -} - -.navbar-pf .navbar-utility .dropdown-toggle { - padding: 23px !important; -} - -.clickable { - cursor: pointer; -} - -h1 i { - color: #999999; - font-size: 18px; - margin-left: 10px; -} - -/* Action cell */ -.kc-action-cell { - background-color: #eeeeee; - background-image: linear-gradient(to bottom, #fafafa 0%, #ededed 100%); - background-repeat: repeat-x; - - text-align: center; - vertical-align: middle; - - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - - cursor:pointer; -} - -.kc-action-cell:hover { - background-color: #eeeeee; - background-image: none; -} - -.kc-sorter span { - margin-left: 10px; -} - - -/* Time selector */ - -.time-selector input { - display: inline-block; - width: 120px; - padding-right: 0; - margin-right: 0; -} - -.time-selector select { - display: inline-block; - width: 80px; - margin-left: 0; - padding-left: 0; -} - -.ace_editor { - height: 600px; - width: 100%; -} - -.kc-button-input-file input { - float: left; - width: 73%; -} - -.kc-button-input-file label { - float: left; - margin-left: 2%; - width: 25%; -} - -table.kc-authz-table-expanded { - margin-top: 0px !important; -} - -.no-gutter > [class*='col-'] { - padding-right:0!important; - padding-left:0!important; -} - -.password-conceal { - font-family: 'text-security-disc'; - font-size: 14px; -} diff --git a/themes/src/main/resources-product/theme/rh-sso/admin/resources/img/select-arrow.png b/themes/src/main/resources-product/theme/rh-sso/admin/resources/img/select-arrow.png deleted file mode 100644 index a865a6fa73..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/admin/resources/img/select-arrow.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/admin/theme.properties b/themes/src/main/resources-product/theme/rh-sso/admin/theme.properties deleted file mode 100755 index 89e42ff816..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/admin/theme.properties +++ /dev/null @@ -1,5 +0,0 @@ -parent=keycloak -import=common/rh-sso - -styles=css/styles.css -stylesCommon=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css node_modules/select2/select2.css lib/angular/treeview/css/angular.treeview.css node_modules/text-security/text-security.css diff --git a/themes/src/main/resources-product/theme/rh-sso/common/resources/img/brand.svg b/themes/src/main/resources-product/theme/rh-sso/common/resources/img/brand.svg deleted file mode 100644 index a908d8c006..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/common/resources/img/brand.svg +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/themes/src/main/resources-product/theme/rh-sso/common/resources/img/favicon.ico b/themes/src/main/resources-product/theme/rh-sso/common/resources/img/favicon.ico deleted file mode 100644 index 11c5cd2619..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/common/resources/img/favicon.ico and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/email/theme.properties b/themes/src/main/resources-product/theme/rh-sso/email/theme.properties deleted file mode 100644 index f1dbb7215d..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/email/theme.properties +++ /dev/null @@ -1 +0,0 @@ -parent=base \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/rh-sso/login/resources/css/login-rhsso.css b/themes/src/main/resources-product/theme/rh-sso/login/resources/css/login-rhsso.css deleted file mode 100644 index 3668b1bb84..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/login/resources/css/login-rhsso.css +++ /dev/null @@ -1,21 +0,0 @@ -.login-pf body { - background: url("../node_modules/rcue/dist/img/bg-login.png") no-repeat left top fixed; - background-size: auto; - height: 100%; -} - -@media (max-width: 767px) { - .login-pf body { - background: white; - } -} - -@media (min-width: 767px) { - .login-pf { - background-attachment: fixed; - } -} -#kc-header-wrapper sup { - font-size: 35%; - top: -1.4em; -} diff --git a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-error-arrow-down.png b/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-error-arrow-down.png deleted file mode 100644 index 6f2d9d2aeb..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-error-arrow-down.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-error-sign.png b/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-error-sign.png deleted file mode 100644 index 0dd500445d..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-error-sign.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-success-arrow-down.png b/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-success-arrow-down.png deleted file mode 100644 index 03cc0c45dc..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-success-arrow-down.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-success-sign.png b/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-success-sign.png deleted file mode 100644 index 640bd71cab..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-success-sign.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-warning-arrow-down.png b/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-warning-arrow-down.png deleted file mode 100644 index 6f2d9d2aeb..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-warning-arrow-down.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-warning-sign.png b/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-warning-sign.png deleted file mode 100644 index f9392a356f..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/login/resources/img/feedback-warning-sign.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/login/theme.properties b/themes/src/main/resources-product/theme/rh-sso/login/theme.properties deleted file mode 100644 index dfe9265c06..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/login/theme.properties +++ /dev/null @@ -1,4 +0,0 @@ -parent=keycloak - -styles=css/login.css css/tile.css css/login-rhsso.css -stylesCommon=web_modules/@patternfly/react-core/dist/styles/base.css web_modules/@patternfly/react-core/dist/styles/app.css node_modules/patternfly/dist/css/patternfly.min.css node_modules/patternfly/dist/css/patternfly-additions.min.css lib/pficon/pficon.css node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css \ No newline at end of file diff --git a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/bg-login.png b/themes/src/main/resources-product/theme/rh-sso/welcome/resources/bg-login.png deleted file mode 100644 index c408a6511b..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/bg-login.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/bg.png b/themes/src/main/resources-product/theme/rh-sso/welcome/resources/bg.png deleted file mode 100644 index 531d5638b4..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/bg.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/css/welcome-rhsso.css b/themes/src/main/resources-product/theme/rh-sso/welcome/resources/css/welcome-rhsso.css deleted file mode 100644 index 68e903c252..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/css/welcome-rhsso.css +++ /dev/null @@ -1,12 +0,0 @@ -body { - background-image: url(../bg.png),url(../bg-login.png); - background-repeat: no-repeat,no-repeat; - background-position: right bottom, left top; - background-size: auto, auto; - background-color: #1a1a1a; - height: 100%; -} - -.welcome-header { - color: #fff; -} diff --git a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/logo.png b/themes/src/main/resources-product/theme/rh-sso/welcome/resources/logo.png deleted file mode 100644 index 45a80951d4..0000000000 Binary files a/themes/src/main/resources-product/theme/rh-sso/welcome/resources/logo.png and /dev/null differ diff --git a/themes/src/main/resources-product/theme/rh-sso/welcome/theme.properties b/themes/src/main/resources-product/theme/rh-sso/welcome/theme.properties deleted file mode 100644 index 66ae577058..0000000000 --- a/themes/src/main/resources-product/theme/rh-sso/welcome/theme.properties +++ /dev/null @@ -1,7 +0,0 @@ -parent=keycloak - -styles=css/welcome.css css/welcome-rhsso.css -stylesCommon=node_modules/rcue/dist/css/rcue.min.css node_modules/rcue/dist/css/rcue-additions.min.css - -documentationUrl=https://access.redhat.com/documentation/en/red-hat-single-sign-on/ -displayCommunityLinks=false \ No newline at end of file diff --git a/themes/src/main/resources/theme/keycloak/welcome/index.ftl b/themes/src/main/resources/theme/keycloak/welcome/index.ftl index 29daacc918..3bc2975beb 100755 --- a/themes/src/main/resources/theme/keycloak/welcome/index.ftl +++ b/themes/src/main/resources/theme/keycloak/welcome/index.ftl @@ -23,7 +23,7 @@ - Welcome to ${productNameFull} + Welcome to ${productName} @@ -49,7 +49,7 @@ - Welcome to ${productNameFull} + Welcome to ${productName} <#if adminConsoleEnabled> @@ -98,7 +98,7 @@ Administration Console - Centrally manage all aspects of the ${productNameFull} server + Centrally manage all aspects of the ${productName} server