From b4c837f14810d09f016ebf37d346339957dffaa3 Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Fri, 15 Oct 2021 18:37:53 -0300 Subject: [PATCH] [KEYCLOAK-19564] - Avoid split packages in Dist.X --- .../quarkus/deployment/KeycloakProcessor.java | 34 ++++++++--------- .../deployment/LiquibaseProcessor.java | 6 +-- .../quarkus/deployment/isReAugmentation.java | 2 +- .../quarkus/dev/QuarkusDevRequestFilter.java | 20 ---------- .../runtime}/Environment.java | 6 +-- .../runtime}/InitializationException.java | 5 +-- .../{ => quarkus/runtime}/KeycloakMain.java | 14 +++---- .../{ => runtime}/KeycloakRecorder.java | 14 +++---- .../cli/ExecutionExceptionHandler.java | 2 +- .../{ => quarkus/runtime}/cli/Picocli.java | 30 +++++++-------- .../runtime}/cli/SubCommandListRenderer.java | 2 +- .../runtime}/cli/command/AbstractCommand.java | 4 +- .../command/AbstractExportImportCommand.java | 6 +-- .../cli/command/AbstractStartCommand.java | 4 +- .../runtime}/cli/command/Build.java | 8 ++-- .../runtime}/cli/command/Completion.java | 2 +- .../runtime}/cli/command/Export.java | 2 +- .../runtime}/cli/command/Import.java | 2 +- .../runtime}/cli/command/Main.java | 4 +- .../runtime}/cli/command/ShowConfig.java | 20 +++++----- .../runtime}/cli/command/Start.java | 2 +- .../runtime}/cli/command/StartDev.java | 4 +- .../runtime}/cli/command/Tools.java | 2 +- .../configuration/ConfigArgsConfigSource.java | 16 ++++---- .../runtime}/configuration/Configuration.java | 6 +-- .../KeycloakConfigSourceProvider.java | 9 ++--- .../KeycloakPropertiesConfigSource.java | 8 ++-- .../runtime}/configuration/Messages.java | 6 +-- .../MicroProfileConfigProvider.java | 4 +- .../MicroProfileConfigProviderFactory.java | 4 +- .../configuration/PersistedConfigSource.java | 6 +-- .../configuration/PropertyMapper.java | 9 +---- .../configuration/PropertyMappers.java | 20 +++++----- .../PropertyMappingInterceptor.java | 4 +- .../configuration/SysPropConfigSource.java | 4 +- .../runtime/dev/QuarkusDevRequestFilter.java | 37 +++++++++++++++++++ .../QuarkusKeycloakSessionFactory.java | 20 +++++++++- .../QuarkusLifecycleObserver.java | 4 +- .../runtime/integration}/QuarkusPlatform.java | 8 ++-- .../ClientConnectionContextInjector.java | 29 +++++++-------- .../jaxrs}/KeycloakContextInjector.java | 29 +++++++-------- .../jaxrs}/QuarkusKeycloakApplication.java | 25 +++++++++++-- .../jaxrs}/ResteasyVertxProvider.java | 4 +- .../integration/web}/NotFoundHandler.java | 4 +- .../web}/QuarkusRequestFilter.java | 4 +- .../web}/VertxClientCertificateLookup.java | 4 +- .../VertxClientCertificateLookupFactory.java | 4 +- .../health/KeycloakMetricsHandler.java | 2 +- .../health/KeycloakReadyHealthCheck.java | 2 +- .../resources/QuarkusWelcomeResource.java | 5 ++- .../runtime/storage/database}/Database.java | 14 +++---- .../QuarkusJpaConnectionProviderFactory.java | 12 ++++-- .../liquibase/FastServiceLocator.java | 19 +++++++++- .../database}/liquibase/KeycloakLogger.java | 19 +++++++++- .../liquibase/QuarkusJpaUpdaterProvider.java | 4 +- .../QuarkusJpaUpdaterProviderFactory.java | 4 +- .../QuarkusLiquibaseConnectionProvider.java | 4 +- .../QuarkusCacheManagerProvider.java | 6 +-- .../QuarkusInfinispanConnectionFactory.java | 2 +- .../QuarkusJtaTransactionManagerLookup.java | 5 ++- ...io.smallrye.config.ConfigSourceInterceptor | 2 +- ...croprofile.config.spi.ConfigSourceProvider | 2 +- ...ycloak.cluster.ManagedCacheManagerProvider | 2 +- .../org.keycloak.common.util.ResteasyProvider | 2 +- .../org.keycloak.config.ConfigProviderFactory | 2 +- ...nispan.InfinispanConnectionProviderFactory | 2 +- ...nnections.jpa.JpaConnectionProviderFactory | 2 +- ...ions.jpa.updater.JpaUpdaterProviderFactory | 2 +- ...se.conn.LiquibaseConnectionProviderFactory | 2 +- .../org.keycloak.platform.PlatformProvider | 2 +- ...es.x509.X509ClientCertificateLookupFactory | 2 +- ...ak.transaction.JtaTransactionManagerLookup | 2 +- .../provider/quarkus/ConfigurationTest.java | 8 ++-- .../quarkus/_private/IDELauncher.java | 1 - 74 files changed, 339 insertions(+), 255 deletions(-) delete mode 100644 quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/dev/QuarkusDevRequestFilter.java rename quarkus/runtime/src/main/java/org/keycloak/{util => quarkus/runtime}/Environment.java (96%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime}/InitializationException.java (91%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/KeycloakMain.java (88%) rename quarkus/runtime/src/main/java/org/keycloak/quarkus/{ => runtime}/KeycloakRecorder.java (88%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/ExecutionExceptionHandler.java (96%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/Picocli.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/SubCommandListRenderer.java (98%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/AbstractCommand.java (91%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/AbstractExportImportCommand.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/AbstractStartCommand.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/Build.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/Completion.java (96%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/Export.java (97%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/Import.java (97%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/Main.java (95%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/ShowConfig.java (90%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/Start.java (95%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/StartDev.java (92%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/cli/command/Tools.java (95%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/ConfigArgsConfigSource.java (87%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/Configuration.java (94%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/KeycloakConfigSourceProvider.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/KeycloakPropertiesConfigSource.java (94%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/Messages.java (90%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/MicroProfileConfigProvider.java (97%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/MicroProfileConfigProviderFactory.java (89%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/PersistedConfigSource.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/PropertyMapper.java (97%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/PropertyMappers.java (94%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/PropertyMappingInterceptor.java (95%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/configuration/SysPropConfigSource.java (94%) create mode 100644 quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/dev/QuarkusDevRequestFilter.java rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime/integration}/QuarkusKeycloakSessionFactory.java (83%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration}/QuarkusLifecycleObserver.java (96%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration}/QuarkusPlatform.java (96%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration/jaxrs}/ClientConnectionContextInjector.java (56%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration/jaxrs}/KeycloakContextInjector.java (55%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime/integration/jaxrs}/QuarkusKeycloakApplication.java (64%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration/jaxrs}/ResteasyVertxProvider.java (94%) rename quarkus/runtime/src/main/java/org/keycloak/{services => quarkus/runtime/integration/web}/NotFoundHandler.java (88%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration/web}/QuarkusRequestFilter.java (97%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration/web}/VertxClientCertificateLookup.java (95%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/integration/web}/VertxClientCertificateLookupFactory.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/services/health/KeycloakMetricsHandler.java (94%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/services/health/KeycloakReadyHealthCheck.java (98%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/services/resources/QuarkusWelcomeResource.java (98%) rename quarkus/runtime/src/main/java/org/keycloak/{configuration => quarkus/runtime/storage/database}/Database.java (93%) rename quarkus/runtime/src/main/java/org/keycloak/{connections => quarkus/runtime/storage/database}/jpa/QuarkusJpaConnectionProviderFactory.java (97%) rename quarkus/runtime/src/main/java/org/keycloak/{connections => quarkus/runtime/storage/database}/liquibase/FastServiceLocator.java (81%) rename quarkus/runtime/src/main/java/org/keycloak/{connections => quarkus/runtime/storage/database}/liquibase/KeycloakLogger.java (75%) rename quarkus/runtime/src/main/java/org/keycloak/{connections => quarkus/runtime/storage/database}/liquibase/QuarkusJpaUpdaterProvider.java (99%) rename quarkus/runtime/src/main/java/org/keycloak/{connections => quarkus/runtime/storage/database}/liquibase/QuarkusJpaUpdaterProviderFactory.java (92%) rename quarkus/runtime/src/main/java/org/keycloak/{connections => quarkus/runtime/storage/database}/liquibase/QuarkusLiquibaseConnectionProvider.java (98%) rename quarkus/runtime/src/main/java/org/keycloak/{provider/quarkus => quarkus/runtime/storage/infinispan}/QuarkusCacheManagerProvider.java (96%) rename quarkus/runtime/src/main/java/org/keycloak/{connections/cache => quarkus/runtime/storage/infinispan}/QuarkusInfinispanConnectionFactory.java (96%) rename quarkus/runtime/src/main/java/org/keycloak/{ => quarkus/runtime}/transaction/QuarkusJtaTransactionManagerLookup.java (92%) diff --git a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java index 07f20662ab..c1d588b148 100644 --- a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java +++ b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java @@ -17,15 +17,15 @@ package org.keycloak.quarkus.deployment; -import static org.keycloak.configuration.Configuration.getPropertyNames; -import static org.keycloak.connections.jpa.QuarkusJpaConnectionProviderFactory.QUERY_PROPERTY_PREFIX; +import static org.keycloak.quarkus.runtime.configuration.Configuration.getPropertyNames; +import static org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory.QUERY_PROPERTY_PREFIX; import static org.keycloak.connections.jpa.util.JpaUtils.loadSpecificNamedQueries; -import static org.keycloak.configuration.MicroProfileConfigProvider.NS_KEYCLOAK; +import static org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider.NS_KEYCLOAK; import static org.keycloak.representations.provider.ScriptProviderDescriptor.AUTHENTICATORS; import static org.keycloak.representations.provider.ScriptProviderDescriptor.MAPPERS; import static org.keycloak.representations.provider.ScriptProviderDescriptor.POLICIES; -import static org.keycloak.util.Environment.CLI_ARGS; -import static org.keycloak.util.Environment.getProviderFiles; +import static org.keycloak.quarkus.runtime.Environment.CLI_ARGS; +import static org.keycloak.quarkus.runtime.Environment.getProviderFiles; import javax.persistence.Entity; import javax.persistence.spi.PersistenceUnitTransactionType; @@ -77,16 +77,16 @@ import org.jboss.logging.Logger; import org.jboss.resteasy.plugins.server.servlet.ResteasyContextParameters; import org.jboss.resteasy.spi.ResteasyDeployment; import org.keycloak.Config; -import org.keycloak.QuarkusKeycloakApplication; +import org.keycloak.quarkus.runtime.integration.jaxrs.QuarkusKeycloakApplication; import org.keycloak.authentication.AuthenticatorSpi; import org.keycloak.authentication.authenticators.browser.DeployedScriptAuthenticatorFactory; import org.keycloak.authorization.policy.provider.PolicySpi; import org.keycloak.authorization.policy.provider.js.DeployedScriptPolicyFactory; import org.keycloak.common.Profile; import org.keycloak.common.util.StreamUtil; -import org.keycloak.configuration.Configuration; -import org.keycloak.configuration.KeycloakConfigSourceProvider; -import org.keycloak.configuration.MicroProfileConfigProvider; +import org.keycloak.quarkus.runtime.configuration.Configuration; +import org.keycloak.quarkus.runtime.configuration.KeycloakConfigSourceProvider; +import org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider; import org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory; import org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProviderFactory; import org.keycloak.connections.jpa.updater.liquibase.conn.DefaultLiquibaseConnectionProvider; @@ -98,9 +98,9 @@ import org.keycloak.provider.Provider; import org.keycloak.provider.ProviderFactory; import org.keycloak.provider.ProviderManager; import org.keycloak.provider.Spi; -import org.keycloak.provider.quarkus.QuarkusRequestFilter; -import org.keycloak.provider.quarkus.dev.QuarkusDevRequestFilter; -import org.keycloak.quarkus.KeycloakRecorder; +import org.keycloak.quarkus.runtime.integration.web.QuarkusRequestFilter; +import org.keycloak.quarkus.runtime.dev.QuarkusDevRequestFilter; +import org.keycloak.quarkus.runtime.KeycloakRecorder; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; @@ -110,11 +110,11 @@ import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.vertx.http.deployment.FilterBuildItem; import org.keycloak.representations.provider.ScriptProviderDescriptor; import org.keycloak.representations.provider.ScriptProviderMetadata; -import org.keycloak.services.NotFoundHandler; +import org.keycloak.quarkus.runtime.integration.web.NotFoundHandler; import org.keycloak.services.ServicesLogger; -import org.keycloak.services.health.KeycloakMetricsHandler; +import org.keycloak.quarkus.runtime.services.health.KeycloakMetricsHandler; import org.keycloak.transaction.JBossJtaTransactionManagerLookup; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; import org.keycloak.util.JsonSerialization; class KeycloakProcessor { @@ -251,7 +251,7 @@ class KeycloakProcessor { *

Make the build time configuration available at runtime so that the server can run without having to specify some of * the properties again. * - *

This build step also adds a static call to {@link org.keycloak.cli.ShowConfigCommand#run} via the recorder + *

This build step also adds a static call to {@link org.keycloak.quarkus.runtime.cli.ShowConfigCommand#run} via the recorder * so that the configuration can be shown when requested. * * @param recorder the recorder @@ -327,7 +327,7 @@ class KeycloakProcessor { * running in a different thread than the worker thread started by {@link QuarkusRequestFilter}. * See https://github.com/quarkusio/quarkus/issues/12990. * - *

By doing this, custom health checks such as {@link org.keycloak.services.health.KeycloakReadyHealthCheck} is + *

By doing this, custom health checks such as {@link org.keycloak.quarkus.runtime.services.health.KeycloakReadyHealthCheck} is * executed within an active {@link org.keycloak.models.KeycloakSession}, making possible to use it when calculating the * status. * diff --git a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/LiquibaseProcessor.java b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/LiquibaseProcessor.java index d1258dfced..c7a82d0bdf 100644 --- a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/LiquibaseProcessor.java +++ b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/LiquibaseProcessor.java @@ -17,7 +17,7 @@ import org.jboss.jandex.IndexView; import org.keycloak.connections.jpa.updater.liquibase.lock.CustomInsertLockRecordGenerator; import org.keycloak.connections.jpa.updater.liquibase.lock.CustomLockDatabaseChangeLogGenerator; import org.keycloak.connections.jpa.updater.liquibase.lock.DummyLockService; -import org.keycloak.connections.liquibase.KeycloakLogger; +import org.keycloak.quarkus.runtime.storage.database.liquibase.KeycloakLogger; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.ExecutionTime; @@ -29,7 +29,7 @@ import liquibase.parser.ChangeLogParser; import liquibase.parser.core.xml.XMLChangeLogSAXParser; import liquibase.servicelocator.LiquibaseService; import liquibase.sqlgenerator.SqlGenerator; -import org.keycloak.quarkus.KeycloakRecorder; +import org.keycloak.quarkus.runtime.KeycloakRecorder; class LiquibaseProcessor { @@ -88,7 +88,7 @@ class LiquibaseProcessor { private void filterImplementations(Class types, Set classes) { if (Database.class.equals(types)) { // removes unsupported databases - classes.removeIf(classInfo -> !org.keycloak.configuration.Database.isSupported(classInfo.name().toString())); + classes.removeIf(classInfo -> !org.keycloak.quarkus.runtime.storage.database.Database.isSupported(classInfo.name().toString())); } } } diff --git a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/isReAugmentation.java b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/isReAugmentation.java index d0c416bdcb..f97c8a444f 100644 --- a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/isReAugmentation.java +++ b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/isReAugmentation.java @@ -18,7 +18,7 @@ package org.keycloak.quarkus.deployment; import java.util.function.BooleanSupplier; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; public class isReAugmentation implements BooleanSupplier { diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/dev/QuarkusDevRequestFilter.java b/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/dev/QuarkusDevRequestFilter.java deleted file mode 100644 index 1b172b7636..0000000000 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/dev/QuarkusDevRequestFilter.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.keycloak.provider.quarkus.dev; - -import io.vertx.ext.web.RoutingContext; -import org.keycloak.provider.quarkus.QuarkusRequestFilter; - -/** - * @author Pedro Igor - */ -public class QuarkusDevRequestFilter extends QuarkusRequestFilter { - - @Override - public void handle(RoutingContext context) { - if (context.request().uri().startsWith("/q/")) { - // do not go through Keycloak request filter if serving Quarkus resources such as dev console - context.next(); - return; - } - super.handle(context); - } -} diff --git a/quarkus/runtime/src/main/java/org/keycloak/util/Environment.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Environment.java similarity index 96% rename from quarkus/runtime/src/main/java/org/keycloak/util/Environment.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Environment.java index c0a69e7d71..d6afdaa673 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/util/Environment.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Environment.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.util; +package org.keycloak.quarkus.runtime; import java.io.File; import java.io.FilenameFilter; @@ -31,7 +31,7 @@ import java.util.stream.Collectors; import io.quarkus.runtime.LaunchMode; import io.quarkus.runtime.configuration.ProfileManager; import org.apache.commons.lang3.SystemUtils; -import org.keycloak.configuration.Configuration; +import org.keycloak.quarkus.runtime.configuration.Configuration; public final class Environment { diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/InitializationException.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/InitializationException.java similarity index 91% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/InitializationException.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/InitializationException.java index a2d17178a0..64539cba4c 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/InitializationException.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/InitializationException.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -13,10 +13,9 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime; /** * Exception thrown when some error happens during initialization of Quarkus platform. Usually due the incorrect configuration of basic stuff (DB, HTTP protocol etc) diff --git a/quarkus/runtime/src/main/java/org/keycloak/KeycloakMain.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakMain.java similarity index 88% rename from quarkus/runtime/src/main/java/org/keycloak/KeycloakMain.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakMain.java index 15a40656c8..f92badbcb6 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/KeycloakMain.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakMain.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.keycloak; +package org.keycloak.quarkus.runtime; -import static org.keycloak.cli.Picocli.error; -import static org.keycloak.cli.Picocli.parseAndRun; -import static org.keycloak.util.Environment.getProfileOrDefault; +import static org.keycloak.quarkus.runtime.cli.Picocli.error; +import static org.keycloak.quarkus.runtime.cli.Picocli.parseAndRun; +import static org.keycloak.quarkus.runtime.Environment.getProfileOrDefault; import java.io.PrintWriter; import java.util.ArrayList; @@ -29,14 +29,12 @@ import java.util.List; import io.quarkus.runtime.ApplicationLifecycleManager; import io.quarkus.runtime.Quarkus; -import org.keycloak.cli.Picocli; +import org.keycloak.quarkus.runtime.cli.Picocli; import org.keycloak.common.Version; import io.quarkus.runtime.QuarkusApplication; import io.quarkus.runtime.annotations.QuarkusMain; -import org.keycloak.util.Environment; - /** *

The main entry point, responsible for initialize and run the CLI as well as start the server. */ diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/KeycloakRecorder.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakRecorder.java similarity index 88% rename from quarkus/runtime/src/main/java/org/keycloak/quarkus/KeycloakRecorder.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakRecorder.java index dbf233e102..64999eebc9 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/KeycloakRecorder.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/KeycloakRecorder.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,19 +15,19 @@ * limitations under the License. */ -package org.keycloak.quarkus; +package org.keycloak.quarkus.runtime; -import static org.keycloak.configuration.Configuration.getBuiltTimeProperty; +import static org.keycloak.quarkus.runtime.configuration.Configuration.getBuiltTimeProperty; import java.util.List; import java.util.Map; import org.jboss.logging.Logger; -import org.keycloak.QuarkusKeycloakSessionFactory; import org.keycloak.common.Profile; -import org.keycloak.configuration.Configuration; -import org.keycloak.connections.liquibase.FastServiceLocator; -import org.keycloak.connections.liquibase.KeycloakLogger; +import org.keycloak.quarkus.runtime.configuration.Configuration; +import org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory; +import org.keycloak.quarkus.runtime.storage.database.liquibase.FastServiceLocator; +import org.keycloak.quarkus.runtime.storage.database.liquibase.KeycloakLogger; import org.keycloak.provider.Provider; import org.keycloak.provider.ProviderFactory; import org.keycloak.provider.Spi; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/ExecutionExceptionHandler.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/ExecutionExceptionHandler.java similarity index 96% rename from quarkus/runtime/src/main/java/org/keycloak/cli/ExecutionExceptionHandler.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/ExecutionExceptionHandler.java index a958a49681..b366309a2d 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/ExecutionExceptionHandler.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/ExecutionExceptionHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.cli; +package org.keycloak.quarkus.runtime.cli; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/Picocli.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/cli/Picocli.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java index 657183a9ae..069244860a 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/Picocli.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/Picocli.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.keycloak.cli; +package org.keycloak.quarkus.runtime.cli; import static java.util.Arrays.asList; -import static org.keycloak.cli.command.AbstractStartCommand.AUTO_BUILD_OPTION; -import static org.keycloak.configuration.Configuration.getConfig; -import static org.keycloak.configuration.PropertyMappers.isBuildTimeProperty; -import static org.keycloak.util.Environment.isDevMode; +import static org.keycloak.quarkus.runtime.cli.command.AbstractStartCommand.AUTO_BUILD_OPTION; +import static org.keycloak.quarkus.runtime.configuration.Configuration.getConfig; +import static org.keycloak.quarkus.runtime.configuration.PropertyMappers.isBuildTimeProperty; +import static org.keycloak.quarkus.runtime.Environment.isDevMode; import static picocli.CommandLine.Model.UsageMessageSpec.SECTION_KEY_COMMAND_LIST; import java.io.File; @@ -41,18 +41,18 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import org.jboss.logging.Logger; -import org.keycloak.cli.command.Build; -import org.keycloak.cli.command.Main; -import org.keycloak.cli.command.Start; -import org.keycloak.cli.command.StartDev; +import org.keycloak.quarkus.runtime.cli.command.Build; +import org.keycloak.quarkus.runtime.cli.command.Main; +import org.keycloak.quarkus.runtime.cli.command.Start; +import org.keycloak.quarkus.runtime.cli.command.StartDev; import org.keycloak.common.Profile; -import org.keycloak.configuration.KeycloakConfigSourceProvider; -import org.keycloak.configuration.PropertyMapper; -import org.keycloak.configuration.PropertyMappers; +import org.keycloak.quarkus.runtime.configuration.KeycloakConfigSourceProvider; +import org.keycloak.quarkus.runtime.configuration.PropertyMapper; +import org.keycloak.quarkus.runtime.configuration.PropertyMappers; import org.keycloak.platform.Platform; -import org.keycloak.provider.quarkus.InitializationException; -import org.keycloak.provider.quarkus.QuarkusPlatform; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.InitializationException; +import org.keycloak.quarkus.runtime.integration.QuarkusPlatform; +import org.keycloak.quarkus.runtime.Environment; import picocli.CommandLine; public final class Picocli { diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/SubCommandListRenderer.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/SubCommandListRenderer.java similarity index 98% rename from quarkus/runtime/src/main/java/org/keycloak/cli/SubCommandListRenderer.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/SubCommandListRenderer.java index 55bca2c5f3..359f16b0cc 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/SubCommandListRenderer.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/SubCommandListRenderer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.cli; +package org.keycloak.quarkus.runtime.cli; import java.util.Collection; import java.util.Map; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractCommand.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractCommand.java similarity index 91% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractCommand.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractCommand.java index 675edf8fb7..d6a02d5d0c 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractCommand.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractCommand.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractExportImportCommand.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractExportImportCommand.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractExportImportCommand.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractExportImportCommand.java index 8790ad844a..ff3c689481 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractExportImportCommand.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractExportImportCommand.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; -import static org.keycloak.cli.Picocli.error; +import static org.keycloak.quarkus.runtime.cli.Picocli.error; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractStartCommand.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractStartCommand.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractStartCommand.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractStartCommand.java index 2110a0e0ab..cfd52c5017 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/AbstractStartCommand.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/AbstractStartCommand.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; -import org.keycloak.KeycloakMain; +import org.keycloak.quarkus.runtime.KeycloakMain; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Build.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Build.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/Build.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Build.java index 0489b28724..4a5eb79c3c 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Build.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Build.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; -import static org.keycloak.cli.Picocli.error; -import static org.keycloak.cli.Picocli.println; +import static org.keycloak.quarkus.runtime.cli.Picocli.error; +import static org.keycloak.quarkus.runtime.cli.Picocli.println; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; import io.quarkus.bootstrap.runner.QuarkusEntryPoint; import io.quarkus.bootstrap.runner.RunnerClassLoader; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Completion.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Completion.java similarity index 96% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/Completion.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Completion.java index 483856f170..faa9a37b4f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Completion.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Completion.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; import picocli.AutoComplete; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Export.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Export.java similarity index 97% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/Export.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Export.java index fbd48d557d..8732a4da28 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Export.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Export.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; import static org.keycloak.exportimport.ExportImportConfig.ACTION_EXPORT; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Import.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Import.java similarity index 97% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/Import.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Import.java index 873fec54a6..0b9868a73a 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Import.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Import.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; import static org.keycloak.exportimport.ExportImportConfig.ACTION_IMPORT; import static org.keycloak.exportimport.Strategy.IGNORE_EXISTING; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Main.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Main.java similarity index 95% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/Main.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Main.java index 67675d8191..15a41df465 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Main.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Main.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; -import org.keycloak.configuration.KeycloakConfigSourceProvider; +import org.keycloak.quarkus.runtime.configuration.KeycloakConfigSourceProvider; import picocli.CommandLine; import picocli.CommandLine.Command; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/ShowConfig.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/ShowConfig.java similarity index 90% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/ShowConfig.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/ShowConfig.java index 4f1f87ba60..3933aa44f2 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/ShowConfig.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/ShowConfig.java @@ -15,14 +15,14 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; import static java.lang.Boolean.parseBoolean; -import static org.keycloak.configuration.Configuration.getConfigValue; -import static org.keycloak.configuration.Configuration.getPropertyNames; -import static org.keycloak.configuration.PropertyMappers.canonicalFormat; -import static org.keycloak.configuration.PropertyMappers.formatValue; -import static org.keycloak.util.Environment.getBuiltTimeProperty; +import static org.keycloak.quarkus.runtime.configuration.Configuration.getConfigValue; +import static org.keycloak.quarkus.runtime.configuration.Configuration.getPropertyNames; +import static org.keycloak.quarkus.runtime.configuration.PropertyMappers.canonicalFormat; +import static org.keycloak.quarkus.runtime.configuration.PropertyMappers.formatValue; +import static org.keycloak.quarkus.runtime.Environment.getBuiltTimeProperty; import java.util.HashSet; import java.util.Map; @@ -31,10 +31,10 @@ import java.util.function.BiConsumer; import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.StreamSupport; -import org.keycloak.configuration.MicroProfileConfigProvider; -import org.keycloak.configuration.PersistedConfigSource; -import org.keycloak.configuration.PropertyMappers; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider; +import org.keycloak.quarkus.runtime.configuration.PersistedConfigSource; +import org.keycloak.quarkus.runtime.configuration.PropertyMappers; +import org.keycloak.quarkus.runtime.Environment; import io.smallrye.config.ConfigValue; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Start.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Start.java similarity index 95% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/Start.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Start.java index 0c80ca8b6b..2bea0f20d0 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Start.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Start.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/StartDev.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/StartDev.java similarity index 92% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/StartDev.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/StartDev.java index df475b468a..3dab2de85d 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/StartDev.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/StartDev.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Tools.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Tools.java similarity index 95% rename from quarkus/runtime/src/main/java/org/keycloak/cli/command/Tools.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Tools.java index 717b37bc13..e909ebf1a7 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/cli/command/Tools.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/cli/command/Tools.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.cli.command; +package org.keycloak.quarkus.runtime.cli.command; import picocli.CommandLine; diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/ConfigArgsConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java similarity index 87% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/ConfigArgsConfigSource.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java index 09f8130827..dd52a6feb1 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/ConfigArgsConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/ConfigArgsConfigSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; -import static org.keycloak.cli.Picocli.ARG_KEY_VALUE_SPLIT; -import static org.keycloak.cli.Picocli.ARG_PREFIX; -import static org.keycloak.cli.Picocli.ARG_SPLIT; -import static org.keycloak.configuration.MicroProfileConfigProvider.NS_KEYCLOAK_PREFIX; -import static org.keycloak.configuration.MicroProfileConfigProvider.NS_QUARKUS_PREFIX; +import static org.keycloak.quarkus.runtime.cli.Picocli.ARG_KEY_VALUE_SPLIT; +import static org.keycloak.quarkus.runtime.cli.Picocli.ARG_PREFIX; +import static org.keycloak.quarkus.runtime.cli.Picocli.ARG_SPLIT; +import static org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider.NS_KEYCLOAK_PREFIX; +import static org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider.NS_QUARKUS_PREFIX; import java.util.Collections; import java.util.HashMap; @@ -31,7 +31,7 @@ import java.util.regex.Pattern; import org.jboss.logging.Logger; import io.smallrye.config.PropertiesConfigSource; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; /** *

A configuration source for mapping configuration arguments to their corresponding properties so that they can be recognized diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/Configuration.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java similarity index 94% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/Configuration.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java index 294bdd94f3..839640586e 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/Configuration.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Configuration.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; import java.util.Optional; import java.util.function.Function; @@ -23,7 +23,7 @@ import java.util.function.Function; import io.smallrye.config.ConfigValue; import io.smallrye.config.SmallRyeConfig; import io.smallrye.config.SmallRyeConfigProviderResolver; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; /** * The entry point for accessing the server configuration diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/KeycloakConfigSourceProvider.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakConfigSourceProvider.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/KeycloakConfigSourceProvider.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakConfigSourceProvider.java index eeb78af97f..7550d2b779 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/KeycloakConfigSourceProvider.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakConfigSourceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; -import static org.keycloak.configuration.MicroProfileConfigProvider.NS_KEYCLOAK_PREFIX; +import static org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider.NS_KEYCLOAK_PREFIX; import java.io.File; import java.nio.file.Path; @@ -28,8 +28,7 @@ import java.util.List; import org.eclipse.microprofile.config.spi.ConfigSource; import org.eclipse.microprofile.config.spi.ConfigSourceProvider; import org.jboss.logging.Logger; -import org.keycloak.platform.Platform; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; public class KeycloakConfigSourceProvider implements ConfigSourceProvider { diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/KeycloakPropertiesConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java similarity index 94% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/KeycloakPropertiesConfigSource.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java index 79af4c7d88..eb9e466ddc 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/KeycloakPropertiesConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/KeycloakPropertiesConfigSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; import java.io.Closeable; import java.io.FileNotFoundException; @@ -36,8 +36,8 @@ import org.jboss.logging.Logger; import io.smallrye.config.PropertiesConfigSource; import static org.keycloak.common.util.StringPropertyReplacer.replaceProperties; -import static org.keycloak.configuration.MicroProfileConfigProvider.NS_KEYCLOAK; -import static org.keycloak.configuration.MicroProfileConfigProvider.NS_QUARKUS; +import static org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider.NS_KEYCLOAK; +import static org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider.NS_QUARKUS; /** * A configuration source for {@code keycloak.properties}. diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/Messages.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Messages.java similarity index 90% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/Messages.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Messages.java index 6e9eb99816..e57145af01 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/Messages.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/Messages.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; public final class Messages { diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/MicroProfileConfigProvider.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/MicroProfileConfigProvider.java similarity index 97% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/MicroProfileConfigProvider.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/MicroProfileConfigProvider.java index 9587ac01c4..26f54895f5 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/MicroProfileConfigProvider.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/MicroProfileConfigProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; import org.apache.commons.lang3.ArrayUtils; import org.eclipse.microprofile.config.ConfigProvider; diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/MicroProfileConfigProviderFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/MicroProfileConfigProviderFactory.java similarity index 89% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/MicroProfileConfigProviderFactory.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/MicroProfileConfigProviderFactory.java index 466ae16ca6..1334bca132 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/MicroProfileConfigProviderFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/MicroProfileConfigProviderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; import java.util.Optional; diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/PersistedConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PersistedConfigSource.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/PersistedConfigSource.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PersistedConfigSource.java index 4f96d3eb57..9bf8420268 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/PersistedConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PersistedConfigSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; import java.io.File; import java.io.IOException; @@ -25,7 +25,7 @@ import java.util.Map; import io.smallrye.config.PropertiesConfigSource; import io.smallrye.config.common.utils.ConfigSourceUtil; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; /** * A {@link org.eclipse.microprofile.config.spi.ConfigSource} based on the configuration properties persisted into the server diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMapper.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMapper.java similarity index 97% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMapper.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMapper.java index 2e4940e7bf..3ccdf6751f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMapper.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -14,16 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; -import static org.keycloak.util.Environment.getBuiltTimeProperty; - -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.List; import java.util.Map; -import java.util.Set; import java.util.function.BiFunction; import java.util.function.Supplier; diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMappers.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappers.java similarity index 94% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMappers.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappers.java index 0587979e67..4a10e1dcf9 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMappers.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappers.java @@ -1,5 +1,5 @@ /* - * Copyright 202 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -14,14 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; -import static org.keycloak.configuration.Messages.invalidDatabaseVendor; -import static org.keycloak.configuration.PropertyMapper.MAPPERS; -import static org.keycloak.configuration.PropertyMapper.create; -import static org.keycloak.configuration.PropertyMapper.createWithDefault; -import static org.keycloak.configuration.PropertyMapper.createBuildTimeProperty; -import static org.keycloak.provider.quarkus.QuarkusPlatform.addInitializationException; +import static org.keycloak.quarkus.runtime.configuration.Messages.invalidDatabaseVendor; +import static org.keycloak.quarkus.runtime.configuration.PropertyMapper.MAPPERS; +import static org.keycloak.quarkus.runtime.configuration.PropertyMapper.create; +import static org.keycloak.quarkus.runtime.configuration.PropertyMapper.createWithDefault; +import static org.keycloak.quarkus.runtime.configuration.PropertyMapper.createBuildTimeProperty; +import static org.keycloak.quarkus.runtime.integration.QuarkusPlatform.addInitializationException; import java.io.File; import java.nio.file.Paths; @@ -33,7 +33,9 @@ import java.util.stream.Collectors; import io.smallrye.config.ConfigSourceInterceptorContext; import io.smallrye.config.ConfigValue; -import org.keycloak.util.Environment; + +import org.keycloak.quarkus.runtime.storage.database.Database; +import org.keycloak.quarkus.runtime.Environment; /** * Configures the {@link PropertyMapper} instances for all Keycloak configuration properties that should be mapped to their diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMappingInterceptor.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappingInterceptor.java similarity index 95% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMappingInterceptor.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappingInterceptor.java index 9e9e70c7fd..8cd89b5ca2 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/PropertyMappingInterceptor.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/PropertyMappingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; import io.smallrye.config.ConfigSourceInterceptor; import io.smallrye.config.ConfigSourceInterceptorContext; diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/SysPropConfigSource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/SysPropConfigSource.java similarity index 94% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/SysPropConfigSource.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/SysPropConfigSource.java index 94675d7f22..c3472a7052 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/SysPropConfigSource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/configuration/SysPropConfigSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.configuration; import java.util.Map; import java.util.Set; diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/dev/QuarkusDevRequestFilter.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/dev/QuarkusDevRequestFilter.java new file mode 100644 index 0000000000..a3d0834c40 --- /dev/null +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/dev/QuarkusDevRequestFilter.java @@ -0,0 +1,37 @@ +/* + * Copyright 2021 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.keycloak.quarkus.runtime.dev; + +import io.vertx.ext.web.RoutingContext; +import org.keycloak.quarkus.runtime.integration.web.QuarkusRequestFilter; + +/** + * @author Pedro Igor + */ +public class QuarkusDevRequestFilter extends QuarkusRequestFilter { + + @Override + public void handle(RoutingContext context) { + if (context.request().uri().startsWith("/q/")) { + // do not go through Keycloak request filter if serving Quarkus resources such as dev console + context.next(); + return; + } + super.handle(context); + } +} diff --git a/quarkus/runtime/src/main/java/org/keycloak/QuarkusKeycloakSessionFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusKeycloakSessionFactory.java similarity index 83% rename from quarkus/runtime/src/main/java/org/keycloak/QuarkusKeycloakSessionFactory.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusKeycloakSessionFactory.java index b99e47b015..d2fcb761e0 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/QuarkusKeycloakSessionFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusKeycloakSessionFactory.java @@ -1,10 +1,28 @@ -package org.keycloak; +/* + * Copyright 2021 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.keycloak.quarkus.runtime.integration; import java.util.Collections; import java.util.HashMap; import java.util.Map; import org.jboss.logging.Logger; +import org.keycloak.Config; import org.keycloak.provider.Provider; import org.keycloak.provider.ProviderFactory; import org.keycloak.provider.ProviderManagerRegistry; diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusLifecycleObserver.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusLifecycleObserver.java similarity index 96% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusLifecycleObserver.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusLifecycleObserver.java index c0226a5af9..f3a6e8619c 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusLifecycleObserver.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusLifecycleObserver.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration; import io.quarkus.runtime.ShutdownEvent; import io.quarkus.runtime.StartupEvent; diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusPlatform.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusPlatform.java similarity index 96% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusPlatform.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusPlatform.java index daf41d6880..0f716c2c94 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusPlatform.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/QuarkusPlatform.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,13 +15,12 @@ * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.attribute.FileAttribute; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicBoolean; @@ -29,7 +28,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import org.jboss.logging.Logger; import org.keycloak.platform.Platform; import org.keycloak.platform.PlatformProvider; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.InitializationException; +import org.keycloak.quarkus.runtime.Environment; public class QuarkusPlatform implements PlatformProvider { diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/ClientConnectionContextInjector.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/ClientConnectionContextInjector.java similarity index 56% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/ClientConnectionContextInjector.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/ClientConnectionContextInjector.java index bec6e2788b..1d6a23bac0 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/ClientConnectionContextInjector.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/ClientConnectionContextInjector.java @@ -1,23 +1,21 @@ /* + * Copyright 2021 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. * - * * Copyright 2021 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration.jaxrs; import javax.ws.rs.ext.Provider; import java.lang.annotation.Annotation; @@ -26,6 +24,7 @@ import java.lang.reflect.Type; import org.jboss.resteasy.spi.ContextInjector; import org.keycloak.common.ClientConnection; import org.keycloak.common.util.Resteasy; +import org.keycloak.quarkus.runtime.integration.web.QuarkusRequestFilter; /** *

This {@link ContextInjector} allows injecting {@link ClientConnection} to JAX-RS resources. diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/KeycloakContextInjector.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/KeycloakContextInjector.java similarity index 55% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/KeycloakContextInjector.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/KeycloakContextInjector.java index 35029f7425..a393834497 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/KeycloakContextInjector.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/KeycloakContextInjector.java @@ -1,23 +1,21 @@ /* + * Copyright 2021 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. * - * * Copyright 2021 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration.jaxrs; import javax.ws.rs.ext.Provider; import java.lang.annotation.Annotation; @@ -26,6 +24,7 @@ import java.lang.reflect.Type; import org.jboss.resteasy.spi.ContextInjector; import org.keycloak.common.util.Resteasy; import org.keycloak.models.KeycloakSession; +import org.keycloak.quarkus.runtime.integration.web.QuarkusRequestFilter; /** *

This {@link ContextInjector} allows injecting {@link KeycloakSession} to JAX-RS resources. diff --git a/quarkus/runtime/src/main/java/org/keycloak/QuarkusKeycloakApplication.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/QuarkusKeycloakApplication.java similarity index 64% rename from quarkus/runtime/src/main/java/org/keycloak/QuarkusKeycloakApplication.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/QuarkusKeycloakApplication.java index 9e0e7e2284..a62bd5d264 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/QuarkusKeycloakApplication.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/QuarkusKeycloakApplication.java @@ -1,4 +1,21 @@ -package org.keycloak; +/* + * Copyright 2021 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.keycloak.quarkus.runtime.integration.jaxrs; import java.util.Set; import java.util.stream.Collectors; @@ -9,9 +26,10 @@ import javax.persistence.EntityManagerFactory; import javax.ws.rs.ApplicationPath; import org.keycloak.models.utils.PostMigrationEvent; -import org.keycloak.provider.quarkus.QuarkusPlatform; +import org.keycloak.quarkus.runtime.integration.QuarkusKeycloakSessionFactory; +import org.keycloak.quarkus.runtime.integration.QuarkusPlatform; import org.keycloak.services.resources.KeycloakApplication; -import org.keycloak.services.resources.QuarkusWelcomeResource; +import org.keycloak.quarkus.runtime.services.resources.QuarkusWelcomeResource; import org.keycloak.services.resources.WelcomeResource; @ApplicationPath("/") @@ -42,6 +60,7 @@ public class QuarkusKeycloakApplication extends KeycloakApplication { .collect(Collectors.toSet()); singletons.add(new QuarkusWelcomeResource()); + singletons.add(new QuarkusWelcomeResource()); return singletons; } diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/ResteasyVertxProvider.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/ResteasyVertxProvider.java similarity index 94% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/ResteasyVertxProvider.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/ResteasyVertxProvider.java index ffb3dbf1d7..0382c3b20e 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/ResteasyVertxProvider.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/jaxrs/ResteasyVertxProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration.jaxrs; import io.vertx.ext.web.RoutingContext; import org.jboss.resteasy.core.ResteasyContext; diff --git a/quarkus/runtime/src/main/java/org/keycloak/services/NotFoundHandler.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/NotFoundHandler.java similarity index 88% rename from quarkus/runtime/src/main/java/org/keycloak/services/NotFoundHandler.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/NotFoundHandler.java index 8ff3b5cf9e..660cdc46b9 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/services/NotFoundHandler.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/NotFoundHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.services; +package org.keycloak.quarkus.runtime.integration.web; import io.vertx.core.Handler; import io.vertx.ext.web.RoutingContext; diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusRequestFilter.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/QuarkusRequestFilter.java similarity index 97% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusRequestFilter.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/QuarkusRequestFilter.java index e726176591..19a2735aab 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusRequestFilter.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/QuarkusRequestFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration.web; import org.keycloak.common.ClientConnection; import org.keycloak.models.KeycloakSession; diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/VertxClientCertificateLookup.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/VertxClientCertificateLookup.java similarity index 95% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/VertxClientCertificateLookup.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/VertxClientCertificateLookup.java index cb0090dc67..2b0341061a 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/VertxClientCertificateLookup.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/VertxClientCertificateLookup.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration.web; import java.security.cert.X509Certificate; diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/VertxClientCertificateLookupFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/VertxClientCertificateLookupFactory.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/VertxClientCertificateLookupFactory.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/VertxClientCertificateLookupFactory.java index 96dd705b86..47b4d2e2c5 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/VertxClientCertificateLookupFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/integration/web/VertxClientCertificateLookupFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.integration.web; import org.keycloak.Config; import org.keycloak.models.KeycloakSession; diff --git a/quarkus/runtime/src/main/java/org/keycloak/services/health/KeycloakMetricsHandler.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/health/KeycloakMetricsHandler.java similarity index 94% rename from quarkus/runtime/src/main/java/org/keycloak/services/health/KeycloakMetricsHandler.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/health/KeycloakMetricsHandler.java index 4c8a193c72..3d65e17b50 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/services/health/KeycloakMetricsHandler.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/health/KeycloakMetricsHandler.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.services.health; +package org.keycloak.quarkus.runtime.services.health; import io.quarkus.smallrye.metrics.runtime.SmallRyeMetricsHandler; diff --git a/quarkus/runtime/src/main/java/org/keycloak/services/health/KeycloakReadyHealthCheck.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/health/KeycloakReadyHealthCheck.java similarity index 98% rename from quarkus/runtime/src/main/java/org/keycloak/services/health/KeycloakReadyHealthCheck.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/health/KeycloakReadyHealthCheck.java index 4ddfd59664..2f04554cf8 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/services/health/KeycloakReadyHealthCheck.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/health/KeycloakReadyHealthCheck.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.keycloak.services.health; +package org.keycloak.quarkus.runtime.services.health; import io.agroal.api.AgroalDataSource; import io.quarkus.agroal.runtime.health.DataSourceHealthCheck; diff --git a/quarkus/runtime/src/main/java/org/keycloak/services/resources/QuarkusWelcomeResource.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/resources/QuarkusWelcomeResource.java similarity index 98% rename from quarkus/runtime/src/main/java/org/keycloak/services/resources/QuarkusWelcomeResource.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/resources/QuarkusWelcomeResource.java index b208ebe0be..d8d4905e1b 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/services/resources/QuarkusWelcomeResource.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/services/resources/QuarkusWelcomeResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.keycloak.services.resources; +package org.keycloak.quarkus.runtime.services.resources; import org.jboss.logging.Logger; import org.jboss.resteasy.spi.HttpRequest; @@ -27,6 +27,7 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.services.ForbiddenException; import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.ApplianceBootstrap; +import org.keycloak.services.resources.WelcomeResource; import org.keycloak.services.util.CacheControlUtil; import org.keycloak.services.util.CookieHelper; import org.keycloak.theme.FreeMarkerUtil; diff --git a/quarkus/runtime/src/main/java/org/keycloak/configuration/Database.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/Database.java similarity index 93% rename from quarkus/runtime/src/main/java/org/keycloak/configuration/Database.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/Database.java index 372cdd4d80..ca1b6430ba 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/configuration/Database.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/Database.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.configuration; +package org.keycloak.quarkus.runtime.storage.database; import java.io.File; import java.util.HashMap; @@ -29,7 +29,7 @@ import org.keycloak.connections.jpa.updater.liquibase.PostgresPlusDatabase; import org.keycloak.connections.jpa.updater.liquibase.UpdatedMariaDBDatabase; import org.keycloak.connections.jpa.updater.liquibase.UpdatedMySqlDatabase; -public class Database { +public final class Database { private static Map DATABASES = new HashMap<>(); @@ -47,7 +47,7 @@ public class Database { return DATABASES.containsKey(alias); } - static Optional getDatabaseKind(String alias) { + public static Optional getDatabaseKind(String alias) { Vendor vendor = DATABASES.get(alias); if (vendor == null) { @@ -57,7 +57,7 @@ public class Database { return Optional.of(vendor.databaseKind); } - static Optional getDefaultUrl(String alias) { + public static Optional getDefaultUrl(String alias) { Vendor vendor = DATABASES.get(alias); if (vendor == null) { @@ -67,7 +67,7 @@ public class Database { return Optional.of(vendor.defaultUrl.apply(alias)); } - static Optional getDriver(String alias) { + public static Optional getDriver(String alias) { Vendor vendor = DATABASES.get(alias); if (vendor == null) { @@ -77,7 +77,7 @@ public class Database { return Optional.of(vendor.driver); } - static Optional getDialect(String alias) { + public static Optional getDialect(String alias) { Vendor vendor = DATABASES.get(alias); if (vendor == null) { diff --git a/quarkus/runtime/src/main/java/org/keycloak/connections/jpa/QuarkusJpaConnectionProviderFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/jpa/QuarkusJpaConnectionProviderFactory.java similarity index 97% rename from quarkus/runtime/src/main/java/org/keycloak/connections/jpa/QuarkusJpaConnectionProviderFactory.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/jpa/QuarkusJpaConnectionProviderFactory.java index 0dd8652f9d..4330c31f25 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/connections/jpa/QuarkusJpaConnectionProviderFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/jpa/QuarkusJpaConnectionProviderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.keycloak.connections.jpa; +package org.keycloak.quarkus.runtime.storage.database.jpa; import static org.keycloak.connections.jpa.util.JpaUtils.configureNamedQuery; -import static org.keycloak.connections.liquibase.QuarkusJpaUpdaterProvider.VERIFY_AND_RUN_MASTER_CHANGELOG; +import static org.keycloak.quarkus.runtime.storage.database.liquibase.QuarkusJpaUpdaterProvider.VERIFY_AND_RUN_MASTER_CHANGELOG; import static org.keycloak.models.utils.KeycloakModelUtils.runJobInTransaction; import java.io.File; @@ -51,6 +51,10 @@ import org.jboss.logging.Logger; import org.keycloak.Config; import org.keycloak.ServerStartupError; import org.keycloak.common.Version; +import org.keycloak.connections.jpa.DefaultJpaConnectionProvider; +import org.keycloak.connections.jpa.JpaConnectionProvider; +import org.keycloak.connections.jpa.JpaConnectionProviderFactory; +import org.keycloak.connections.jpa.PersistenceExceptionConverter; import org.keycloak.connections.jpa.updater.JpaUpdaterProvider; import org.keycloak.connections.jpa.util.JpaUtils; import org.keycloak.exportimport.ExportImportManager; @@ -68,7 +72,7 @@ import org.keycloak.services.ServicesLogger; import org.keycloak.services.managers.ApplianceBootstrap; import org.keycloak.services.managers.RealmManager; import org.keycloak.transaction.JtaTransactionManagerLookup; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; import org.keycloak.util.JsonSerialization; /** diff --git a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/FastServiceLocator.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/FastServiceLocator.java similarity index 81% rename from quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/FastServiceLocator.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/FastServiceLocator.java index 1cba5c4fd7..0166ded534 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/FastServiceLocator.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/FastServiceLocator.java @@ -1,4 +1,21 @@ -package org.keycloak.connections.liquibase; +/* + * Copyright 2021 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.keycloak.quarkus.runtime.storage.database.liquibase; import java.util.HashSet; import java.util.List; diff --git a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/KeycloakLogger.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/KeycloakLogger.java similarity index 75% rename from quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/KeycloakLogger.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/KeycloakLogger.java index 45922b4734..cacec56a9f 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/KeycloakLogger.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/KeycloakLogger.java @@ -1,4 +1,21 @@ -package org.keycloak.connections.liquibase; +/* + * Copyright 2021 Red Hat, Inc. and/or its affiliates + * and other contributors as indicated by the @author tags. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.keycloak.quarkus.runtime.storage.database.liquibase; import liquibase.changelog.ChangeSet; import liquibase.changelog.DatabaseChangeLog; diff --git a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusJpaUpdaterProvider.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusJpaUpdaterProvider.java similarity index 99% rename from quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusJpaUpdaterProvider.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusJpaUpdaterProvider.java index 7ac4d78553..80cfe115f9 100755 --- a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusJpaUpdaterProvider.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusJpaUpdaterProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.connections.liquibase; +package org.keycloak.quarkus.runtime.storage.database.liquibase; import java.io.File; import java.io.FileWriter; diff --git a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusJpaUpdaterProviderFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusJpaUpdaterProviderFactory.java similarity index 92% rename from quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusJpaUpdaterProviderFactory.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusJpaUpdaterProviderFactory.java index 4e83151be0..284a8245c6 100755 --- a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusJpaUpdaterProviderFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusJpaUpdaterProviderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.connections.liquibase; +package org.keycloak.quarkus.runtime.storage.database.liquibase; import org.keycloak.Config; import org.keycloak.connections.jpa.updater.JpaUpdaterProvider; diff --git a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusLiquibaseConnectionProvider.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusLiquibaseConnectionProvider.java similarity index 98% rename from quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusLiquibaseConnectionProvider.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusLiquibaseConnectionProvider.java index 94f03da52d..091ab876e7 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/connections/liquibase/QuarkusLiquibaseConnectionProvider.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/database/liquibase/QuarkusLiquibaseConnectionProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.connections.liquibase; +package org.keycloak.quarkus.runtime.storage.database.liquibase; import java.lang.reflect.Method; import java.sql.Connection; diff --git a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/QuarkusCacheManagerProvider.java similarity index 96% rename from quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/QuarkusCacheManagerProvider.java index 2dfa701004..5b66c2d268 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/QuarkusCacheManagerProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2019 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.provider.quarkus; +package org.keycloak.quarkus.runtime.storage.infinispan; import java.net.URL; import java.nio.file.Path; @@ -29,7 +29,7 @@ import org.infinispan.manager.DefaultCacheManager; import org.jboss.logging.Logger; import org.keycloak.cluster.ManagedCacheManagerProvider; import org.keycloak.Config; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; /** * @author Pedro Igor diff --git a/quarkus/runtime/src/main/java/org/keycloak/connections/cache/QuarkusInfinispanConnectionFactory.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/QuarkusInfinispanConnectionFactory.java similarity index 96% rename from quarkus/runtime/src/main/java/org/keycloak/connections/cache/QuarkusInfinispanConnectionFactory.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/QuarkusInfinispanConnectionFactory.java index f91397d3c3..7af81465da 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/connections/cache/QuarkusInfinispanConnectionFactory.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/storage/infinispan/QuarkusInfinispanConnectionFactory.java @@ -17,7 +17,7 @@ * */ -package org.keycloak.connections.cache; +package org.keycloak.quarkus.runtime.storage.infinispan; import org.infinispan.manager.EmbeddedCacheManager; import org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory; diff --git a/quarkus/runtime/src/main/java/org/keycloak/transaction/QuarkusJtaTransactionManagerLookup.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/transaction/QuarkusJtaTransactionManagerLookup.java similarity index 92% rename from quarkus/runtime/src/main/java/org/keycloak/transaction/QuarkusJtaTransactionManagerLookup.java rename to quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/transaction/QuarkusJtaTransactionManagerLookup.java index 57aeafcf0a..96daac6834 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/transaction/QuarkusJtaTransactionManagerLookup.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/transaction/QuarkusJtaTransactionManagerLookup.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 Red Hat, Inc. and/or its affiliates + * Copyright 2021 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"); @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.keycloak.transaction; +package org.keycloak.quarkus.runtime.transaction; import javax.enterprise.inject.spi.CDI; import javax.transaction.TransactionManager; @@ -23,6 +23,7 @@ import javax.transaction.TransactionManager; import org.jboss.logging.Logger; import org.keycloak.Config; import org.keycloak.models.KeycloakSessionFactory; +import org.keycloak.transaction.JtaTransactionManagerLookup; public class QuarkusJtaTransactionManagerLookup implements JtaTransactionManagerLookup { diff --git a/quarkus/runtime/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor b/quarkus/runtime/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor index 63bab51524..2519cf50af 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor +++ b/quarkus/runtime/src/main/resources/META-INF/services/io.smallrye.config.ConfigSourceInterceptor @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.configuration.PropertyMappingInterceptor \ No newline at end of file +org.keycloak.quarkus.runtime.configuration.PropertyMappingInterceptor \ No newline at end of file diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider b/quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider index ed6b7350cf..c261346837 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.eclipse.microprofile.config.spi.ConfigSourceProvider @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.configuration.KeycloakConfigSourceProvider +org.keycloak.quarkus.runtime.configuration.KeycloakConfigSourceProvider diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.cluster.ManagedCacheManagerProvider b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.cluster.ManagedCacheManagerProvider index 9365509a2b..a0802aeb78 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.cluster.ManagedCacheManagerProvider +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.cluster.ManagedCacheManagerProvider @@ -1 +1 @@ -org.keycloak.provider.quarkus.QuarkusCacheManagerProvider \ No newline at end of file +org.keycloak.quarkus.runtime.storage.infinispan.QuarkusCacheManagerProvider \ No newline at end of file diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.common.util.ResteasyProvider b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.common.util.ResteasyProvider index 4e8e03fbe9..6d1dceba46 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.common.util.ResteasyProvider +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.common.util.ResteasyProvider @@ -1 +1 @@ -org.keycloak.provider.quarkus.ResteasyVertxProvider \ No newline at end of file +org.keycloak.quarkus.runtime.integration.jaxrs.ResteasyVertxProvider \ No newline at end of file diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.config.ConfigProviderFactory b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.config.ConfigProviderFactory index 52141b9c3c..27c532299b 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.config.ConfigProviderFactory +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.config.ConfigProviderFactory @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.configuration.MicroProfileConfigProviderFactory +org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProviderFactory diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.infinispan.InfinispanConnectionProviderFactory b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.infinispan.InfinispanConnectionProviderFactory index 5102c5b413..fec4d5c4bd 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.infinispan.InfinispanConnectionProviderFactory +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.infinispan.InfinispanConnectionProviderFactory @@ -17,4 +17,4 @@ # */ # -org.keycloak.connections.cache.QuarkusInfinispanConnectionFactory \ No newline at end of file +org.keycloak.quarkus.runtime.storage.infinispan.QuarkusInfinispanConnectionFactory \ No newline at end of file diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.JpaConnectionProviderFactory b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.JpaConnectionProviderFactory index 630760db47..71601689ff 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.JpaConnectionProviderFactory +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.JpaConnectionProviderFactory @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.connections.jpa.QuarkusJpaConnectionProviderFactory +org.keycloak.quarkus.runtime.storage.database.jpa.QuarkusJpaConnectionProviderFactory diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.JpaUpdaterProviderFactory b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.JpaUpdaterProviderFactory index 11e008eec2..6e984000de 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.JpaUpdaterProviderFactory +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.JpaUpdaterProviderFactory @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.connections.liquibase.QuarkusJpaUpdaterProviderFactory \ No newline at end of file +org.keycloak.quarkus.runtime.storage.database.liquibase.QuarkusJpaUpdaterProviderFactory \ No newline at end of file diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.liquibase.conn.LiquibaseConnectionProviderFactory b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.liquibase.conn.LiquibaseConnectionProviderFactory index 1985efd4f5..d12cc0bfe9 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.liquibase.conn.LiquibaseConnectionProviderFactory +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.connections.jpa.updater.liquibase.conn.LiquibaseConnectionProviderFactory @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.connections.liquibase.QuarkusLiquibaseConnectionProvider \ No newline at end of file +org.keycloak.quarkus.runtime.storage.database.liquibase.QuarkusLiquibaseConnectionProvider \ No newline at end of file diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.platform.PlatformProvider b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.platform.PlatformProvider index cb5b719bdc..ed631b757e 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.platform.PlatformProvider +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.platform.PlatformProvider @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.provider.quarkus.QuarkusPlatform +org.keycloak.quarkus.runtime.integration.QuarkusPlatform diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.services.x509.X509ClientCertificateLookupFactory b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.services.x509.X509ClientCertificateLookupFactory index 005aa35e75..41b7818b8a 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.services.x509.X509ClientCertificateLookupFactory +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.services.x509.X509ClientCertificateLookupFactory @@ -15,4 +15,4 @@ # limitations under the License. # # -org.keycloak.provider.quarkus.VertxClientCertificateLookupFactory +org.keycloak.quarkus.runtime.integration.web.VertxClientCertificateLookupFactory diff --git a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.transaction.JtaTransactionManagerLookup b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.transaction.JtaTransactionManagerLookup index 187c697b85..37a6dcbb69 100644 --- a/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.transaction.JtaTransactionManagerLookup +++ b/quarkus/runtime/src/main/resources/META-INF/services/org.keycloak.transaction.JtaTransactionManagerLookup @@ -15,4 +15,4 @@ # limitations under the License. # -org.keycloak.transaction.QuarkusJtaTransactionManagerLookup +org.keycloak.quarkus.runtime.transaction.QuarkusJtaTransactionManagerLookup diff --git a/quarkus/runtime/src/test/java/org/keycloak/provider/quarkus/ConfigurationTest.java b/quarkus/runtime/src/test/java/org/keycloak/provider/quarkus/ConfigurationTest.java index c34dc6209b..1b914513a2 100644 --- a/quarkus/runtime/src/test/java/org/keycloak/provider/quarkus/ConfigurationTest.java +++ b/quarkus/runtime/src/test/java/org/keycloak/provider/quarkus/ConfigurationTest.java @@ -18,7 +18,7 @@ package org.keycloak.provider.quarkus; import static org.junit.Assert.assertEquals; -import static org.keycloak.util.Environment.CLI_ARGS; +import static org.keycloak.quarkus.runtime.Environment.CLI_ARGS; import java.io.File; import java.lang.reflect.Field; @@ -36,12 +36,12 @@ import org.junit.After; import org.junit.Assert; import org.junit.Test; import org.keycloak.Config; -import org.keycloak.configuration.KeycloakConfigSourceProvider; -import org.keycloak.configuration.MicroProfileConfigProvider; +import org.keycloak.quarkus.runtime.configuration.KeycloakConfigSourceProvider; +import org.keycloak.quarkus.runtime.configuration.MicroProfileConfigProvider; import io.quarkus.runtime.configuration.ConfigUtils; import io.smallrye.config.SmallRyeConfigProviderResolver; -import org.keycloak.util.Environment; +import org.keycloak.quarkus.runtime.Environment; public class ConfigurationTest { diff --git a/quarkus/server/src/main/java/org/keycloak/quarkus/_private/IDELauncher.java b/quarkus/server/src/main/java/org/keycloak/quarkus/_private/IDELauncher.java index 64766b36bd..c1e59ff7e9 100644 --- a/quarkus/server/src/main/java/org/keycloak/quarkus/_private/IDELauncher.java +++ b/quarkus/server/src/main/java/org/keycloak/quarkus/_private/IDELauncher.java @@ -5,7 +5,6 @@ import java.util.Arrays; import java.util.List; import io.quarkus.runtime.Quarkus; -import org.keycloak.util.Environment; /** *

This main class should be used to start the server in dev mode for development purposes. By running this class,