From e572d45bea1d90a8b378fa0e8fff795e6c32e3f2 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 13 Jan 2016 14:24:31 +0100 Subject: [PATCH] KEYCLOAK-2142 Drop support to deploy server to EAP 6.4 --- distribution/adapters/pom.xml | 3 +- distribution/demo-dist/assembly.xml | 3 - distribution/demo-dist/pom.xml | 4 +- distribution/docs-dist/pom.xml | 3 +- distribution/downloads/pom.xml | 2 +- distribution/examples-dist/pom.xml | 3 +- distribution/feature-packs/pom.xml | 4 +- distribution/pom.xml | 2 +- distribution/proxy-dist/pom.xml | 3 +- distribution/saml-adapters/pom.xml | 3 +- distribution/server-dist/pom.xml | 3 +- .../server-overlay/{wildfly => }/assembly.xml | 10 - .../cli/keycloak-install-ha.cli | 8 +- .../{wildfly => }/cli/keycloak-install.cli | 2 + .../eap6/eap6-server-modules/assembly.xml | 22 - .../eap6/eap6-server-modules/build.xml | 311 --------- .../eap6/eap6-server-modules/lib.xml | 282 -------- .../eap6/eap6-server-modules/pom.xml | 141 ---- .../com/google/zxing/core/main/module.xml | 13 - .../com/google/zxing/javase/main/module.xml | 14 - .../modules/javax/ws/rs/api/2.0/module.xml | 12 - .../modules/org/bouncycastle/main/module.xml | 10 - .../modules/org/freemarker/main/module.xml | 14 - .../modules/org/jboss/aesh/0.65/module.xml | 37 -- .../keycloak-account-api/main/module.xml | 19 - .../main/module.xml | 25 - .../keycloak-broker-core/main/module.xml | 19 - .../keycloak-broker-oidc/main/module.xml | 24 - .../keycloak-broker-saml/main/module.xml | 20 - .../keycloak/keycloak-common/main/module.xml | 17 - .../main/module.xml | 22 - .../main/module.xml | 18 - .../main/module.xml | 21 - .../keycloak-connections-jpa/main/module.xml | 24 - .../main/module.xml | 19 - .../main/module.xml | 18 - .../main/module.xml | 17 - .../keycloak/keycloak-core/main/module.xml | 21 - .../main/module.xml | 47 -- .../WEB-INF/jboss-deployment-structure.xml | 72 -- .../main/server-war/WEB-INF/web.xml | 48 -- .../keycloak-email-api/main/module.xml | 18 - .../keycloak-email-freemarker/main/module.xml | 25 - .../keycloak-events-api/main/module.xml | 17 - .../keycloak-events-email/main/module.xml | 20 - .../main/module.xml | 19 - .../keycloak-events-jpa/main/module.xml | 25 - .../keycloak-events-mongo/main/module.xml | 23 - .../main/module.xml | 24 - .../main/module.xml | 25 - .../main/module.xml | 25 - .../main/module.xml | 19 - .../main/module.xml | 20 - .../main/module.xml | 20 - .../main/module.xml | 20 - .../keycloak-js-adapter/main/module.xml | 12 - .../main/module.xml | 19 - .../keycloak-ldap-federation/main/module.xml | 20 - .../keycloak-login-api/main/module.xml | 19 - .../keycloak-login-freemarker/main/module.xml | 28 - .../keycloak-model-api/main/module.xml | 17 - .../keycloak-model-jpa/main/module.xml | 22 - .../keycloak-model-mongo/main/module.xml | 19 - .../main/module.xml | 19 - .../keycloak-saml-core/main/module.xml | 20 - .../keycloak-saml-protocol/main/module.xml | 30 - .../infinispan/main/module.xml | 34 - .../keycloak-server-subsystem/main/module.xml | 35 - .../keycloak-services/main/module.xml | 79 --- .../keycloak-social-core/main/module.xml | 21 - .../keycloak-social-facebook/main/module.xml | 23 - .../keycloak-social-github/main/module.xml | 23 - .../keycloak-social-google/main/module.xml | 23 - .../keycloak-social-linkedin/main/module.xml | 23 - .../main/module.xml | 23 - .../keycloak-social-twitter/main/module.xml | 26 - .../keycloak-timer-api/main/module.xml | 17 - .../keycloak-timer-basic/main/module.xml | 18 - .../keycloak-wildfly-adduser/main/module.xml | 15 - .../main/module.xml | 15 - .../modules/org/liquibase/main/module.xml | 14 - .../mongodb/mongo-java-driver/main/module.xml | 13 - .../modules/org/twitter4j/main/module.xml | 13 - .../modules/sun/jdk/jgss/main/module.xml | 19 - .../eap6/eap6-server-overlay/assembly.xml | 67 -- .../cli/keycloak-install.cli | 10 - .../eap6/eap6-server-overlay/pom.xml | 123 ---- .../src/main/providers/README.txt | 2 - .../src/main/standalone-ha.xml | 421 ------------ .../src/main/standalone.xml | 341 ---------- .../src/main/themes/README.txt | 3 - .../src/main/xslt/standalone-ha.xsl | 77 --- .../src/main/xslt/standalone.xsl | 76 --- distribution/server-overlay/eap6/pom.xml | 21 - distribution/server-overlay/pom.xml | 72 +- distribution/server-overlay/wildfly/pom.xml | 78 --- distribution/src-dist/pom.xml | 3 +- docbook/auth-server-docs/pom.xml | 4 + .../en/en-US/modules/server-installation.xml | 34 +- .../InfinispanCacheRealmProviderFactory.java | 24 +- .../InfinispanCacheUserProviderFactory.java | 24 +- .../CompatInfinispanUserSessionProvider.java | 387 ----------- .../InfinispanUserSessionProviderFactory.java | 98 +-- .../compat/ClientInitialAccessAdapter.java | 55 -- .../compat/ClientSessionAdapter.java | 232 ------- .../compat/MemUserSessionProvider.java | 620 ------------------ .../compat/MemUserSessionProviderFactory.java | 44 -- .../compat/SimpleUserSessionInitializer.java | 49 -- .../infinispan/compat/UserSessionAdapter.java | 157 ----- .../compat/UsernameLoginFailureAdapter.java | 71 -- .../entities/ClientInitialAccessEntity.java | 68 -- .../compat/entities/ClientSessionEntity.java | 159 ----- .../compat/entities/UserSessionEntity.java | 147 ----- .../entities/UsernameLoginFailureEntity.java | 72 -- .../entities/UsernameLoginFailureKey.java | 36 - pom.xml | 19 +- .../resources/META-INF/keycloak-server.json | 6 - wildfly/pom.xml | 1 - wildfly/server-eap6-subsystem/pom.xml | 103 --- .../as7/KeycloakAdapterConfigService.java | 48 -- .../server/as7/KeycloakExtension.java | 75 --- .../KeycloakServerDeploymentProcessor.java | 53 -- .../server/as7/KeycloakSubsystemAdd.java | 86 --- .../as7/KeycloakSubsystemDefinition.java | 87 --- .../server/as7/KeycloakSubsystemParser.java | 82 --- .../as7/KeycloakSubsystemRemoveHandler.java | 65 -- ...eycloakSubsystemWriteAttributeHandler.java | 71 -- .../subsystem/server/as7/ServerUtil.java | 150 ----- .../server/logging/KeycloakLogger.java | 39 -- .../server/logging/KeycloakMessages.java | 34 - .../org.jboss.as.controller.Extension | 1 - .../server/as7/LocalDescriptions.properties | 4 - .../schema/wildfly-keycloak-server_1_1.xsd | 25 - .../keycloak-datasources.xml | 22 - .../subsystem-templates/keycloak-server.xml | 8 - .../server/extension/keycloak-server-1.1.xml | 3 - 136 files changed, 117 insertions(+), 6759 deletions(-) rename distribution/server-overlay/{wildfly => }/assembly.xml (83%) rename distribution/server-overlay/{eap6/eap6-server-overlay => }/cli/keycloak-install-ha.cli (77%) rename distribution/server-overlay/{wildfly => }/cli/keycloak-install.cli (85%) delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/assembly.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/build.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/lib.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/pom.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/core/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/javase/main/module.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/javax/ws/rs/api/2.0/module.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/bouncycastle/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/freemarker/main/module.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/jboss/aesh/0.65/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-api/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-freemarker/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-core/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-oidc/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-saml/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-http-client/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-infinispan/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo-update/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-truststore/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/jboss-deployment-structure.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/web.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-api/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-freemarker/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-api/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-email/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jboss-logging/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jpa/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-mongo/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-api/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-dir/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-single-file/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-freemarker/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-themes/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-model/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-js-adapter/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-kerberos-federation/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-ldap-federation/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-api/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-freemarker/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-api/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-jpa/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-mongo/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-protocol/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/infinispan/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-core/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-facebook/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-github/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-google/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-linkedin/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-stackoverflow/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-twitter/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-api/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-basic/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adduser/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/liquibase/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/mongodb/mongo-java-driver/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/twitter4j/main/module.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/sun/jdk/jgss/main/module.xml delete mode 100755 distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli delete mode 100755 distribution/server-overlay/eap6/eap6-server-overlay/pom.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-overlay/src/main/providers/README.txt delete mode 100644 distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone-ha.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone.xml delete mode 100644 distribution/server-overlay/eap6/eap6-server-overlay/src/main/themes/README.txt delete mode 100755 distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone-ha.xsl delete mode 100755 distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone.xsl delete mode 100755 distribution/server-overlay/eap6/pom.xml delete mode 100755 distribution/server-overlay/wildfly/pom.xml delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/CompatInfinispanUserSessionProvider.java delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientInitialAccessAdapter.java delete mode 100755 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientSessionAdapter.java delete mode 100755 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProvider.java delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProviderFactory.java delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/SimpleUserSessionInitializer.java delete mode 100755 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/UserSessionAdapter.java delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/UsernameLoginFailureAdapter.java delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientInitialAccessEntity.java delete mode 100755 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientSessionEntity.java delete mode 100755 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UserSessionEntity.java delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureEntity.java delete mode 100644 model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureKey.java delete mode 100755 wildfly/server-eap6-subsystem/pom.xml delete mode 100755 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakAdapterConfigService.java delete mode 100755 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakExtension.java delete mode 100644 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakServerDeploymentProcessor.java delete mode 100755 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemAdd.java delete mode 100644 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemDefinition.java delete mode 100755 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemParser.java delete mode 100644 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemRemoveHandler.java delete mode 100755 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemWriteAttributeHandler.java delete mode 100644 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/ServerUtil.java delete mode 100755 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java delete mode 100755 wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakMessages.java delete mode 100644 wildfly/server-eap6-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension delete mode 100755 wildfly/server-eap6-subsystem/src/main/resources/org/keycloak/subsystem/server/as7/LocalDescriptions.properties delete mode 100755 wildfly/server-eap6-subsystem/src/main/resources/schema/wildfly-keycloak-server_1_1.xsd delete mode 100644 wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-datasources.xml delete mode 100644 wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-server.xml delete mode 100644 wildfly/server-eap6-subsystem/src/test/resources/org/keycloak/subsystem/server/extension/keycloak-server-1.1.xml diff --git a/distribution/adapters/pom.xml b/distribution/adapters/pom.xml index 8861142d3c..164634f5cf 100755 --- a/distribution/adapters/pom.xml +++ b/distribution/adapters/pom.xml @@ -1,10 +1,9 @@ - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml Adapters Distribution Parent diff --git a/distribution/demo-dist/assembly.xml b/distribution/demo-dist/assembly.xml index bd169bf63b..098e2d2ef0 100755 --- a/distribution/demo-dist/assembly.xml +++ b/distribution/demo-dist/assembly.xml @@ -28,9 +28,6 @@ ${project.build.directory}/unpacked/keycloak-server-overlay-${project.version} keycloak - - standalone/configuration/standalone-keycloak.xml - ${project.build.directory}/unpacked/keycloak-wildfly-adapter-${project.version} diff --git a/distribution/demo-dist/pom.xml b/distribution/demo-dist/pom.xml index 5fc4eb9df0..49c1d36663 100755 --- a/distribution/demo-dist/pom.xml +++ b/distribution/demo-dist/pom.xml @@ -2,10 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml keycloak-demo-dist @@ -159,6 +158,7 @@ + org.codehaus.mojo xml-maven-plugin diff --git a/distribution/docs-dist/pom.xml b/distribution/docs-dist/pom.xml index 32ddea9a12..2698405979 100755 --- a/distribution/docs-dist/pom.xml +++ b/distribution/docs-dist/pom.xml @@ -2,10 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml keycloak-docs-dist diff --git a/distribution/downloads/pom.xml b/distribution/downloads/pom.xml index f34b99bc94..6dc0d8c207 100755 --- a/distribution/downloads/pom.xml +++ b/distribution/downloads/pom.xml @@ -2,8 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 + keycloak-distribution-parent org.keycloak - distribution-pom 1.9.0.CR1-SNAPSHOT diff --git a/distribution/examples-dist/pom.xml b/distribution/examples-dist/pom.xml index 37b0e23804..4dfb8bd3bf 100755 --- a/distribution/examples-dist/pom.xml +++ b/distribution/examples-dist/pom.xml @@ -2,10 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml keycloak-examples-dist diff --git a/distribution/feature-packs/pom.xml b/distribution/feature-packs/pom.xml index 9935abd1b4..d02c1be227 100644 --- a/distribution/feature-packs/pom.xml +++ b/distribution/feature-packs/pom.xml @@ -1,11 +1,11 @@ - distribution-pom + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../pom.xml + Feature Pack Builds 4.0.0 diff --git a/distribution/pom.xml b/distribution/pom.xml index c77522e826..54e80ba5cb 100755 --- a/distribution/pom.xml +++ b/distribution/pom.xml @@ -11,7 +11,7 @@ 4.0.0 - distribution-pom + keycloak-distribution-parent pom diff --git a/distribution/proxy-dist/pom.xml b/distribution/proxy-dist/pom.xml index e59fec2378..35b4835fa2 100755 --- a/distribution/proxy-dist/pom.xml +++ b/distribution/proxy-dist/pom.xml @@ -2,10 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml keycloak-proxy-dist diff --git a/distribution/saml-adapters/pom.xml b/distribution/saml-adapters/pom.xml index bd59a06742..bd13b3d701 100755 --- a/distribution/saml-adapters/pom.xml +++ b/distribution/saml-adapters/pom.xml @@ -1,10 +1,9 @@ - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml SAML Adapters Distribution Parent diff --git a/distribution/server-dist/pom.xml b/distribution/server-dist/pom.xml index 0c81f16667..1041da8799 100755 --- a/distribution/server-dist/pom.xml +++ b/distribution/server-dist/pom.xml @@ -2,10 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml keycloak-server-dist diff --git a/distribution/server-overlay/wildfly/assembly.xml b/distribution/server-overlay/assembly.xml similarity index 83% rename from distribution/server-overlay/wildfly/assembly.xml rename to distribution/server-overlay/assembly.xml index 49f5342022..4fd3372d72 100755 --- a/distribution/server-overlay/wildfly/assembly.xml +++ b/distribution/server-overlay/assembly.xml @@ -58,16 +58,6 @@ - - ${project.build.directory}/unpacked/keycloak-${project.version}/standalone/configuration/standalone.xml - standalone/configuration - standalone-keycloak.xml - - - ${project.build.directory}/unpacked/keycloak-${project.version}/standalone/configuration/standalone-ha.xml - standalone/configuration - standalone-keycloak-ha.xml - ${project.build.directory}/unpacked/keycloak-${project.version}/standalone/configuration/keycloak-server.json standalone/configuration diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install-ha.cli b/distribution/server-overlay/cli/keycloak-install-ha.cli similarity index 77% rename from distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install-ha.cli rename to distribution/server-overlay/cli/keycloak-install-ha.cli index a95c20fa2c..c120a44a62 100644 --- a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install-ha.cli +++ b/distribution/server-overlay/cli/keycloak-install-ha.cli @@ -1,11 +1,11 @@ -/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true,enabled=true) -/subsystem=logging/logger=org.jboss.resteasy.resteasy_jaxrs.i18n/:add(level=ERROR) +embed-server --server-config=standalone-ha.xml +/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true) /subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak") /subsystem=infinispan/cache-container=keycloak/transport=TRANSPORT:add(lock-timeout=60000) /subsystem=infinispan/cache-container=keycloak/invalidation-cache=realms:add(mode="SYNC") /subsystem=infinispan/cache-container=keycloak/invalidation-cache=users:add(mode="SYNC") /subsystem=infinispan/cache-container=keycloak/distributed-cache=sessions:add(mode="SYNC",owners="1") +/subsystem=infinispan/cache-container=keycloak/distributed-cache=offlineSessions:add(mode="SYNC",owners="1") /subsystem=infinispan/cache-container=keycloak/distributed-cache=loginFailures:add(mode="SYNC",owners="1") /extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem) -/subsystem=keycloak-server:add(web-context=auth) -:shutdown(restart=true) \ No newline at end of file +/subsystem=keycloak-server:add(web-context=auth) \ No newline at end of file diff --git a/distribution/server-overlay/wildfly/cli/keycloak-install.cli b/distribution/server-overlay/cli/keycloak-install.cli similarity index 85% rename from distribution/server-overlay/wildfly/cli/keycloak-install.cli rename to distribution/server-overlay/cli/keycloak-install.cli index d6c398886b..f068ace6d0 100644 --- a/distribution/server-overlay/wildfly/cli/keycloak-install.cli +++ b/distribution/server-overlay/cli/keycloak-install.cli @@ -1,8 +1,10 @@ +embed-server --server-config=standalone.xml /subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true) /subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak") /subsystem=infinispan/cache-container=keycloak/local-cache=realms:add() /subsystem=infinispan/cache-container=keycloak/local-cache=users:add() /subsystem=infinispan/cache-container=keycloak/local-cache=sessions:add() +/subsystem=infinispan/cache-container=keycloak/local-cache=offlineSessions:add() /subsystem=infinispan/cache-container=keycloak/local-cache=loginFailures:add() /extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem) /subsystem=keycloak-server:add(web-context=auth) \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-modules/assembly.xml b/distribution/server-overlay/eap6/eap6-server-modules/assembly.xml deleted file mode 100755 index 4a34435ac4..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/assembly.xml +++ /dev/null @@ -1,22 +0,0 @@ - - dist - - - zip - - false - - - - ../../ - - License.html - - - - - ${project.build.directory}/modules - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/build.xml b/distribution/server-overlay/eap6/eap6-server-modules/build.xml deleted file mode 100755 index 97cbb6f5de..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/build.xml +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/lib.xml b/distribution/server-overlay/eap6/eap6-server-modules/lib.xml deleted file mode 100755 index 3d9438a4a4..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/lib.xml +++ /dev/null @@ -1,282 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - project.setProperty("current.maven.root", root); - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "; - if(path.indexOf('${') != -1) { - throw "Module resource root not found, make sure it is listed in build/pom.xml" + path; - } - if(attributes.get("jandex") == "true" ) { - root = root + "\n\t"; - } - project.setProperty("current.resource.root", root); - ]]> - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/pom.xml b/distribution/server-overlay/eap6/eap6-server-modules/pom.xml deleted file mode 100755 index d17c6a110f..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/pom.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - - 4.0.0 - - - keycloak-parent - org.keycloak - 1.9.0.CR1-SNAPSHOT - ../../../../pom.xml - - - keycloak-server-modules-eap6 - - Keycloak EAP 6 Server Modules - pom - - - org.keycloak - keycloak-dependencies-server-all - pom - - - org.keycloak - keycloak-common - - - org.keycloak - keycloak-core - - - org.keycloak - keycloak-eap6-server-subsystem - - - org.keycloak - keycloak-wildfly-extensions - - - org.keycloak - keycloak-wildfly-adduser - - - org.bouncycastle - bcprov-jdk15on - - - org.bouncycastle - bcpkix-jdk15on - - - org.jboss.aesh - aesh - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - false - - - build-dist - - run - - compile - - - - - - - - - - - - org.jboss - jandex - 1.0.3.Final - - - ant-contrib - ant-contrib - 1.0b3 - - - ant - ant - - - - - org.apache.ant - ant-apache-bsf - 1.9.3 - - - org.apache.bsf - bsf-api - 3.1 - - - rhino - js - 1.7R2 - - - - - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - - target - - - target/assembly/work - - false - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/core/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/core/main/module.xml deleted file mode 100755 index cafd9a758c..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/core/main/module.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/javase/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/javase/main/module.xml deleted file mode 100755 index 7d72a872da..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/com/google/zxing/javase/main/module.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/javax/ws/rs/api/2.0/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/javax/ws/rs/api/2.0/module.xml deleted file mode 100644 index e972564181..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/javax/ws/rs/api/2.0/module.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/bouncycastle/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/bouncycastle/main/module.xml deleted file mode 100644 index d8fcf474cb..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/bouncycastle/main/module.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/freemarker/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/freemarker/main/module.xml deleted file mode 100755 index d2749543ba..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/freemarker/main/module.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/jboss/aesh/0.65/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/jboss/aesh/0.65/module.xml deleted file mode 100644 index 8a9d6f82cc..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/jboss/aesh/0.65/module.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-api/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-api/main/module.xml deleted file mode 100755 index 14025832e8..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-api/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-freemarker/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-freemarker/main/module.xml deleted file mode 100755 index f6c67394c2..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-account-freemarker/main/module.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-core/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-core/main/module.xml deleted file mode 100755 index 6cb957f510..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-core/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-oidc/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-oidc/main/module.xml deleted file mode 100755 index b8724689fd..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-oidc/main/module.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-saml/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-saml/main/module.xml deleted file mode 100755 index 93656fdfd4..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-broker-saml/main/module.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml deleted file mode 100755 index b7bcee4e97..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-http-client/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-http-client/main/module.xml deleted file mode 100755 index a10b80f70a..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-http-client/main/module.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-infinispan/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-infinispan/main/module.xml deleted file mode 100755 index d24f655252..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-infinispan/main/module.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml deleted file mode 100755 index fc0bac360c..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa-liquibase/main/module.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa/main/module.xml deleted file mode 100755 index 62cab55b6e..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-jpa/main/module.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo-update/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo-update/main/module.xml deleted file mode 100755 index 88f3f9efe5..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo-update/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo/main/module.xml deleted file mode 100755 index d69f003184..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-mongo/main/module.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-truststore/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-truststore/main/module.xml deleted file mode 100755 index 5c449760f0..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-connections-truststore/main/module.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml deleted file mode 100755 index 54c45abec6..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/module.xml deleted file mode 100755 index c628f4898d..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/module.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/jboss-deployment-structure.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/jboss-deployment-structure.xml deleted file mode 100755 index 0a67753f3f..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/jboss-deployment-structure.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/web.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/web.xml deleted file mode 100755 index f59d1d347d..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-eap6-server-subsystem/main/server-war/WEB-INF/web.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - auth - - - Keycloak REST Interface - org.jboss.resteasy.plugins.server.servlet.HttpServlet30Dispatcher - - javax.ws.rs.Application - org.keycloak.services.resources.KeycloakApplication - - - resteasy.servlet.mapping.prefix - / - - 1 - true - - - - org.keycloak.services.listeners.KeycloakSessionDestroyListener - - - - Keycloak Session Management - org.keycloak.services.filters.KeycloakSessionServletFilter - - - - Keycloak Session Management - /* - - - - Keycloak REST Interface - /* - - - - infinispan/Keycloak - org.infinispan.manager.EmbeddedCacheManager - java:jboss/infinispan/Keycloak - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-api/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-api/main/module.xml deleted file mode 100755 index 316a3022fd..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-api/main/module.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-freemarker/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-freemarker/main/module.xml deleted file mode 100755 index e177c85f9e..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-email-freemarker/main/module.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-api/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-api/main/module.xml deleted file mode 100755 index 4869de4375..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-api/main/module.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-email/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-email/main/module.xml deleted file mode 100755 index 61467f2fd3..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-email/main/module.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jboss-logging/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jboss-logging/main/module.xml deleted file mode 100755 index fe05f756dd..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jboss-logging/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jpa/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jpa/main/module.xml deleted file mode 100755 index 6038db81a3..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-jpa/main/module.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-mongo/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-mongo/main/module.xml deleted file mode 100755 index 0e146a1cdd..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-events-mongo/main/module.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-api/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-api/main/module.xml deleted file mode 100755 index 14f32f4caf..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-api/main/module.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-dir/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-dir/main/module.xml deleted file mode 100755 index 529848b30e..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-dir/main/module.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-single-file/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-single-file/main/module.xml deleted file mode 100755 index 72a7829eca..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-export-import-single-file/main/module.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-freemarker/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-freemarker/main/module.xml deleted file mode 100755 index da511a8d8e..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-freemarker/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-themes/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-themes/main/module.xml deleted file mode 100755 index c8c878819c..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-forms-common-themes/main/module.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml deleted file mode 100755 index b07de1dad3..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-infinispan/main/module.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-model/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-model/main/module.xml deleted file mode 100755 index e889bd638f..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-invalidation-cache-model/main/module.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-js-adapter/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-js-adapter/main/module.xml deleted file mode 100755 index 88516811eb..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-js-adapter/main/module.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-kerberos-federation/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-kerberos-federation/main/module.xml deleted file mode 100755 index 94a5bb5971..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-kerberos-federation/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-ldap-federation/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-ldap-federation/main/module.xml deleted file mode 100755 index 6368867664..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-ldap-federation/main/module.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-api/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-api/main/module.xml deleted file mode 100755 index ac315adf24..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-api/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-freemarker/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-freemarker/main/module.xml deleted file mode 100755 index 6d91ed9177..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-login-freemarker/main/module.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-api/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-api/main/module.xml deleted file mode 100755 index aa91b85177..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-api/main/module.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-jpa/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-jpa/main/module.xml deleted file mode 100755 index e71238b296..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-jpa/main/module.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-mongo/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-mongo/main/module.xml deleted file mode 100755 index 64fcc4856e..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-mongo/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml deleted file mode 100755 index 244c5b9c32..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-model-sessions-infinispan/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core/main/module.xml deleted file mode 100755 index 6a7cd653cd..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core/main/module.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-protocol/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-protocol/main/module.xml deleted file mode 100755 index d9e29229ef..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-saml-protocol/main/module.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/infinispan/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/infinispan/main/module.xml deleted file mode 100755 index 65e3dc2d0c..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/infinispan/main/module.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/main/module.xml deleted file mode 100755 index 4829258f65..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-server-subsystem/main/module.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml deleted file mode 100755 index 893c5e2a7d..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-services/main/module.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-core/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-core/main/module.xml deleted file mode 100755 index aa7287b7c8..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-core/main/module.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-facebook/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-facebook/main/module.xml deleted file mode 100755 index bb393cfef2..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-facebook/main/module.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-github/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-github/main/module.xml deleted file mode 100755 index 5fca655f0f..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-github/main/module.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-google/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-google/main/module.xml deleted file mode 100755 index 53acaa91e4..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-google/main/module.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-linkedin/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-linkedin/main/module.xml deleted file mode 100755 index ec3dc8b505..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-linkedin/main/module.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-stackoverflow/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-stackoverflow/main/module.xml deleted file mode 100755 index f2d0ad8e64..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-stackoverflow/main/module.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-twitter/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-twitter/main/module.xml deleted file mode 100755 index f06517330a..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-social-twitter/main/module.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-api/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-api/main/module.xml deleted file mode 100755 index c933335204..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-api/main/module.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-basic/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-basic/main/module.xml deleted file mode 100755 index bf1ee1ab2c..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-timer-basic/main/module.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adduser/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adduser/main/module.xml deleted file mode 100755 index e781d10f03..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adduser/main/module.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml deleted file mode 100755 index 1099de7144..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-extensions/main/module.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/liquibase/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/liquibase/main/module.xml deleted file mode 100755 index ed75cbc796..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/liquibase/main/module.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/mongodb/mongo-java-driver/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/mongodb/mongo-java-driver/main/module.xml deleted file mode 100755 index 82c6a135b0..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/mongodb/mongo-java-driver/main/module.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/twitter4j/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/twitter4j/main/module.xml deleted file mode 100755 index 6c6187f98c..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/org/twitter4j/main/module.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/sun/jdk/jgss/main/module.xml b/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/sun/jdk/jgss/main/module.xml deleted file mode 100644 index 6df03ff4ba..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-modules/src/main/resources/modules/sun/jdk/jgss/main/module.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml b/distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml deleted file mode 100755 index 037e30fc67..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/assembly.xml +++ /dev/null @@ -1,67 +0,0 @@ - - server-dist - - - zip - tar.gz - - - false - - - - ${project.build.directory}/unpacked/modules - modules/system/layers/base - - - ../../../../forms/common-themes/src/main/resources/theme - standalone/configuration/themes - - **/** - - - - cli - - *.cli - - bin - - - - - - ${project.build.directory}/standalone.xml - standalone/configuration - standalone-keycloak.xml - - - ${project.build.directory}/standalone-ha.xml - standalone/configuration - standalone-keycloak-ha.xml - - - ../../../feature-packs/server-feature-pack/src/main/resources/content/standalone/configuration/keycloak-server.json - standalone/configuration - - - src/main/themes/README.txt - standalone/configuration/themes - - - src/main/providers/README.txt - standalone/configuration/providers - - - ../../../feature-packs/server-feature-pack/src/main/resources/content/bin/add-user.sh - bin - add-user-keycloak.sh - - - ../../../feature-packs/server-feature-pack/src/main/resources/content/bin/add-user.bat - bin - add-user-keycloak.bat - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli b/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli deleted file mode 100644 index 156197abfa..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/cli/keycloak-install.cli +++ /dev/null @@ -1,10 +0,0 @@ -/subsystem=datasources/data-source=KeycloakDS/:add(connection-url="jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE",driver-name=h2,jndi-name=java:jboss/datasources/KeycloakDS,password=sa,user-name=sa,use-java-context=true,enabled=true) -/subsystem=logging/logger=org.jboss.resteasy.resteasy_jaxrs.i18n/:add(level=ERROR) -/subsystem=infinispan/cache-container=keycloak:add(jndi-name="infinispan/Keycloak",start="EAGER") -/subsystem=infinispan/cache-container=keycloak/local-cache=realms:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=users:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=sessions:add() -/subsystem=infinispan/cache-container=keycloak/local-cache=loginFailures:add() -/extension=org.keycloak.keycloak-server-subsystem/:add(module=org.keycloak.keycloak-server-subsystem) -/subsystem=keycloak-server:add(web-context=auth) -:shutdown(restart=true) \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/pom.xml b/distribution/server-overlay/eap6/eap6-server-overlay/pom.xml deleted file mode 100755 index fac2527d29..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/pom.xml +++ /dev/null @@ -1,123 +0,0 @@ - - 4.0.0 - - keycloak-parent - org.keycloak - 1.9.0.CR1-SNAPSHOT - ../../../../pom.xml - - - keycloak-server-overlay-eap6 - pom - Keycloak Server Overlay EAP 6 Distribution - - - - - org.keycloak - keycloak-server-modules-eap6 - zip - - - - - keycloak-overlay-eap6-${project.version} - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack-jboss-modules - prepare-package - - unpack - - - - - org.keycloak - keycloak-server-modules-eap6 - zip - ${project.build.directory}/unpacked/modules - - - - - - - - org.codehaus.mojo - xml-maven-plugin - 1.0 - - - generate-resources - package - - transform - - - - - src/main - src/main/xslt/standalone.xsl - - standalone.xml - - ${project.build.directory} - - - - - - generate-resources-2 - package - - transform - - - - - src/main - src/main/xslt/standalone-ha.xsl - - standalone-ha.xml - - ${project.build.directory} - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - true - ${project.build.finalName} - false - ${project.build.directory} - ${project.build.directory}/assembly/work - gnu - - - - - - - - diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/providers/README.txt b/distribution/server-overlay/eap6/eap6-server-overlay/src/main/providers/README.txt deleted file mode 100644 index a6d523b43f..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/providers/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -Any provider implementation jars and libraries in this folder will be loaded by Keycloak. See the providers -section in the documentation for more details. \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone-ha.xml b/distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone-ha.xml deleted file mode 100644 index e208a7d2b0..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone-ha.xml +++ /dev/null @@ -1,421 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - false - true - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - ${jboss.bind.address:127.0.0.1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone.xml b/distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone.xml deleted file mode 100644 index 5835618b24..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/standalone.xml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - - - - - false - true - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - ${jboss.bind.address:127.0.0.1} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/themes/README.txt b/distribution/server-overlay/eap6/eap6-server-overlay/src/main/themes/README.txt deleted file mode 100644 index 705b73ac69..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/themes/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -Themes to configure the look and feel of login pages and account management console. It's not recommended to -modify existing the built-in themes, instead you should create a new theme that extends a built-in theme. See the theme -section in the documentation for more details. \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone-ha.xsl b/distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone-ha.xsl deleted file mode 100755 index c0680719c5..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone-ha.xsl +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE - h2 - - sa - sa - - - - - - - - - - - - - - - - - - - - - - - - - auth - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone.xsl b/distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone.xsl deleted file mode 100755 index 403fe346d6..0000000000 --- a/distribution/server-overlay/eap6/eap6-server-overlay/src/main/xslt/standalone.xsl +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE - h2 - - sa - sa - - - - - - - - - - - auth - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/server-overlay/eap6/pom.xml b/distribution/server-overlay/eap6/pom.xml deleted file mode 100755 index 2209d08c84..0000000000 --- a/distribution/server-overlay/eap6/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - 4.0.0 - - keycloak-parent - org.keycloak - 1.9.0.CR1-SNAPSHOT - ../../../pom.xml - - - keycloak-server-overlay-eap6-parent - pom - Keycloak Server Overlay EAP 6 - - - - - eap6-server-modules - eap6-server-overlay - - diff --git a/distribution/server-overlay/pom.xml b/distribution/server-overlay/pom.xml index 366e1ecf5b..f2ae69a66c 100755 --- a/distribution/server-overlay/pom.xml +++ b/distribution/server-overlay/pom.xml @@ -2,20 +2,76 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml - keycloak-server-overlay-parent + keycloak-server-overlay pom - Keycloak Server Overlay Parent + Keycloak Server Overlay Distribution + + + org.keycloak + keycloak-server-dist + zip + + + + + keycloak-overlay-${project.version} + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-server-dist + prepare-package + + unpack + + + + + org.keycloak + keycloak-server-dist + zip + ${project.build.directory}/unpacked + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + assemble + package + + single + + + + assembly.xml + + true + ${project.build.finalName} + false + ${project.build.directory} + ${project.build.directory}/assembly/work + gnu + + + + + + - - wildfly - eap6 - diff --git a/distribution/server-overlay/wildfly/pom.xml b/distribution/server-overlay/wildfly/pom.xml deleted file mode 100755 index 7a69d9ecb1..0000000000 --- a/distribution/server-overlay/wildfly/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - 4.0.0 - - keycloak-parent - org.keycloak - 1.9.0.CR1-SNAPSHOT - ../../../pom.xml - - - keycloak-server-overlay - pom - Keycloak Server Overlay Distribution - - - - - org.keycloak - keycloak-server-dist - zip - - - - - keycloak-overlay-${project.version} - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack-server-dist - prepare-package - - unpack - - - - - org.keycloak - keycloak-server-dist - zip - ${project.build.directory}/unpacked - - - - - - - - org.apache.maven.plugins - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - true - ${project.build.finalName} - false - ${project.build.directory} - ${project.build.directory}/assembly/work - gnu - - - - - - - - diff --git a/distribution/src-dist/pom.xml b/distribution/src-dist/pom.xml index 5fbf03efb1..e9fe1672c5 100755 --- a/distribution/src-dist/pom.xml +++ b/distribution/src-dist/pom.xml @@ -2,10 +2,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - keycloak-parent + keycloak-distribution-parent org.keycloak 1.9.0.CR1-SNAPSHOT - ../../pom.xml keycloak-src-dist diff --git a/docbook/auth-server-docs/pom.xml b/docbook/auth-server-docs/pom.xml index 7e1d1e8270..80bb86d3d1 100755 --- a/docbook/auth-server-docs/pom.xml +++ b/docbook/auth-server-docs/pom.xml @@ -118,6 +118,10 @@ wildfly.version ${wildfly.version} + + eap.version + ${eap.version} + saxon diff --git a/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml b/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml index b660e78be3..a1f0d9fe00 100755 --- a/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml +++ b/docbook/auth-server-docs/reference/en/en-US/modules/server-installation.xml @@ -38,37 +38,23 @@
- Install on existing WildFly &wildfly.version; + Install on existing WildFly &wildfly.version; or JBoss EAP &eap.version; - Keycloak can be installed into an existing WildFly &wildfly.version; server. To do this download - keycloak-overlay-&project.version;.zip or keycloak-overlay-&project.version;.tar.gz. - Once downloaded extract into the root directory of your WildFly installation. To start WildFly with Keycloak - run: - <WILDFLY_HOME>/bin/standalone.sh --server-config=standalone-keycloak.xml - or: - <WILDFLY_HOME>/bin/standalone.bat --server-config=standalone-keycloak.xml + Keycloak can be installed into an existing installations of WildFly &wildfly.version; or JBoss EAP &eap.version;. + To do this download keycloak-overlay-&project.version;.zip or keycloak-overlay-&project.version;.tar.gz. + Once downloaded extract into the root directory of your installation. - To add Keycloak to other sever configurations (standalone.xml, standalone-ha.xml, etc.) start the server with - the desired server-config. If you are running the server in standalone mode run: + To add Keycloak to existing standalone.xml server config run: -cd <WILDFLY_HOME>/bin -./jboss-cli.sh -c --file=keycloak-install.cli +bin/jboss-cli.sh --file=keycloak-install.cli - Or if you are running in clustering (HA) mode (by having used -c standalone-ha.xml) then run: + To add Keycloak to existing standalone-ha.xml server config run: -cd <WILDFLY_HOME>/bin -./jboss-cli.sh -c --file=keycloak-install-ha.cli + bin/jboss-cli.sh --file=keycloak-install.cli - You may see exceptions in the server log, but after restarting the server they should be gone. - You can restart the server with: - <WILDFLY_HOME>/bin/jboss-cli.sh -c :reload - -
-
- Install on existing JBoss EAP 6.4.0.GA - - Same procedure as WildFly &wildfly.version;, but download keycloak-overlay-eap6-&project.version;.zip or keycloak-overlay-eap6-&project.version;.tar.gz. + If you want to add Keycloak to a different server config edit keycloak-install.cli or keycloak-install-ha.cli + and change the name of the server config.
diff --git a/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java b/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java index 5aec527ac8..2a31be8c19 100755 --- a/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java +++ b/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheRealmProviderFactory.java @@ -34,8 +34,6 @@ public class InfinispanCacheRealmProviderFactory implements CacheRealmProviderFa protected final ConcurrentHashMap realmLookup = new ConcurrentHashMap<>(); - private boolean isNewInfinispan; - @Override public CacheRealmProvider create(KeycloakSession session) { lazyInit(session); @@ -46,8 +44,6 @@ public class InfinispanCacheRealmProviderFactory implements CacheRealmProviderFa if (realmCache == null) { synchronized (this) { if (realmCache == null) { - checkIspnVersion(); - Cache cache = session.getProvider(InfinispanConnectionProvider.class).getCache(InfinispanConnectionProvider.REALM_CACHE_NAME); cache.addListener(new CacheListener()); realmCache = new InfinispanRealmCache(cache, realmLookup); @@ -56,15 +52,6 @@ public class InfinispanCacheRealmProviderFactory implements CacheRealmProviderFa } } - protected void checkIspnVersion() { - try { - CacheEntryCreatedEvent.class.getMethod("getValue"); - isNewInfinispan = true; - } catch (NoSuchMethodException nsme) { - isNewInfinispan = false; - } - } - @Override public void init(Config.Scope config) { } @@ -89,16 +76,7 @@ public class InfinispanCacheRealmProviderFactory implements CacheRealmProviderFa @CacheEntryCreated public void created(CacheEntryCreatedEvent event) { if (!event.isPre()) { - Object object; - - // Try optimized version if available - if (isNewInfinispan) { - object = event.getValue(); - } else { - String id = event.getKey(); - object = event.getCache().get(id); - } - + Object object = event.getValue(); if (object != null) { if (object instanceof CachedRealm) { CachedRealm realm = (CachedRealm) object; diff --git a/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheUserProviderFactory.java b/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheUserProviderFactory.java index ec699127c4..f99513f65a 100755 --- a/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheUserProviderFactory.java +++ b/model/invalidation-cache/infinispan/src/main/java/org/keycloak/models/cache/infinispan/InfinispanCacheUserProviderFactory.java @@ -32,9 +32,6 @@ public class InfinispanCacheUserProviderFactory implements CacheUserProviderFact protected final RealmLookup emailLookup = new RealmLookup(); - // Method CacheEntryCreatedEvent.getValue is available from ispn 6 (EAP6 and AS7 are on ispn 5) - private boolean isNewInfinispan; - @Override public CacheUserProvider create(KeycloakSession session) { lazyInit(session); @@ -45,7 +42,6 @@ public class InfinispanCacheUserProviderFactory implements CacheUserProviderFact if (userCache == null) { synchronized (this) { if (userCache == null) { - checkIspnVersion(); Cache cache = session.getProvider(InfinispanConnectionProvider.class).getCache(InfinispanConnectionProvider.USER_CACHE_NAME); cache.addListener(new CacheListener()); userCache = new InfinispanUserCache(cache, usernameLookup, emailLookup); @@ -54,15 +50,6 @@ public class InfinispanCacheUserProviderFactory implements CacheUserProviderFact } } - protected void checkIspnVersion() { - try { - CacheEntryCreatedEvent.class.getMethod("getValue"); - isNewInfinispan = true; - } catch (NoSuchMethodException nsme) { - isNewInfinispan = false; - } - } - @Override public void init(Config.Scope config) { } @@ -87,16 +74,7 @@ public class InfinispanCacheUserProviderFactory implements CacheUserProviderFact @CacheEntryCreated public void userCreated(CacheEntryCreatedEvent event) { if (!event.isPre()) { - CachedUser user; - - // Try optimized version if available - if (isNewInfinispan) { - user = event.getValue(); - } else { - String userId = event.getKey(); - user = event.getCache().get(userId); - } - + CachedUser user = event.getValue(); if (user != null) { String realm = user.getRealm(); diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/CompatInfinispanUserSessionProvider.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/CompatInfinispanUserSessionProvider.java deleted file mode 100644 index bcd72e79ef..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/CompatInfinispanUserSessionProvider.java +++ /dev/null @@ -1,387 +0,0 @@ -package org.keycloak.models.sessions.infinispan; - -import org.infinispan.Cache; -import org.infinispan.distexec.mapreduce.MapReduceTask; -import org.jboss.logging.Logger; -import org.keycloak.common.util.Time; -import org.keycloak.models.*; -import org.keycloak.models.session.UserSessionPersisterProvider; -import org.keycloak.models.sessions.infinispan.entities.*; -import org.keycloak.models.sessions.infinispan.mapreduce.*; -import org.keycloak.models.utils.KeycloakModelUtils; -import org.keycloak.models.utils.RealmInfoUtil; - -import java.util.*; - -/** - * @author Stian Thorgersen - */ -public class CompatInfinispanUserSessionProvider extends InfinispanUserSessionProvider { - - private static final Logger log = Logger.getLogger(CompatInfinispanUserSessionProvider.class); - - public CompatInfinispanUserSessionProvider(KeycloakSession session, Cache sessionCache, Cache offlineSessionCache, - Cache loginFailureCache) { - super(session, sessionCache, offlineSessionCache, loginFailureCache); - } - - @Override - public List getUserSessions(RealmModel realm, UserModel user) { - Map sessions = new MapReduceTask(sessionCache) - .mappedWith(UserSessionMapper.create(realm.getId()).user(user.getId())) - .reducedWith(new FirstResultReducer()) - .execute(); - - return wrapUserSessions(realm, sessions.values(), false); - } - - @Override - public List getUserSessionByBrokerUserId(RealmModel realm, String brokerUserId) { - Map sessions = new MapReduceTask(sessionCache) - .mappedWith(UserSessionMapper.create(realm.getId()).brokerUserId(brokerUserId)) - .reducedWith(new FirstResultReducer()) - .execute(); - - return wrapUserSessions(realm, sessions.values(), false); - } - - @Override - public UserSessionModel getUserSessionByBrokerSessionId(RealmModel realm, String brokerSessionId) { - Map sessions = new MapReduceTask(sessionCache) - .mappedWith(UserSessionMapper.create(realm.getId()).brokerSessionId(brokerSessionId)) - .reducedWith(new FirstResultReducer()) - .execute(); - - List userSessionModels = wrapUserSessions(realm, sessions.values(), false); - if (userSessionModels.isEmpty()) return null; - return userSessionModels.get(0); - } - - @Override - public List getUserSessions(RealmModel realm, ClientModel client) { - return getUserSessions(realm, client, -1, -1); - } - - @Override - public List getUserSessions(RealmModel realm, ClientModel client, int firstResult, int maxResults) { - return getUserSessions(realm, client, firstResult, maxResults, false); - } - - protected List getUserSessions(RealmModel realm, ClientModel client, int firstResult, int maxResults, boolean offline) { - Cache cache = getCache(offline); - - Map map = new MapReduceTask(cache) - .mappedWith(ClientSessionMapper.create(realm.getId()).client(client.getId()).emitUserSessionAndTimestamp()) - .reducedWith(new LargestResultReducer()) - .execute(); - - List> sessionTimestamps = new LinkedList>(map.entrySet()); - - Collections.sort(sessionTimestamps, new Comparator>() { - @Override - public int compare(Map.Entry e1, Map.Entry e2) { - return e1.getValue().compareTo(e2.getValue()); - } - }); - - if (firstResult != -1 || maxResults == -1) { - if (firstResult == -1) { - firstResult = 0; - } - - if (maxResults == -1) { - maxResults = Integer.MAX_VALUE; - } - - if (firstResult > sessionTimestamps.size()) { - return Collections.emptyList(); - } - - int toIndex = (firstResult + maxResults) < sessionTimestamps.size() ? firstResult + maxResults : sessionTimestamps.size(); - sessionTimestamps = sessionTimestamps.subList(firstResult, toIndex); - } - - List userSessions = new LinkedList(); - for (Map.Entry e : sessionTimestamps) { - UserSessionEntity userSessionEntity = (UserSessionEntity) cache.get(e.getKey()); - if (userSessionEntity != null) { - userSessions.add(wrap(realm, userSessionEntity, offline)); - } - } - - return userSessions; - } - - @Override - public long getActiveUserSessions(RealmModel realm, ClientModel client) { - return getUserSessionsCount(realm, client, false); - } - - protected long getUserSessionsCount(RealmModel realm, ClientModel client, boolean offline) { - Cache cache = getCache(offline); - - Map map = new MapReduceTask(cache) - .mappedWith(ClientSessionMapper.create(realm.getId()).client(client.getId()).emitUserSessionAndTimestamp()) - .reducedWith(new LargestResultReducer()).execute(); - - return map.size(); - } - - @Override - public void removeUserSession(RealmModel realm, UserSessionModel session) { - removeUserSession(realm, session.getId()); - } - - @Override - public void removeUserSessions(RealmModel realm, UserModel user) { - removeUserSessions(realm, user, false); - } - - protected void removeUserSessions(RealmModel realm, UserModel user, boolean offline) { - Cache cache = getCache(offline); - - Map sessions = new MapReduceTask(cache) - .mappedWith(UserSessionMapper.create(realm.getId()).user(user.getId()).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (String id : sessions.keySet()) { - removeUserSession(realm, id, offline); - } - } - - @Override - public void removeExpired(RealmModel realm) { - UserSessionPersisterProvider persister = session.getProvider(UserSessionPersisterProvider.class); - - int expired = Time.currentTime() - realm.getSsoSessionMaxLifespan(); - int expiredRefresh = Time.currentTime() - realm.getSsoSessionIdleTimeout(); - int expiredOffline = Time.currentTime() - realm.getOfflineSessionIdleTimeout(); - int expiredDettachedClientSession = Time.currentTime() - RealmInfoUtil.getDettachedClientSessionLifespan(realm); - - Map map = new MapReduceTask(sessionCache) - .mappedWith(UserSessionMapper.create(realm.getId()).expired(expired, expiredRefresh).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (String id : map.keySet()) { - removeUserSession(realm, id); - } - - map = new MapReduceTask(sessionCache) - .mappedWith(ClientSessionMapper.create(realm.getId()).expiredRefresh(expiredDettachedClientSession).requireNullUserSession(true).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (String id : map.keySet()) { - tx.remove(sessionCache, id); - } - - // Remove expired offline user sessions - Map map2 = new MapReduceTask(offlineSessionCache) - .mappedWith(UserSessionMapper.create(realm.getId()).expired(null, expiredOffline)) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (Map.Entry entry : map2.entrySet()) { - String userSessionId = entry.getKey(); - tx.remove(offlineSessionCache, userSessionId); - // Propagate to persister - persister.removeUserSession(userSessionId, true); - - UserSessionEntity entity = (UserSessionEntity) entry.getValue(); - for (String clientSessionId : entity.getClientSessions()) { - tx.remove(offlineSessionCache, clientSessionId); - } - } - - // Remove expired offline client sessions - map = new MapReduceTask(offlineSessionCache) - .mappedWith(ClientSessionMapper.create(realm.getId()).expiredRefresh(expiredOffline).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (String clientSessionId : map.keySet()) { - tx.remove(offlineSessionCache, clientSessionId); - persister.removeClientSession(clientSessionId, true); - } - - // Remove expired client initial access - map = new MapReduceTask(sessionCache) - .mappedWith(ClientInitialAccessMapper.create(realm.getId()).expired(Time.currentTime()).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (String id : map.keySet()) { - tx.remove(sessionCache, id); - } - } - - @Override - public void removeUserSessions(RealmModel realm) { - removeUserSessions(realm, false); - } - - protected void removeUserSessions(RealmModel realm, boolean offline) { - Cache cache = getCache(offline); - - Map ids = new MapReduceTask(cache) - .mappedWith(SessionMapper.create(realm.getId()).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (String id : ids.keySet()) { - cache.remove(id); - } - } - - @Override - public void removeUserLoginFailure(RealmModel realm, String username) { - LoginFailureKey key = new LoginFailureKey(realm.getId(), username); - tx.remove(loginFailureCache, key); - } - - @Override - public void removeAllUserLoginFailures(RealmModel realm) { - Map sessions = new MapReduceTask(loginFailureCache) - .mappedWith(UserLoginFailureMapper.create(realm.getId()).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (LoginFailureKey id : sessions.keySet()) { - tx.remove(loginFailureCache, id); - } - } - - @Override - public void onRealmRemoved(RealmModel realm) { - removeUserSessions(realm, true); - removeUserSessions(realm, false); - removeAllUserLoginFailures(realm); - } - - @Override - public void onClientRemoved(RealmModel realm, ClientModel client) { - onClientRemoved(realm, client, true); - onClientRemoved(realm, client, false); - } - - private void onClientRemoved(RealmModel realm, ClientModel client, boolean offline) { - Cache cache = getCache(offline); - - Map map = new MapReduceTask(cache) - .mappedWith(ClientSessionMapper.create(realm.getId()).client(client.getId())) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (Map.Entry entry : map.entrySet()) { - - // detach from userSession - ClientSessionAdapter adapter = wrap(realm, entry.getValue(), offline); - adapter.setUserSession(null); - - tx.remove(cache, entry.getKey()); - } - } - - @Override - public void onUserRemoved(RealmModel realm, UserModel user) { - removeUserSessions(realm, user, true); - removeUserSessions(realm, user, false); - - loginFailureCache.remove(new LoginFailureKey(realm.getId(), user.getUsername())); - loginFailureCache.remove(new LoginFailureKey(realm.getId(), user.getEmail())); - } - - @Override - public void removeClientSession(RealmModel realm, ClientSessionModel clientSession) { - removeClientSession(realm, clientSession, false); - } - - protected void removeClientSession(RealmModel realm, ClientSessionModel clientSession, boolean offline) { - Cache cache = getCache(offline); - - UserSessionModel userSession = clientSession.getUserSession(); - if (userSession != null) { - UserSessionEntity entity = ((UserSessionAdapter) userSession).getEntity(); - if (entity.getClientSessions() != null) { - entity.getClientSessions().remove(clientSession.getId()); - - } - tx.replace(cache, entity.getId(), entity); - } - tx.remove(cache, clientSession.getId()); - } - - protected void removeUserSession(RealmModel realm, String userSessionId) { - removeUserSession(realm, userSessionId, false); - } - - protected void removeUserSession(RealmModel realm, String userSessionId, boolean offline) { - Cache cache = getCache(offline); - - tx.remove(cache, userSessionId); - - // TODO: Isn't more effective to retrieve from userSessionEntity directly? - Map map = new MapReduceTask(cache) - .mappedWith(ClientSessionMapper.create(realm.getId()).userSession(userSessionId).emitKey()) - .reducedWith(new FirstResultReducer()) - .execute(); - - for (String id : map.keySet()) { - tx.remove(cache, id); - } - } - - @Override - public void removeOfflineUserSession(RealmModel realm, String userSessionId) { - removeUserSession(realm, userSessionId, true); - } - - @Override - public List getOfflineClientSessions(RealmModel realm, UserModel user) { - Map sessions = new MapReduceTask(offlineSessionCache) - .mappedWith(UserSessionMapper.create(realm.getId()).user(user.getId())) - .reducedWith(new FirstResultReducer()) - .execute(); - - List clientSessions = new LinkedList<>(); - for (UserSessionEntity userSession : sessions.values()) { - Set currClientSessions = userSession.getClientSessions(); - for (String clientSessionId : currClientSessions) { - ClientSessionEntity cls = (ClientSessionEntity) offlineSessionCache.get(clientSessionId); - if (cls != null) { - clientSessions.add(cls); - } - } - } - - return wrapClientSessions(realm, clientSessions, true); - } - - @Override - public void removeOfflineClientSession(RealmModel realm, String clientSessionId) { - ClientSessionModel clientSession = getOfflineClientSession(realm, clientSessionId); - removeClientSession(realm, clientSession, true); - } - - @Override - public long getOfflineSessionsCount(RealmModel realm, ClientModel client) { - return getUserSessionsCount(realm, client, true); - } - - @Override - public List getOfflineUserSessions(RealmModel realm, ClientModel client, int first, int max) { - return getUserSessions(realm, client, first, max, true); - } - - @Override - public List listClientInitialAccess(RealmModel realm) { - Map entities = new MapReduceTask(sessionCache) - .mappedWith(ClientInitialAccessMapper.create(realm.getId())) - .reducedWith(new FirstResultReducer()) - .execute(); - return wrapClientInitialAccess(realm, entities.values()); - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProviderFactory.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProviderFactory.java index e18aa847e0..0d3bc5281c 100755 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProviderFactory.java +++ b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/InfinispanUserSessionProviderFactory.java @@ -1,20 +1,10 @@ package org.keycloak.models.sessions.infinispan; import org.infinispan.Cache; -import org.infinispan.Version; import org.jboss.logging.Logger; import org.keycloak.Config; import org.keycloak.connections.infinispan.InfinispanConnectionProvider; -import org.keycloak.models.ClientModel; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.KeycloakSessionFactory; -import org.keycloak.models.KeycloakSessionTask; -import org.keycloak.models.RealmModel; -import org.keycloak.models.UserSessionProvider; -import org.keycloak.models.UserSessionProviderFactory; -import org.keycloak.models.session.UserSessionPersisterProvider; -import org.keycloak.models.sessions.infinispan.compat.MemUserSessionProviderFactory; -import org.keycloak.models.sessions.infinispan.compat.SimpleUserSessionInitializer; +import org.keycloak.models.*; import org.keycloak.models.sessions.infinispan.entities.LoginFailureEntity; import org.keycloak.models.sessions.infinispan.entities.LoginFailureKey; import org.keycloak.models.sessions.infinispan.entities.SessionEntity; @@ -25,33 +15,20 @@ import org.keycloak.models.utils.PostMigrationEvent; import org.keycloak.provider.ProviderEvent; import org.keycloak.provider.ProviderEventListener; -/** - * Uses Infinispan to store user sessions. On EAP 6.4 (Infinispan 5.2) map reduce is not supported for local caches as a work around - * the old memory user session provider is used in this case. This can be removed once we drop support for EAP 6.4. - * - * @author Stian Thorgersen - */ public class InfinispanUserSessionProviderFactory implements UserSessionProviderFactory { private static final Logger log = Logger.getLogger(InfinispanUserSessionProviderFactory.class); private Config.Scope config; - private Boolean compatMode; - private MemUserSessionProviderFactory compatProviderFactory; @Override public UserSessionProvider create(KeycloakSession session) { + InfinispanConnectionProvider connections = session.getProvider(InfinispanConnectionProvider.class); + Cache cache = connections.getCache(InfinispanConnectionProvider.SESSION_CACHE_NAME); + Cache offlineSessionsCache = connections.getCache(InfinispanConnectionProvider.OFFLINE_SESSION_CACHE_NAME); + Cache loginFailures = connections.getCache(InfinispanConnectionProvider.LOGIN_FAILURE_CACHE_NAME); - if (!compatMode) { - InfinispanConnectionProvider connections = session.getProvider(InfinispanConnectionProvider.class); - Cache cache = connections.getCache(InfinispanConnectionProvider.SESSION_CACHE_NAME); - Cache offlineSessionsCache = connections.getCache(InfinispanConnectionProvider.OFFLINE_SESSION_CACHE_NAME); - Cache loginFailures = connections.getCache(InfinispanConnectionProvider.LOGIN_FAILURE_CACHE_NAME); - - return isStreamMode() ? new InfinispanUserSessionProvider(session, cache, offlineSessionsCache, loginFailures) : new CompatInfinispanUserSessionProvider(session, cache, offlineSessionsCache, loginFailures); - } else { - return compatProviderFactory.create(session); - } + return new InfinispanUserSessionProvider(session, cache, offlineSessionsCache, loginFailures); } @Override @@ -61,18 +38,6 @@ public class InfinispanUserSessionProviderFactory implements UserSessionProvider @Override public void postInit(final KeycloakSessionFactory factory) { - KeycloakModelUtils.runJobInTransaction(factory, new KeycloakSessionTask() { - - @Override - public void run(KeycloakSession session) { - compatMode = isCompatMode(session); - if (compatMode) { - compatProviderFactory = new MemUserSessionProviderFactory(); - } - } - - }); - // Max count of worker errors. Initialization will end with exception when this number is reached final int maxErrors = config.getInt("maxErrors", 20); @@ -95,34 +60,25 @@ public class InfinispanUserSessionProviderFactory implements UserSessionProvider public void loadPersistentSessions(final KeycloakSessionFactory sessionFactory, final int maxErrors, final int sessionsPerSegment) { log.debug("Start pre-loading userSessions and clientSessions from persistent storage"); - if (compatMode) { - SimpleUserSessionInitializer initializer = new SimpleUserSessionInitializer(sessionFactory, new OfflineUserSessionLoader(), sessionsPerSegment); - initializer.loadPersistentSessions(); + KeycloakModelUtils.runJobInTransaction(sessionFactory, new KeycloakSessionTask() { - } else { - KeycloakModelUtils.runJobInTransaction(sessionFactory, new KeycloakSessionTask() { + @Override + public void run(KeycloakSession session) { + InfinispanConnectionProvider connections = session.getProvider(InfinispanConnectionProvider.class); + Cache cache = connections.getCache(InfinispanConnectionProvider.OFFLINE_SESSION_CACHE_NAME); - @Override - public void run(KeycloakSession session) { - InfinispanConnectionProvider connections = session.getProvider(InfinispanConnectionProvider.class); - Cache cache = connections.getCache(InfinispanConnectionProvider.OFFLINE_SESSION_CACHE_NAME); + InfinispanUserSessionInitializer initializer = new InfinispanUserSessionInitializer(sessionFactory, cache, new OfflineUserSessionLoader(), maxErrors, sessionsPerSegment, "offlineUserSessions"); + initializer.initCache(); + initializer.loadPersistentSessions(); + } - InfinispanUserSessionInitializer initializer = new InfinispanUserSessionInitializer(sessionFactory, cache, new OfflineUserSessionLoader(), maxErrors, sessionsPerSegment, "offlineUserSessions"); - initializer.initCache(); - initializer.loadPersistentSessions(); - } - - }); - } + }); log.debug("Pre-loading userSessions and clientSessions from persistent storage finished"); } @Override public void close() { - if (compatProviderFactory != null) { - compatProviderFactory.close(); - } } @Override @@ -130,27 +86,5 @@ public class InfinispanUserSessionProviderFactory implements UserSessionProvider return "infinispan"; } - private boolean isCompatMode(KeycloakSession session) { - // For unit tests - if (this.config.getBoolean("enforceCompat", false)) { - log.info("Enforced compatibility mode for infinispan. Falling back to deprecated mem user session provider."); - return true; - } - - if (Version.getVersionShort() < Version.getVersionShort("5.3.0.Final")) { - InfinispanConnectionProvider connections = session.getProvider(InfinispanConnectionProvider.class); - Cache cache = connections.getCache(InfinispanConnectionProvider.SESSION_CACHE_NAME); - if (cache.getAdvancedCache().getRpcManager() == null) { - log.info("Infinispan version doesn't support map reduce for local cache. Falling back to deprecated mem user session provider."); - return true; - } - } - return false; - } - - private boolean isStreamMode() { - return Version.getVersionShort() >= Version.getVersionShort("8.1.0.Final"); - } - } diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientInitialAccessAdapter.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientInitialAccessAdapter.java deleted file mode 100644 index 3398efff4a..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientInitialAccessAdapter.java +++ /dev/null @@ -1,55 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat; - -import org.keycloak.models.ClientInitialAccessModel; -import org.keycloak.models.RealmModel; -import org.keycloak.models.sessions.infinispan.compat.entities.ClientInitialAccessEntity; - -/** - * @author Stian Thorgersen - */ -public class ClientInitialAccessAdapter implements ClientInitialAccessModel { - - private final RealmModel realm; - private final ClientInitialAccessEntity entity; - - public ClientInitialAccessAdapter(RealmModel realm, ClientInitialAccessEntity entity) { - this.realm = realm; - this.entity = entity; - } - - @Override - public String getId() { - return entity.getId(); - } - - @Override - public RealmModel getRealm() { - return realm; - } - - @Override - public int getTimestamp() { - return entity.getTimestamp(); - } - - @Override - public int getExpiration() { - return entity.getExpires(); - } - - @Override - public int getCount() { - return entity.getCount(); - } - - @Override - public int getRemainingCount() { - return entity.getRemainingCount(); - } - - @Override - public void decreaseRemainingCount() { - entity.setRemainingCount(entity.getRemainingCount() - 1); - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientSessionAdapter.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientSessionAdapter.java deleted file mode 100755 index dc6d0be91a..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/ClientSessionAdapter.java +++ /dev/null @@ -1,232 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat; - -import org.keycloak.models.ClientModel; -import org.keycloak.models.ClientSessionModel; -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.RealmModel; -import org.keycloak.models.UserModel; -import org.keycloak.models.UserSessionModel; -import org.keycloak.models.sessions.infinispan.compat.entities.ClientSessionEntity; -import org.keycloak.models.sessions.infinispan.compat.entities.UserSessionEntity; - -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * @author Stian Thorgersen - */ -public class ClientSessionAdapter implements ClientSessionModel { - - private KeycloakSession session; - private MemUserSessionProvider provider; - private RealmModel realm; - private ClientSessionEntity entity; - - public ClientSessionAdapter(KeycloakSession session, MemUserSessionProvider provider, RealmModel realm, ClientSessionEntity entity) { - this.session = session; - this.provider = provider; - this.realm = realm; - this.entity = entity; - } - - @Override - public String getId() { - return entity.getId(); - } - - @Override - public RealmModel getRealm() { - return session.realms().getRealm(entity.getRealmId()); - } - - public ClientSessionEntity getEntity() { - return entity; - } - - @Override - public ClientModel getClient() { - return realm.getClientById(entity.getClientId()); - } - - @Override - public UserSessionModel getUserSession() { - if (entity.getSession() == null) return null; - return new UserSessionAdapter(session, provider, realm, entity.getSession()); - } - - @Override - public void setUserSession(UserSessionModel userSession) { - if (userSession == null) { - if (entity.getSession() != null) { - entity.getSession().getClientSessions().remove(entity); - } - entity.setSession(null); - } else { - UserSessionAdapter adapter = (UserSessionAdapter) userSession; - UserSessionEntity userSessionEntity = adapter.getEntity(); - entity.setSession(userSessionEntity); - userSessionEntity.getClientSessions().add(entity); - } - } - - @Override - public void setRedirectUri(String uri) { - entity.setRedirectUri(uri); - } - - @Override - public void setRoles(Set roles) { - entity.setRoles(roles); - } - - @Override - public String getRedirectUri() { - return entity.getRedirectUri(); - } - - @Override - public int getTimestamp() { - return entity.getTimestamp(); - } - - @Override - public void setTimestamp(int timestamp) { - entity.setTimestamp(timestamp); - } - - @Override - public String getAction() { - return entity.getAction(); - } - - @Override - public void setAction(String action) { - entity.setAction(action); - } - - @Override - public Set getRoles() { - return entity.getRoles(); - } - - @Override - public Set getProtocolMappers() { - return entity.getProtocolMappers(); - } - - @Override - public void setProtocolMappers(Set protocolMappers) { - entity.setProtocolMappers(protocolMappers); - } - - @Override - public String getNote(String name) { - return entity.getNotes().get(name); - } - - @Override - public void setNote(String name, String value) { - entity.getNotes().put(name, value); - - } - - @Override - public void removeNote(String name) { - entity.getNotes().remove(name); - - } - - @Override - public Map getNotes() { - if (entity.getNotes() == null || entity.getNotes().isEmpty()) return Collections.emptyMap(); - Map copy = new HashMap<>(); - copy.putAll(entity.getNotes()); - return copy; - } - - @Override - public void setUserSessionNote(String name, String value) { - entity.getUserSessionNotes().put(name, value); - } - - @Override - public Map getUserSessionNotes() { - return entity.getUserSessionNotes(); - } - - @Override - public String getAuthMethod() { - return entity.getAuthMethod(); - } - - @Override - public void setAuthMethod(String method) { - entity.setAuthMethod(method); - } - - @Override - public Map getExecutionStatus() { - return entity.getAuthenticatorStatus(); - } - - @Override - public void setExecutionStatus(String authenticator, ExecutionStatus status) { - entity.getAuthenticatorStatus().put(authenticator, status); - - } - - @Override - public void clearExecutionStatus() { - entity.getAuthenticatorStatus().clear(); - } - - @Override - public void clearUserSessionNotes() { - entity.getUserSessionNotes().clear(); - } - - @Override - public UserModel getAuthenticatedUser() { - return entity.getAuthUserId() == null ? null : session.users().getUserById(entity.getAuthUserId(), realm); } - - @Override - public void setAuthenticatedUser(UserModel user) { - if (user == null) entity.setAuthUserId(null); - else entity.setAuthUserId(user.getId()); - - } - - @Override - public Set getRequiredActions() { - Set copy = new HashSet<>(); - copy.addAll(entity.getRequiredActions()); - return copy; - } - - @Override - public void addRequiredAction(String action) { - entity.getRequiredActions().add(action); - - } - - @Override - public void removeRequiredAction(String action) { - entity.getRequiredActions().remove(action); - - } - - @Override - public void addRequiredAction(UserModel.RequiredAction action) { - addRequiredAction(action.name()); - - } - - @Override - public void removeRequiredAction(UserModel.RequiredAction action) { - removeRequiredAction(action.name()); - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProvider.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProvider.java deleted file mode 100755 index 693db6718c..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProvider.java +++ /dev/null @@ -1,620 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat; - -import org.keycloak.models.*; -import org.keycloak.models.session.UserSessionPersisterProvider; -import org.keycloak.models.sessions.infinispan.compat.entities.*; -import org.keycloak.models.utils.KeycloakModelUtils; -import org.keycloak.models.utils.RealmInfoUtil; -import org.keycloak.common.util.Time; - -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author Stian Thorgersen - */ -public class MemUserSessionProvider implements UserSessionProvider { - - private final KeycloakSession session; - private final ConcurrentHashMap userSessions; - private final ConcurrentHashMap userSessionsByBrokerSessionId; - private final ConcurrentHashMap> userSessionsByBrokerUserId; - private final ConcurrentHashMap clientSessions; - private final ConcurrentHashMap loginFailures; - - private final ConcurrentHashMap offlineUserSessions; - private final ConcurrentHashMap offlineClientSessions; - private ConcurrentHashMap clientInitialAccess; - - public MemUserSessionProvider(KeycloakSession session, ConcurrentHashMap userSessions, ConcurrentHashMap userSessionsByBrokerSessionId, - ConcurrentHashMap> userSessionsByBrokerUserId, ConcurrentHashMap clientSessions, - ConcurrentHashMap loginFailures, - ConcurrentHashMap offlineUserSessions, ConcurrentHashMap offlineClientSessions, ConcurrentHashMap clientInitialAccess) { - this.session = session; - this.userSessions = userSessions; - this.clientSessions = clientSessions; - this.loginFailures = loginFailures; - this.userSessionsByBrokerSessionId = userSessionsByBrokerSessionId; - this.userSessionsByBrokerUserId = userSessionsByBrokerUserId; - this.offlineUserSessions = offlineUserSessions; - this.offlineClientSessions = offlineClientSessions; - this.clientInitialAccess = clientInitialAccess; - } - - @Override - public ClientSessionModel createClientSession(RealmModel realm, ClientModel client) { - ClientSessionEntity entity = new ClientSessionEntity(); - entity.setId(KeycloakModelUtils.generateId()); - entity.setTimestamp(Time.currentTime()); - entity.setClientId(client.getId()); - entity.setRealmId(realm.getId()); - clientSessions.put(entity.getId(), entity); - return new ClientSessionAdapter(session, this, realm, entity); - } - - @Override - public void removeClientSession(RealmModel realm, ClientSessionModel clientSession) { - ClientSessionEntity entity = ((ClientSessionAdapter)clientSession).getEntity(); - UserSessionModel userSession = clientSession.getUserSession(); - if (userSession != null) { - UserSessionEntity userSessionEntity = ((UserSessionAdapter)userSession).getEntity(); - userSessionEntity.getClientSessions().remove(entity); - } - clientSessions.remove(clientSession.getId()); - } - - @Override - public ClientSessionModel getClientSession(RealmModel realm, String id) { - ClientSessionEntity entity = clientSessions.get(id); - return entity != null ? new ClientSessionAdapter(session, this, realm, entity) : null; - } - - @Override - public ClientSessionModel getClientSession(String id) { - ClientSessionEntity entity = clientSessions.get(id); - if (entity != null) { - RealmModel realm = session.realms().getRealm(entity.getRealmId()); - return new ClientSessionAdapter(session, this, realm, entity); - } - return null; - } - - @Override - public UserSessionModel createUserSession(RealmModel realm, UserModel user, String loginUsername, String ipAddress, String authMethod, boolean rememberMe, String brokerSessionId, String brokerUserId) { - String id = KeycloakModelUtils.generateId(); - - UserSessionEntity entity = new UserSessionEntity(); - entity.setId(id); - entity.setRealm(realm.getId()); - entity.setUser(user.getId()); - entity.setLoginUsername(loginUsername); - entity.setIpAddress(ipAddress); - entity.setAuthMethod(authMethod); - entity.setRememberMe(rememberMe); - - int currentTime = Time.currentTime(); - - entity.setStarted(currentTime); - entity.setLastSessionRefresh(currentTime); - entity.setBrokerSessionId(brokerSessionId); - entity.setBrokerUserId(brokerUserId); - - userSessions.put(id, entity); - if (brokerSessionId != null) { - userSessionsByBrokerSessionId.put(brokerSessionId, id); - } - if (brokerUserId != null) { - while (true) { // while loop gets around a race condition when a user session is removed - Set set = userSessionsByBrokerUserId.get(brokerUserId); - if (set == null) { - Set value = new HashSet<>(); - set = userSessionsByBrokerUserId.putIfAbsent(brokerUserId, value); - if (set == null) { - set = value; - } - } - synchronized (set) { - set.add(id); - } - if (userSessionsByBrokerUserId.get(brokerUserId) == set) { - // we are ensured set isn't deleted before the new id is added - break; - } - } - } - - return new UserSessionAdapter(session, this, realm, entity); - } - - @Override - public List getUserSessionByBrokerUserId(RealmModel realm, String brokerUserId) { - Set sessions = userSessionsByBrokerUserId.get(brokerUserId); - if (sessions == null) return Collections.emptyList(); - List userSessions = new LinkedList(); - for (String id : sessions) { - UserSessionModel userSession = getUserSession(realm, id); - if (userSession != null) userSessions.add(userSession); - } - return userSessions; - } - - @Override - public UserSessionModel getUserSessionByBrokerSessionId(RealmModel realm, String brokerSessionId) { - String id = userSessionsByBrokerSessionId.get(brokerSessionId); - if (id == null) return null; - return getUserSession(realm, id); - } - - @Override - public UserSessionModel getUserSession(RealmModel realm, String id) { - UserSessionEntity entity = getUserSessionEntity(realm, id); - return entity != null ? new UserSessionAdapter(session, this, realm, entity) : null; - } - - UserSessionEntity getUserSessionEntity(RealmModel realm, String id) { - UserSessionEntity entity = userSessions.get(id); - if (entity != null && entity.getRealm().equals(realm.getId())) { - return entity; - } - return null; - } - - @Override - public List getUserSessions(RealmModel realm, UserModel user) { - List userSessions = new LinkedList(); - for (UserSessionEntity s : this.userSessions.values()) { - if (s.getRealm().equals(realm.getId()) && s.getUser().equals(user.getId())) { - userSessions.add(new UserSessionAdapter(session, this, realm, s)); - } - } - return userSessions; - } - - @Override - public List getUserSessions(RealmModel realm, ClientModel client) { - return getUserSessions(realm, client, false); - } - - protected List getUserSessions(RealmModel realm, ClientModel client, boolean offline) { - ConcurrentHashMap clientSessions = offline ? this.offlineClientSessions : this.clientSessions; - - List userSessionEntities = new LinkedList(); - for (ClientSessionEntity s : clientSessions.values()) { - String realmId = realm.getId(); - String clientId = client.getId(); - if (s.getSession() != null && s.getSession().getRealm().equals(realmId) && s.getClientId().equals(clientId)) { - if (!userSessionEntities.contains(s.getSession())) { - userSessionEntities.add(s.getSession()); - } - } - } - - List userSessions = new LinkedList(); - for (UserSessionEntity e : userSessionEntities) { - userSessions.add(new UserSessionAdapter(session, this, realm, e)); - } - Collections.sort(userSessions, new UserSessionSort()); - return userSessions; - } - - @Override - public List getUserSessions(RealmModel realm, ClientModel client, int firstResult, int maxResults) { - return getUserSessions(realm, client, firstResult, maxResults, false); - } - - protected List getUserSessions(RealmModel realm, ClientModel client, int firstResult, int maxResults, boolean offline) { - List userSessions = getUserSessions(realm, client, offline); - if (firstResult > userSessions.size()) { - return Collections.emptyList(); - } - - int toIndex = (firstResult + maxResults) < userSessions.size() ? firstResult + maxResults : userSessions.size(); - return userSessions.subList(firstResult, toIndex); - } - - @Override - public long getActiveUserSessions(RealmModel realm, ClientModel client) { - return getUserSessions(realm, client, false).size(); - } - - @Override - public void removeUserSession(RealmModel realm, UserSessionModel session) { - UserSessionEntity entity = getUserSessionEntity(realm, session.getId()); - if (entity != null) { - userSessions.remove(entity.getId()); - remove(entity, false); - } - } - - @Override - public void removeUserSessions(RealmModel realm, UserModel user) { - removeUserSessions(realm, user, false); - } - - protected void removeUserSessions(RealmModel realm, UserModel user, boolean offline) { - Iterator itr = offline ? offlineUserSessions.values().iterator() : userSessions.values().iterator(); - - while (itr.hasNext()) { - UserSessionEntity s = itr.next(); - if (s.getRealm().equals(realm.getId()) && s.getUser().equals(user.getId())) { - itr.remove(); - remove(s, offline); - } - } - } - - protected void remove(UserSessionEntity s, boolean offline) { - if (offline) { - for (ClientSessionEntity clientSession : s.getClientSessions()) { - offlineClientSessions.remove(clientSession.getId()); - } - } else { - if (s.getBrokerSessionId() != null) { - userSessionsByBrokerSessionId.remove(s.getBrokerSessionId()); - } - if (s.getBrokerUserId() != null) { - Set set = userSessionsByBrokerUserId.get(s.getBrokerUserId()); - if (set != null) { - synchronized (set) { - set.remove(s.getId()); - // this is a race condition :( - // Since it will be very rare for a user to have concurrent sessions, I'm hoping we never hit this - if (set.isEmpty()) userSessionsByBrokerUserId.remove(s.getBrokerUserId()); - } - } - } - for (ClientSessionEntity clientSession : s.getClientSessions()) { - clientSessions.remove(clientSession.getId()); - } - } - } - - @Override - public void removeExpired(RealmModel realm) { - UserSessionPersisterProvider persister = session.getProvider(UserSessionPersisterProvider.class); - - Iterator itr = userSessions.values().iterator(); - while (itr.hasNext()) { - UserSessionEntity s = itr.next(); - if (s.getRealm().equals(realm.getId()) && (s.getLastSessionRefresh() < Time.currentTime() - realm.getSsoSessionIdleTimeout() || s.getStarted() < Time.currentTime() - realm.getSsoSessionMaxLifespan())) { - itr.remove(); - - remove(s, false); - } - } - int expired = Time.currentTime() - RealmInfoUtil.getDettachedClientSessionLifespan(realm); - Iterator citr = clientSessions.values().iterator(); - while (citr.hasNext()) { - ClientSessionEntity c = citr.next(); - if (c.getSession() == null && c.getRealmId().equals(realm.getId()) && c.getTimestamp() < expired) { - citr.remove(); - } - } - - // Remove expired offline user sessions - itr = offlineUserSessions.values().iterator(); - while (itr.hasNext()) { - UserSessionEntity s = itr.next(); - if (s.getRealm().equals(realm.getId()) && (s.getLastSessionRefresh() < Time.currentTime() - realm.getOfflineSessionIdleTimeout())) { - itr.remove(); - remove(s, true); - - // propagate to persister - persister.removeUserSession(s.getId(), true); - } - } - - // Remove expired offline client sessions - citr = offlineClientSessions.values().iterator(); - while (citr.hasNext()) { - ClientSessionEntity s = citr.next(); - if (s.getRealmId().equals(realm.getId()) && (s.getTimestamp() < Time.currentTime() - realm.getOfflineSessionIdleTimeout())) { - citr.remove(); - - // propagate to persister - persister.removeClientSession(s.getId(), true); - } - } - - // Remove expired initial access - Iterator iaitr = clientInitialAccess.values().iterator(); - while (iaitr.hasNext()) { - ClientInitialAccessEntity e = iaitr.next(); - if (e.getRealmId().equals(realm.getId()) && (e.getExpires() < Time.currentTime())) { - iaitr.remove(); - } - } - } - - @Override - public void removeUserSessions(RealmModel realm) { - removeUserSessions(realm, false); - } - - protected void removeUserSessions(RealmModel realm, boolean offline) { - Iterator itr = offline ? offlineUserSessions.values().iterator() : userSessions.values().iterator(); - while (itr.hasNext()) { - UserSessionEntity s = itr.next(); - if (s.getRealm().equals(realm.getId())) { - itr.remove(); - remove(s, offline); - } - } - Iterator citr = offline ? offlineClientSessions.values().iterator() : clientSessions.values().iterator(); - while (citr.hasNext()) { - ClientSessionEntity c = citr.next(); - if (c.getSession() == null && c.getRealmId().equals(realm.getId())) { - citr.remove(); - } - } - } - - @Override - public UsernameLoginFailureModel getUserLoginFailure(RealmModel realm, String username) { - UsernameLoginFailureEntity entity = loginFailures.get(new UsernameLoginFailureKey(realm.getId(), username)); - return entity != null ? new UsernameLoginFailureAdapter(entity) : null; - } - - @Override - public UsernameLoginFailureModel addUserLoginFailure(RealmModel realm, String username) { - UsernameLoginFailureKey key = new UsernameLoginFailureKey(realm.getId(), username); - UsernameLoginFailureEntity entity = new UsernameLoginFailureEntity(username, realm.getId()); - if (loginFailures.putIfAbsent(key, entity) != null) { - throw new ModelDuplicateException(); - } - return new UsernameLoginFailureAdapter(entity); - } - - @Override - public void removeUserLoginFailure(RealmModel realm, String username) { - loginFailures.remove(new UsernameLoginFailureKey(realm.getId(), username)); - } - - @Override - public void removeAllUserLoginFailures(RealmModel realm) { - Iterator itr = loginFailures.values().iterator(); - while (itr.hasNext()) { - if (itr.next().getRealm().equals(realm.getId())) { - itr.remove(); - } - } - - } - - @Override - public void onRealmRemoved(RealmModel realm) { - removeUserSessions(realm, true); - removeUserSessions(realm, false); - removeAllUserLoginFailures(realm); - } - - @Override - public void onClientRemoved(RealmModel realm, ClientModel client) { - onClientRemoved(realm, client, true); - onClientRemoved(realm, client, false); - } - - private void onClientRemoved(RealmModel realm, ClientModel client, boolean offline) { - ConcurrentHashMap clientSessionsMap = offline ? offlineClientSessions : clientSessions; - - for (ClientSessionEntity e : clientSessionsMap.values()) { - if (e.getRealmId().equals(realm.getId()) && e.getClientId().equals(client.getId())) { - clientSessionsMap.remove(e.getId()); - e.getSession().removeClientSession(e); - } - } - } - - @Override - public void onUserRemoved(RealmModel realm, UserModel user) { - removeUserSessions(realm, user, true); - removeUserSessions(realm, user, false); - - loginFailures.remove(new UsernameLoginFailureKey(realm.getId(), user.getUsername())); - loginFailures.remove(new UsernameLoginFailureKey(realm.getId(), user.getEmail())); - } - - - @Override - public UserSessionModel createOfflineUserSession(UserSessionModel userSession) { - UserSessionAdapter importedUserSession = importUserSession(userSession, true); - - // started and lastSessionRefresh set to current time - int currentTime = Time.currentTime(); - importedUserSession.getEntity().setStarted(currentTime); - importedUserSession.setLastSessionRefresh(currentTime); - - return importedUserSession; - } - - @Override - public UserSessionAdapter importUserSession(UserSessionModel userSession, boolean offline) { - UserSessionEntity entity = new UserSessionEntity(); - entity.setId(userSession.getId()); - entity.setRealm(userSession.getRealm().getId()); - - entity.setAuthMethod(userSession.getAuthMethod()); - entity.setBrokerSessionId(userSession.getBrokerSessionId()); - entity.setBrokerUserId(userSession.getBrokerUserId()); - entity.setIpAddress(userSession.getIpAddress()); - entity.setLoginUsername(userSession.getLoginUsername()); - if (userSession.getNotes() != null) { - entity.getNotes().putAll(userSession.getNotes()); - } - entity.setRememberMe(userSession.isRememberMe()); - entity.setState(userSession.getState()); - entity.setUser(userSession.getUser().getId()); - - entity.setStarted(userSession.getStarted()); - entity.setLastSessionRefresh(userSession.getLastSessionRefresh()); - - ConcurrentHashMap sessionsMap = offline ? offlineUserSessions : userSessions; - sessionsMap.put(userSession.getId(), entity); - return new UserSessionAdapter(session, this, userSession.getRealm(), entity); - } - - @Override - public UserSessionModel getOfflineUserSession(RealmModel realm, String userSessionId) { - UserSessionEntity entity = offlineUserSessions.get(userSessionId); - if (entity != null && entity.getRealm().equals(realm.getId())) { - return new UserSessionAdapter(session, this, realm, entity); - } else { - return null; - } - } - - @Override - public void removeOfflineUserSession(RealmModel realm, String userSessionId) { - UserSessionEntity entity = offlineUserSessions.get(userSessionId); - if (entity != null && entity.getRealm().equals(realm.getId())) { - offlineUserSessions.remove(entity); - remove(entity, true); - } - } - - @Override - public ClientSessionModel createOfflineClientSession(ClientSessionModel clientSession) { - ClientSessionAdapter offlineClientSession = importClientSession(clientSession, true); - - // update timestamp to current time - offlineClientSession.setTimestamp(Time.currentTime()); - - return offlineClientSession; - } - - @Override - public ClientSessionAdapter importClientSession(ClientSessionModel clientSession, boolean offline) { - - ClientSessionEntity entity = new ClientSessionEntity(); - entity.setId(clientSession.getId()); - entity.setRealmId(clientSession.getRealm().getId()); - - entity.setAction(clientSession.getAction()); - entity.setAuthenticatorStatus(clientSession.getExecutionStatus()); - entity.setAuthMethod(clientSession.getAuthMethod()); - if (clientSession.getAuthenticatedUser() != null) { - entity.setAuthUserId(clientSession.getAuthenticatedUser().getId()); - } - entity.setClientId(clientSession.getClient().getId()); - if (clientSession.getNotes() != null) { - entity.getNotes().putAll(clientSession.getNotes()); - } - entity.setProtocolMappers(clientSession.getProtocolMappers()); - entity.setRedirectUri(clientSession.getRedirectUri()); - entity.setRoles(clientSession.getRoles()); - entity.setTimestamp(clientSession.getTimestamp()); - - if (clientSession.getUserSessionNotes() != null) { - entity.getUserSessionNotes().putAll(clientSession.getUserSessionNotes()); - } - - ConcurrentHashMap clientSessionsMap = offline ? offlineClientSessions : clientSessions; - clientSessionsMap.put(clientSession.getId(), entity); - return new ClientSessionAdapter(session, this, clientSession.getRealm(), entity); - } - - @Override - public ClientSessionModel getOfflineClientSession(RealmModel realm, String clientSessionId) { - ClientSessionEntity entity = offlineClientSessions.get(clientSessionId); - if (entity != null && entity.getRealmId().equals(realm.getId())) { - return new ClientSessionAdapter(session, this, realm, entity); - } else { - return null; - } - } - - @Override - public List getOfflineClientSessions(RealmModel realm, UserModel user) { - List clientSessions = new LinkedList<>(); - for (UserSessionEntity s : this.offlineUserSessions.values()) { - if (s.getRealm().equals(realm.getId()) && s.getUser().equals(user.getId())) { - for (ClientSessionEntity cls : s.getClientSessions()) { - ClientSessionAdapter clAdapter = new ClientSessionAdapter(session, this, realm, cls); - clientSessions.add(clAdapter); - } - } - } - return clientSessions; - } - - @Override - public void removeOfflineClientSession(RealmModel realm, String clientSessionId) { - ClientSessionEntity entity = offlineClientSessions.get(clientSessionId); - if (entity != null && entity.getRealmId().equals(realm.getId())) { - offlineClientSessions.remove(entity.getId()); - UserSessionEntity userSession = entity.getSession(); - userSession.removeClientSession(entity); - } - } - - @Override - public long getOfflineSessionsCount(RealmModel realm, ClientModel client) { - return getUserSessions(realm, client, true).size(); - } - - @Override - public List getOfflineUserSessions(RealmModel realm, ClientModel client, int first, int max) { - return getUserSessions(realm, client, first, max, true); - } - - @Override - public ClientInitialAccessModel createClientInitialAccessModel(RealmModel realm, int expiration, int count) { - String id = KeycloakModelUtils.generateId(); - - ClientInitialAccessEntity entity = new ClientInitialAccessEntity(); - entity.setId(id); - entity.setRealmId(realm.getId()); - entity.setTimestamp(Time.currentTime()); - entity.setExpiration(expiration); - entity.setCount(count); - entity.setRemainingCount(count); - - clientInitialAccess.put(id, entity); - - return new ClientInitialAccessAdapter(realm, entity); - } - - @Override - public ClientInitialAccessModel getClientInitialAccessModel(RealmModel realm, String id) { - ClientInitialAccessEntity entity = clientInitialAccess.get(id); - return entity != null ? new ClientInitialAccessAdapter(realm, entity) : null; - } - - @Override - public void removeClientInitialAccessModel(RealmModel realm, String id) { - clientInitialAccess.remove(id); - } - - @Override - public List listClientInitialAccess(RealmModel realm) { - List models = new LinkedList<>(); - for (ClientInitialAccessEntity e : clientInitialAccess.values()) { - models.add(new ClientInitialAccessAdapter(realm, e)); - } - return models; - } - - @Override - public void close() { - } - - private class UserSessionSort implements Comparator { - - @Override - public int compare(UserSessionModel o1, UserSessionModel o2) { - int r = o1.getStarted() - o2.getStarted(); - if (r == 0) { - return o1.getId().compareTo(o2.getId()); - } else { - return r; - } - } - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProviderFactory.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProviderFactory.java deleted file mode 100644 index 451fcb0ecf..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/MemUserSessionProviderFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat; - -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.UserSessionProvider; -import org.keycloak.models.sessions.infinispan.compat.entities.ClientSessionEntity; -import org.keycloak.models.sessions.infinispan.compat.entities.UserSessionEntity; -import org.keycloak.models.sessions.infinispan.compat.entities.UsernameLoginFailureEntity; -import org.keycloak.models.sessions.infinispan.compat.entities.UsernameLoginFailureKey; -import org.keycloak.models.sessions.infinispan.compat.entities.ClientInitialAccessEntity; - -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - -/** - * @author Stian Thorgersen - */ -public class MemUserSessionProviderFactory { - - private ConcurrentHashMap userSessions = new ConcurrentHashMap(); - - private ConcurrentHashMap clientSessions = new ConcurrentHashMap(); - - private ConcurrentHashMap loginFailures = new ConcurrentHashMap(); - private final ConcurrentHashMap userSessionsByBrokerSessionId = new ConcurrentHashMap<>(); - private final ConcurrentHashMap> userSessionsByBrokerUserId = new ConcurrentHashMap<>(); - - private ConcurrentHashMap offlineUserSessions = new ConcurrentHashMap(); - private ConcurrentHashMap offlineClientSessions = new ConcurrentHashMap(); - - private ConcurrentHashMap clientInitialAccess = new ConcurrentHashMap<>(); - - public UserSessionProvider create(KeycloakSession session) { - return new MemUserSessionProvider(session, userSessions, userSessionsByBrokerSessionId, userSessionsByBrokerUserId, clientSessions, loginFailures, - offlineUserSessions, offlineClientSessions, clientInitialAccess); - } - - public void close() { - userSessions.clear(); - loginFailures.clear(); - userSessionsByBrokerSessionId.clear(); - userSessionsByBrokerUserId.clear(); - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/SimpleUserSessionInitializer.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/SimpleUserSessionInitializer.java deleted file mode 100644 index 1ec5dc9db5..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/SimpleUserSessionInitializer.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat; - -import org.keycloak.models.KeycloakSession; -import org.keycloak.models.KeycloakSessionFactory; -import org.keycloak.models.KeycloakSessionTask; -import org.keycloak.models.sessions.infinispan.initializer.SessionLoader; -import org.keycloak.models.utils.KeycloakModelUtils; - -/** - * @author Marek Posolda - */ -public class SimpleUserSessionInitializer { - - private final KeycloakSessionFactory sessionFactory; - private final SessionLoader sessionLoader; - private final int sessionsPerSegment; - - public SimpleUserSessionInitializer(KeycloakSessionFactory sessionFactory, SessionLoader sessionLoader, int sessionsPerSegment) { - this.sessionFactory = sessionFactory; - this.sessionLoader = sessionLoader; - this.sessionsPerSegment = sessionsPerSegment; - } - - public void loadPersistentSessions() { - // Rather use separate transactions for update and loading - - KeycloakModelUtils.runJobInTransaction(sessionFactory, new KeycloakSessionTask() { - - @Override - public void run(KeycloakSession session) { - sessionLoader.init(session); - } - - }); - - KeycloakModelUtils.runJobInTransaction(sessionFactory, new KeycloakSessionTask() { - - @Override - public void run(KeycloakSession session) { - int count = sessionLoader.getSessionsCount(session); - - for (int i=0 ; iStian Thorgersen - */ -public class UserSessionAdapter implements UserSessionModel { - - private final KeycloakSession session; - - private MemUserSessionProvider provider; - private final RealmModel realm; - - private final UserSessionEntity entity; - - public UserSessionAdapter(KeycloakSession session, MemUserSessionProvider provider, RealmModel realm, UserSessionEntity entity) { - this.session = session; - this.provider = provider; - this.realm = realm; - this.entity = entity; - } - - public UserSessionEntity getEntity() { - return entity; - } - - public String getId() { - return entity.getId(); - } - - @Override - public RealmModel getRealm() { - return realm; - } - - @Override - public String getBrokerSessionId() { - return entity.getBrokerSessionId(); - } - - @Override - public String getBrokerUserId() { - return entity.getBrokerUserId(); - } - - public void setId(String id) { - entity.setId(id); - } - - public UserModel getUser() { - return session.users().getUserById(entity.getUser(), realm); - } - - public void setUser(UserModel user) { - entity.setUser(user.getId()); - } - - @Override - public String getLoginUsername() { - return entity.getLoginUsername(); - } - - public String getIpAddress() { - return entity.getIpAddress(); - } - - @Override - public String getAuthMethod() { - return entity.getAuthMethod(); - } - - @Override - public boolean isRememberMe() { - return entity.isRememberMe(); - } - - public int getStarted() { - return entity.getStarted(); - } - - public int getLastSessionRefresh() { - return entity.getLastSessionRefresh(); - } - - public void setLastSessionRefresh(int lastSessionRefresh) { - entity.setLastSessionRefresh(lastSessionRefresh); - } - - @Override - public State getState() { - return entity.getState(); - } - - @Override - public void setState(State state) { - entity.setState(state); - - } - - @Override - public List getClientSessions() { - List clientSessionModels = new LinkedList(); - if (entity.getClientSessions() != null) { - for (ClientSessionEntity e : entity.getClientSessions()) { - clientSessionModels.add(new ClientSessionAdapter(session, provider, realm, e)); - } - } - return clientSessionModels; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || !(o instanceof UserSessionModel)) return false; - - UserSessionModel that = (UserSessionModel) o; - return that.getId().equals(getId()); - } - - @Override - public int hashCode() { - return getId().hashCode(); - } - - @Override - public String getNote(String name) { - return entity.getNotes().get(name); - } - - @Override - public void setNote(String name, String value) { - entity.getNotes().put(name, value); - - } - - @Override - public void removeNote(String name) { - entity.getNotes().remove(name); - - } - - @Override - public Map getNotes() { - return entity.getNotes(); - } -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/UsernameLoginFailureAdapter.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/UsernameLoginFailureAdapter.java deleted file mode 100644 index e287ebb4cd..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/UsernameLoginFailureAdapter.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat; - -import org.keycloak.models.UsernameLoginFailureModel; -import org.keycloak.models.sessions.infinispan.compat.entities.UsernameLoginFailureEntity; - -/** - * @author Stian Thorgersen - */ -public class UsernameLoginFailureAdapter implements UsernameLoginFailureModel { - - private final UsernameLoginFailureEntity entity; - - public UsernameLoginFailureAdapter(UsernameLoginFailureEntity entity) { - this.entity = entity; - } - - @Override - public String getUsername() { - return entity.getUsername(); - } - - public String getRealm() { - return entity.getRealm(); - } - - @Override - public int getFailedLoginNotBefore() { - return entity.getFailedLoginNotBefore().get(); - } - - @Override - public void setFailedLoginNotBefore(int notBefore) { - entity.getFailedLoginNotBefore().set(notBefore); - } - - @Override - public int getNumFailures() { - return entity.getNumFailures().get(); - } - - @Override - public void incrementFailures() { - entity.getNumFailures().incrementAndGet(); - } - - @Override - public void clearFailures() { - entity.clearFailures(); - } - - @Override - public long getLastFailure() { - return entity.getLastFailure().get(); - } - - @Override - public void setLastFailure(long lastFailure) { - entity.getLastFailure().set(lastFailure); - } - - @Override - public String getLastIPFailure() { - return entity.getLastIpFailure().get(); - } - - @Override - public void setLastIPFailure(String ip) { - entity.getLastIpFailure().set(ip); - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientInitialAccessEntity.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientInitialAccessEntity.java deleted file mode 100644 index ed0aeac494..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientInitialAccessEntity.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat.entities; - -/** - * @author Stian Thorgersen - */ -public class ClientInitialAccessEntity { - - private String id; - - private String realmId; - - private int timestamp; - - private int expires; - - private int count; - - private int remainingCount; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getRealmId() { - return realmId; - } - - public void setRealmId(String realmId) { - this.realmId = realmId; - } - - public int getTimestamp() { - return timestamp; - } - - public void setTimestamp(int timestamp) { - this.timestamp = timestamp; - } - - public int getExpires() { - return expires; - } - - public void setExpiration(int expires) { - this.expires = expires; - } - - public int getCount() { - return count; - } - - public void setCount(int count) { - this.count = count; - } - - public int getRemainingCount() { - return remainingCount; - } - - public void setRemainingCount(int remainingCount) { - this.remainingCount = remainingCount; - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientSessionEntity.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientSessionEntity.java deleted file mode 100755 index e178a35c9e..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/ClientSessionEntity.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat.entities; - -import org.keycloak.models.ClientSessionModel; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -/** - * @author Stian Thorgersen - */ -public class ClientSessionEntity { - - private String id; - private String clientId; - private String realmId; - private Map authenticatorStatus = new HashMap<>(); - private String authUserId; - - private UserSessionEntity session; - - private String redirectUri; - private String authMethod; - - private int timestamp; - private String action; - private Set roles; - private Set protocolMappers; - private Map notes = new HashMap<>(); - private Map userSessionNotes = new HashMap<>(); - private Set requiredActions = new HashSet<>(); - - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getRealmId() { - return realmId; - } - - public void setRealmId(String realmId) { - this.realmId = realmId; - } - - public UserSessionEntity getSession() { - return session; - } - - public void setSession(UserSessionEntity session) { - this.session = session; - } - - public String getRedirectUri() { - return redirectUri; - } - - public void setRedirectUri(String redirectUri) { - this.redirectUri = redirectUri; - } - - public int getTimestamp() { - return timestamp; - } - - public void setTimestamp(int timestamp) { - this.timestamp = timestamp; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public Set getRoles() { - return roles; - } - - public void setRoles(Set roles) { - this.roles = roles; - } - - public Set getProtocolMappers() { - return protocolMappers; - } - - public void setProtocolMappers(Set protocolMappers) { - this.protocolMappers = protocolMappers; - } - - public Map getNotes() { - return notes; - } - - public String getAuthMethod() { - return authMethod; - } - - public void setAuthMethod(String authMethod) { - this.authMethod = authMethod; - } - - public String getAuthUserId() { - return authUserId; - } - - public void setAuthUserId(String authUserId) { - this.authUserId = authUserId; - } - - public Map getAuthenticatorStatus() { - return authenticatorStatus; - } - - public void setAuthenticatorStatus(Map authenticatorStatus) { - this.authenticatorStatus = authenticatorStatus; - } - - public Map getUserSessionNotes() { - return userSessionNotes; - } - - public Set getRequiredActions() { - return requiredActions; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof ClientSessionEntity)) return false; - - ClientSessionEntity that = (ClientSessionEntity) o; - - if (id != null ? !id.equals(that.id) : that.id != null) return false; - - return true; - } - - @Override - public int hashCode() { - return id != null ? id.hashCode() : 0; - } -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UserSessionEntity.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UserSessionEntity.java deleted file mode 100755 index 7326aa56df..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UserSessionEntity.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat.entities; - -import org.keycloak.models.UserSessionModel; - -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -/** - * @author Stian Thorgersen - */ -public class UserSessionEntity { - - private String id; - private String brokerSessionId; - private String brokerUserId; - private String realm; - private String user; - private String loginUsername; - private String ipAddress; - private String authMethod; - private boolean rememberMe; - private int started; - private int lastSessionRefresh; - private UserSessionModel.State state; - private Map notes = new HashMap(); - private List clientSessions = Collections.synchronizedList(new LinkedList()); - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getRealm() { - return realm; - } - - public void setRealm(String realm) { - this.realm = realm; - } - - public String getUser() { - return user; - } - - public void setUser(String user) { - this.user = user; - } - - public String getLoginUsername() { - return loginUsername; - } - - public void setLoginUsername(String loginUsername) { - this.loginUsername = loginUsername; - } - - public String getIpAddress() { - return ipAddress; - } - - public void setIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - } - - public String getAuthMethod() { - return authMethod; - } - - public void setAuthMethod(String authMethod) { - this.authMethod = authMethod; - } - - public boolean isRememberMe() { - return rememberMe; - } - - public void setRememberMe(boolean rememberMe) { - this.rememberMe = rememberMe; - } - - public int getStarted() { - return started; - } - - public void setStarted(int started) { - this.started = started; - } - - public int getLastSessionRefresh() { - return lastSessionRefresh; - } - - public void setLastSessionRefresh(int lastSessionRefresh) { - this.lastSessionRefresh = lastSessionRefresh; - } - - public void addClientSession(ClientSessionEntity clientSession) { - if (clientSessions == null) { - clientSessions = new LinkedList(); - } - clientSessions.add(clientSession); - } - - public void removeClientSession(ClientSessionEntity clientSession) { - if (clientSessions != null) { - clientSessions.remove(clientSession); - } - } - - public List getClientSessions() { - return clientSessions; - } - - public Map getNotes() { - return notes; - } - - public UserSessionModel.State getState() { - return state; - } - - public void setState(UserSessionModel.State state) { - this.state = state; - } - - public String getBrokerSessionId() { - return brokerSessionId; - } - - public void setBrokerSessionId(String brokerSessionId) { - this.brokerSessionId = brokerSessionId; - } - - public String getBrokerUserId() { - return brokerUserId; - } - - public void setBrokerUserId(String brokerUserId) { - this.brokerUserId = brokerUserId; - } -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureEntity.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureEntity.java deleted file mode 100644 index f49153f132..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureEntity.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat.entities; - -import java.util.concurrent.atomic.AtomicInteger; -import java.util.concurrent.atomic.AtomicLong; -import java.util.concurrent.atomic.AtomicReference; - -/** - * @author Stian Thorgersen - */ -public class UsernameLoginFailureEntity { - - private String username; - private String realm; - - private AtomicInteger failedLoginNotBefore = new AtomicInteger(); - private AtomicInteger numFailures = new AtomicInteger(); - private AtomicLong lastFailure = new AtomicLong(); - private AtomicReference lastIpFailure = new AtomicReference(); - - public UsernameLoginFailureEntity(String username, String realm) { - this.username = username; - this.realm = realm; - } - - public String getUsername() { - return username; - } - - public String getRealm() { - return realm; - } - - public AtomicInteger getFailedLoginNotBefore() { - return failedLoginNotBefore; - } - - public void setFailedLoginNotBefore(AtomicInteger failedLoginNotBefore) { - this.failedLoginNotBefore = failedLoginNotBefore; - } - - public AtomicInteger getNumFailures() { - return numFailures; - } - - public void setNumFailures(AtomicInteger numFailures) { - this.numFailures = numFailures; - } - - public AtomicLong getLastFailure() { - return lastFailure; - } - - public void setLastFailure(AtomicLong lastFailure) { - this.lastFailure = lastFailure; - } - - public AtomicReference getLastIpFailure() { - return lastIpFailure; - } - - public void setLastIpFailure(AtomicReference lastIpFailure) { - this.lastIpFailure = lastIpFailure; - } - - public void clearFailures() { - this.failedLoginNotBefore = new AtomicInteger(); - this.lastFailure = new AtomicLong(); - this.lastIpFailure = new AtomicReference(); - this.numFailures = new AtomicInteger(); - } - -} diff --git a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureKey.java b/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureKey.java deleted file mode 100644 index 7ec3832a18..0000000000 --- a/model/sessions-infinispan/src/main/java/org/keycloak/models/sessions/infinispan/compat/entities/UsernameLoginFailureKey.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.keycloak.models.sessions.infinispan.compat.entities; - -/** - * @author Stian Thorgersen - */ -public class UsernameLoginFailureKey { - - private final String realm; - private final String username; - - public UsernameLoginFailureKey(String realm, String username) { - this.realm = realm; - this.username = username; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - UsernameLoginFailureKey key = (UsernameLoginFailureKey) o; - - if (realm != null ? !realm.equals(key.realm) : key.realm != null) return false; - if (username != null ? !username.equals(key.username) : key.username != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = realm != null ? realm.hashCode() : 0; - result = 31 * result + (username != null ? username.hashCode() : 0); - return result; - } - -} diff --git a/pom.xml b/pom.xml index a13138bbc0..271ef3c438 100755 --- a/pom.xml +++ b/pom.xml @@ -53,6 +53,8 @@ 2.0.5.Final 1.1.0.Final + 7.0.0.Beta + 7.5.0.Final-redhat-15 @@ -832,11 +834,6 @@ keycloak-as7-subsystem ${project.version} - - org.keycloak - keycloak-eap6-server-subsystem - ${project.version} - org.keycloak keycloak-wf8-subsystem @@ -1117,12 +1114,6 @@ keycloak-timer-basic ${project.version} - - org.keycloak - keycloak-server-modules-eap6 - ${project.version} - zip - org.keycloak keycloak-saml-as7-modules @@ -1171,12 +1162,6 @@ ${project.version} zip - - org.keycloak - keycloak-server-overlay-eap6 - ${project.version} - zip - org.keycloak keycloak-server-dist diff --git a/testsuite/integration/src/test/resources/META-INF/keycloak-server.json b/testsuite/integration/src/test/resources/META-INF/keycloak-server.json index 41c2cf5fa2..8ea3789b1b 100755 --- a/testsuite/integration/src/test/resources/META-INF/keycloak-server.json +++ b/testsuite/integration/src/test/resources/META-INF/keycloak-server.json @@ -22,12 +22,6 @@ "provider": "${keycloak.user.provider:jpa}" }, - "userSessions": { - "infinispan": { - "enforceCompat": "${keycloak.connectionsInfinispan.enforceCompat:false}" - } - }, - "userSessionPersister": { "provider": "${keycloak.userSessionPersister.provider:jpa}" }, diff --git a/wildfly/pom.xml b/wildfly/pom.xml index c9789a0c6f..4582d87156 100755 --- a/wildfly/pom.xml +++ b/wildfly/pom.xml @@ -17,6 +17,5 @@ adduser extensions server-subsystem - server-eap6-subsystem diff --git a/wildfly/server-eap6-subsystem/pom.xml b/wildfly/server-eap6-subsystem/pom.xml deleted file mode 100755 index 2e991596aa..0000000000 --- a/wildfly/server-eap6-subsystem/pom.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - 4.0.0 - - - org.keycloak - keycloak-wildfly-parent - 1.9.0.CR1-SNAPSHOT - - - keycloak-eap6-server-subsystem - Keycloak EAP 6 Server Subsystem - - jar - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - true - - - jboss.home - ${jboss.home} - - - - **/*TestCase.java - - - - - - - - - org.jboss.as - jboss-as-naming - ${jboss.version} - - - org.jboss.as - jboss-as-server - ${jboss.version} - - - org.jboss.as - jboss-as-ee - ${jboss.version} - - - org.jboss.as - jboss-as-web - ${jboss.version} - - - org.jboss.logging - jboss-logging-annotations - ${jboss-logging-tools.version} - - provided - true - - - - org.jboss.logging - jboss-logging-processor - - provided - true - - - org.jboss.msc - jboss-msc - 1.0.2.GA - - - junit - junit - test - - - diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakAdapterConfigService.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakAdapterConfigService.java deleted file mode 100755 index 9e13799f16..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakAdapterConfigService.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -/** - * This service keeps track of the entire Keycloak management model so as to provide - * adapter configuration to each deployment at deploy time. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public final class KeycloakAdapterConfigService { - - static final KeycloakAdapterConfigService INSTANCE = new KeycloakAdapterConfigService(); - - static final String DEPLOYMENT_NAME = "keycloak-server"; - - private String webContext; - - - private KeycloakAdapterConfigService() { - } - - void setWebContext(String webContext) { - this.webContext = webContext; - } - - String getWebContext() { - return webContext; - } - - boolean isKeycloakServerDeployment(String deploymentName) { - return DEPLOYMENT_NAME.equals(deploymentName); - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakExtension.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakExtension.java deleted file mode 100755 index 296faa5671..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakExtension.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import org.jboss.as.controller.Extension; -import org.jboss.as.controller.ExtensionContext; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.ResourceDefinition; -import org.jboss.as.controller.SubsystemRegistration; -import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver; -import org.jboss.as.controller.parsing.ExtensionParsingContext; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; -import static org.keycloak.subsystem.server.logging.KeycloakLogger.ROOT_LOGGER; - - -/** - * Main Extension class for the subsystem. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class KeycloakExtension implements Extension { - - static final String SUBSYSTEM_NAME = "keycloak-server"; - static final String NAMESPACE = "urn:jboss:domain:keycloak-server:1.1"; - static final PathElement PATH_SUBSYSTEM = PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME); - - private static final String RESOURCE_NAME = KeycloakExtension.class.getPackage().getName() + ".LocalDescriptions"; - private static final ResourceDefinition KEYCLOAK_SUBSYSTEM_RESOURCE = new KeycloakSubsystemDefinition(); - private static final KeycloakSubsystemParser PARSER = new KeycloakSubsystemParser(); - private static final int MGMT_API_VERSION_MAJOR = 1; - private static final int MGMT_API_VERSION_MINOR = 1; - - static StandardResourceDescriptionResolver getResourceDescriptionResolver(final String... keyPrefix) { - StringBuilder prefix = new StringBuilder(SUBSYSTEM_NAME); - for (String kp : keyPrefix) { - prefix.append('.').append(kp); - } - return new StandardResourceDescriptionResolver(prefix.toString(), RESOURCE_NAME, KeycloakExtension.class.getClassLoader(), true, false); - } - - /** - * {@inheritDoc} - */ - @Override - public void initializeParsers(final ExtensionParsingContext context) { - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, NAMESPACE, PARSER); - } - - /** - * {@inheritDoc} - */ - @Override - public void initialize(final ExtensionContext context) { - ROOT_LOGGER.debug("Activating Keycloak Extension"); - final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, MGMT_API_VERSION_MAJOR, MGMT_API_VERSION_MINOR); - - subsystem.registerSubsystemModel(KEYCLOAK_SUBSYSTEM_RESOURCE); - subsystem.registerXMLElementWriter(PARSER); - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakServerDeploymentProcessor.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakServerDeploymentProcessor.java deleted file mode 100644 index 145071d280..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakServerDeploymentProcessor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import org.jboss.as.ee.component.EEModuleDescription; -import org.jboss.as.server.deployment.DeploymentPhaseContext; -import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.server.deployment.DeploymentUnitProcessingException; -import org.jboss.as.server.deployment.DeploymentUnitProcessor; - -/** - * DUP responsible for setting the web context of a Keycloak auth server. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public class KeycloakServerDeploymentProcessor implements DeploymentUnitProcessor { - - @Override - public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { - DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); - KeycloakAdapterConfigService config = KeycloakAdapterConfigService.INSTANCE; - String deploymentName = deploymentUnit.getName(); - - if (!config.isKeycloakServerDeployment(deploymentName)) { - return; - } - - final EEModuleDescription description = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION); - String webContext = config.getWebContext(); - if (webContext == null) { - throw new DeploymentUnitProcessingException("Can't determine web context/module for Keycloak Server"); - } - description.setModuleName(webContext); - } - - @Override - public void undeploy(DeploymentUnit du) { - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemAdd.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemAdd.java deleted file mode 100755 index 19d7aa2a6b..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemAdd.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import org.jboss.as.controller.AbstractBoottimeAddStepHandler; -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.as.controller.ServiceVerificationHandler; -import org.jboss.as.controller.registry.Resource; -import org.jboss.as.server.AbstractDeploymentChainStep; -import org.jboss.as.server.DeploymentProcessorTarget; -import org.jboss.as.server.deployment.Phase; -import org.jboss.dmr.ModelNode; - -import org.jboss.msc.service.ServiceController; - -import java.util.List; - -import static org.keycloak.subsystem.server.as7.KeycloakExtension.SUBSYSTEM_NAME; - -/** - * The Keycloak subsystem add update handler. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -class KeycloakSubsystemAdd extends AbstractBoottimeAddStepHandler { - - static final KeycloakSubsystemAdd INSTANCE = new KeycloakSubsystemAdd(); - - @Override - protected void performBoottime(final OperationContext context, final ModelNode operation, final ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) { - context.addStep(new AbstractDeploymentChainStep() { - @Override - protected void execute(DeploymentProcessorTarget processorTarget) { - processorTarget.addDeploymentProcessor(SUBSYSTEM_NAME, - Phase.POST_MODULE, // PHASE - Phase.POST_MODULE_VALIDATOR_FACTORY - 1, // PRIORITY - new KeycloakServerDeploymentProcessor()); - } - }, OperationContext.Stage.RUNTIME); - } - - protected void populateModel(final OperationContext context, final ModelNode operation, final Resource resource) throws OperationFailedException { - ModelNode model = resource.getModel(); - - // set attribute values from parsed model - for (AttributeDefinition attrDef : KeycloakSubsystemDefinition.ALL_ATTRIBUTES) { - attrDef.validateAndSet(operation, model); - } - - // returns early if on domain controller - if (!requiresRuntime(context)) { - return; - } - - // don't want to try to start server on host controller - if (!context.isNormalServer()) { - return; - } - - ModelNode webContextNode = resource.getModel().get(KeycloakSubsystemDefinition.WEB_CONTEXT.getName()); - if (!webContextNode.isDefined()) { - webContextNode = KeycloakSubsystemDefinition.WEB_CONTEXT.getDefaultValue(); - } - String webContext = webContextNode.asString(); - - ServerUtil serverUtil = new ServerUtil(operation); - serverUtil.addStepToUploadServerWar(context); - KeycloakAdapterConfigService.INSTANCE.setWebContext(webContext); - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemDefinition.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemDefinition.java deleted file mode 100644 index 832aa92b59..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemDefinition.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.as.controller.SimpleResourceDefinition; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.dmr.ModelNode; -import org.jboss.dmr.ModelType; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Definition of subsystem=keycloak-server. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class KeycloakSubsystemDefinition extends SimpleResourceDefinition { - - static final SimpleAttributeDefinition WEB_CONTEXT = - new SimpleAttributeDefinitionBuilder("web-context", ModelType.STRING, true) - .setAllowExpression(true) - .setDefaultValue(new ModelNode("auth")) - .setRestartAllServices() - .build(); - - static final List ALL_ATTRIBUTES = new ArrayList(); - - static { - ALL_ATTRIBUTES.add(WEB_CONTEXT); - } - - private static final Map DEFINITION_LOOKUP = new HashMap(); - static { - for (SimpleAttributeDefinition def : ALL_ATTRIBUTES) { - DEFINITION_LOOKUP.put(def.getXmlName(), def); - } - } - - private static KeycloakSubsystemWriteAttributeHandler attrHandler = new KeycloakSubsystemWriteAttributeHandler(ALL_ATTRIBUTES); - - protected KeycloakSubsystemDefinition() { - super(KeycloakExtension.PATH_SUBSYSTEM, - KeycloakExtension.getResourceDescriptionResolver("subsystem"), - KeycloakSubsystemAdd.INSTANCE, - KeycloakSubsystemRemoveHandler.INSTANCE - ); - } - - @Override - public void registerOperations(ManagementResourceRegistration resourceRegistration) { - super.registerOperations(resourceRegistration); - resourceRegistration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); - } - - @Override - public void registerAttributes(ManagementResourceRegistration resourceRegistration) { - super.registerAttributes(resourceRegistration); - for (AttributeDefinition attrDef : ALL_ATTRIBUTES) { - resourceRegistration.registerReadWriteAttribute(attrDef, null, attrHandler); - } - } - - public static SimpleAttributeDefinition lookup(String name) { - return DEFINITION_LOOKUP.get(name); - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemParser.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemParser.java deleted file mode 100755 index 05bd55314f..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemParser.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.operations.common.Util; -import org.jboss.as.controller.parsing.ParseUtils; -import org.jboss.as.controller.persistence.SubsystemMarshallingContext; -import org.jboss.dmr.ModelNode; -import org.jboss.staxmapper.XMLElementReader; -import org.jboss.staxmapper.XMLElementWriter; -import org.jboss.staxmapper.XMLExtendedStreamReader; -import org.jboss.staxmapper.XMLExtendedStreamWriter; - -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import java.util.List; - -import static org.keycloak.subsystem.server.as7.KeycloakExtension.PATH_SUBSYSTEM; -import static org.keycloak.subsystem.server.as7.KeycloakSubsystemDefinition.WEB_CONTEXT; - -/** - * The subsystem parser, which uses stax to read and write to and from xml - */ -class KeycloakSubsystemParser implements XMLStreamConstants, XMLElementReader>, XMLElementWriter { - - /** - * {@inheritDoc} - */ - @Override - public void readElement(final XMLExtendedStreamReader reader, final List list) throws XMLStreamException { - // Require no attributes - ParseUtils.requireNoAttributes(reader); - ModelNode addKeycloakSub = Util.createAddOperation(PathAddress.pathAddress(PATH_SUBSYSTEM)); - list.add(addKeycloakSub); - - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - if (reader.getLocalName().equals(WEB_CONTEXT.getXmlName())) { - WEB_CONTEXT.parseAndSetParameter(reader.getElementText(), addKeycloakSub, reader); - } else { - throw new XMLStreamException("Unknown keycloak-server subsystem tag: " + reader.getLocalName()); - } - } - } - - // used for debugging - private int nextTag(XMLExtendedStreamReader reader) throws XMLStreamException { - return reader.nextTag(); - } - - /** - * {@inheritDoc} - */ - @Override - public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { - context.startSubsystemElement(KeycloakExtension.NAMESPACE, false); - writeWebContext(writer, context); - writer.writeEndElement(); - } - - private void writeWebContext(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException { - if (!context.getModelNode().get(WEB_CONTEXT.getName()).isDefined()) { - return; - } - - WEB_CONTEXT.marshallAsElement(context.getModelNode(), writer); - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemRemoveHandler.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemRemoveHandler.java deleted file mode 100644 index a112b4c681..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemRemoveHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.as.controller.OperationStepHandler; -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; -import org.jboss.as.controller.operations.common.Util; -import org.jboss.dmr.ModelNode; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REMOVE; -import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration; - -/** - * Remove an auth-server from a realm. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public final class KeycloakSubsystemRemoveHandler extends ReloadRequiredRemoveStepHandler { - - static KeycloakSubsystemRemoveHandler INSTANCE = new KeycloakSubsystemRemoveHandler(); - - private KeycloakSubsystemRemoveHandler() {} - - @Override - protected void performRemove(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { - String deploymentName = ServerUtil.getDeploymentName(operation); - KeycloakAdapterConfigService.INSTANCE.setWebContext(null); - - if (requiresRuntime(context)) { // don't do this on a domain controller - addStepToRemoveServerWar(context, deploymentName); - } - - super.performRemove(context, operation, model); - } - - private void addStepToRemoveServerWar(OperationContext context, String deploymentName) { - PathAddress deploymentAddress = PathAddress.pathAddress(PathElement.pathElement(DEPLOYMENT, deploymentName)); - ModelNode op = Util.createOperation(REMOVE, deploymentAddress); - context.addStep(op, getRemoveHandler(context, deploymentAddress), OperationContext.Stage.MODEL); - } - - private OperationStepHandler getRemoveHandler(OperationContext context, PathAddress address) { - ImmutableManagementResourceRegistration rootResourceRegistration = context.getRootResourceRegistration(); - return rootResourceRegistration.getOperationHandler(address, REMOVE); - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemWriteAttributeHandler.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemWriteAttributeHandler.java deleted file mode 100755 index 0200254395..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/KeycloakSubsystemWriteAttributeHandler.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinition; - -import java.util.List; -import org.jboss.as.controller.ModelOnlyWriteAttributeHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.as.controller.registry.Resource; -import org.jboss.dmr.ModelNode; - -/** - * Update an attribute on an Auth Server. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public class KeycloakSubsystemWriteAttributeHandler extends ModelOnlyWriteAttributeHandler { //extends ReloadRequiredWriteAttributeHandler { - - public KeycloakSubsystemWriteAttributeHandler(List definitions) { - this(definitions.toArray(new AttributeDefinition[definitions.size()])); - } - - public KeycloakSubsystemWriteAttributeHandler(AttributeDefinition... definitions) { - super(definitions); - } - - @Override - protected void finishModelStage(OperationContext context, ModelNode operation, String attributeName, ModelNode newValue, ModelNode oldValue, Resource model) throws OperationFailedException { - if (!context.isNormalServer() || attribNotChanging(attributeName, newValue, oldValue)) { - super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); - return; - } - - String deploymentName = ServerUtil.getDeploymentName(operation); - - if (attributeName.equals(KeycloakSubsystemDefinition.WEB_CONTEXT.getName())) { - KeycloakAdapterConfigService.INSTANCE.setWebContext(newValue.asString()); - ServerUtil.addStepToRedeployServerWar(context, deploymentName); - } - - super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); - } - - private boolean attribNotChanging(String attributeName, ModelNode newValue, ModelNode oldValue) { - SimpleAttributeDefinition attribDef = KeycloakSubsystemDefinition.lookup(attributeName); - if (!oldValue.isDefined()) { - oldValue = attribDef.getDefaultValue(); - } - if (!newValue.isDefined()) { - newValue = attribDef.getDefaultValue(); - } - return newValue.equals(oldValue); - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/ServerUtil.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/ServerUtil.java deleted file mode 100644 index 2e46b109cc..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/as7/ServerUtil.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright 2014 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.as7; - -import java.io.File; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.as.controller.OperationStepHandler; -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.PathElement; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ARCHIVE; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.CONTENT; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DEPLOYMENT; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ENABLED; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PERSISTENT; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.PATH; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REDEPLOY; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.RUNTIME_NAME; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.URL; -import org.jboss.as.controller.operations.common.Util; -import org.jboss.as.controller.registry.ImmutableManagementResourceRegistration; - -import org.jboss.dmr.ModelNode; -import org.jboss.modules.Module; -import org.jboss.modules.ModuleIdentifier; -import org.jboss.modules.ModuleLoadException; - -/** - * Utility methods that help assemble and start an auth server. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public class ServerUtil { - - private static final ModuleIdentifier KEYCLOAK_SUBSYSTEM = ModuleIdentifier.create("org.keycloak.keycloak-server-subsystem"); - - private final String deploymentName; - private final Module subsysModule; - private final URI serverWar; - - ServerUtil(ModelNode operation) { - this.deploymentName = getDeploymentName(operation); - this.subsysModule = findSubsysModule(); - this.serverWar = findServerWarUri(); - } - - private Module findSubsysModule() { - try { - return Module.getModuleFromCallerModuleLoader(KEYCLOAK_SUBSYSTEM); - } catch (ModuleLoadException e) { - throw new IllegalStateException("Can't find Keycloak subsystem.", e); - } - } - - private URI findServerWarUri() throws IllegalStateException { - try { - URL subsysResource = this.subsysModule.getExportedResource("module.xml"); - File subsysDir = new File(subsysResource.toURI()).getParentFile(); - File serverWarDir = new File(subsysDir, "server-war"); - return serverWarDir.toURI(); - } catch (URISyntaxException e) { - throw new IllegalStateException(e); - } catch (IllegalArgumentException e) { - throw new IllegalStateException(e); - } - } - - void addStepToUploadServerWar(OperationContext context) throws OperationFailedException { - PathAddress deploymentAddress = deploymentAddress(deploymentName); - ModelNode op = Util.createOperation(ADD, deploymentAddress); - - // this is required for deployment to take place - op.get(ENABLED).set(true); - - // prevents writing this deployment out to standalone.xml - op.get(PERSISTENT).set(false); - - // Owner attribute is valid starting with WidlFly 9. Ignored in WildFly 8 - op.get("owner").set(new ModelNode().add("subsystem", KeycloakExtension.SUBSYSTEM_NAME)); - - if (serverWar == null) { - throw new OperationFailedException("Keycloak Server WAR not found in keycloak-server-subsystem module"); - } - - op.get(CONTENT).add(makeContentItem()); - - context.addStep(op, getHandler(context, deploymentAddress, ADD), OperationContext.Stage.MODEL); - } - - private ModelNode makeContentItem() throws OperationFailedException { - ModelNode contentItem = new ModelNode(); - - String urlString = new File(serverWar).getAbsolutePath(); - contentItem.get(PATH).set(urlString); - contentItem.get(ARCHIVE).set(false); - - return contentItem; - } - - static void addStepToRedeployServerWar(OperationContext context, String deploymentName) { - addDeploymentAction(context, REDEPLOY, deploymentName); - } - - private static void addDeploymentAction(OperationContext context, String operation, String deploymentName) { - if (!context.isNormalServer()) { - return; - } - PathAddress deploymentAddress = deploymentAddress(deploymentName); - ModelNode op = Util.createOperation(operation, deploymentAddress); - op.get(RUNTIME_NAME).set(deploymentName); - context.addStep(op, getHandler(context, deploymentAddress, operation), OperationContext.Stage.MODEL); - } - - private static PathAddress deploymentAddress(String deploymentName) { - return PathAddress.pathAddress(PathElement.pathElement(DEPLOYMENT, deploymentName)); - } - - static OperationStepHandler getHandler(OperationContext context, PathAddress address, String opName) { - ImmutableManagementResourceRegistration rootResourceRegistration = context.getRootResourceRegistration(); - return rootResourceRegistration.getOperationHandler(address, opName); - } - - static String getDeploymentName(ModelNode operation) { - String deploymentName = Util.getNameFromAddress(operation.get(ADDRESS)); - if (!deploymentName.toLowerCase().endsWith(".war")) { - deploymentName += ".war"; - } - - return deploymentName; - } -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java deleted file mode 100755 index bf6053b60a..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakLogger.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.logging; - -import org.jboss.logging.BasicLogger; -import org.jboss.logging.Logger; -import org.jboss.logging.annotations.LogMessage; -import org.jboss.logging.annotations.Message; -import org.jboss.logging.annotations.MessageLogger; - -import static org.jboss.logging.Logger.Level.INFO; - -/** - * This interface to be fleshed out later when error messages are fully externalized. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -@MessageLogger(projectCode = "KEYCLOAK") -public interface KeycloakLogger extends BasicLogger { - - /** - * A logger with a category of the package name. - */ - KeycloakLogger ROOT_LOGGER = Logger.getMessageLogger(KeycloakLogger.class, "org.jboss.keycloak"); -} diff --git a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakMessages.java b/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakMessages.java deleted file mode 100755 index 710c05420a..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/java/org/keycloak/subsystem/server/logging/KeycloakMessages.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2013 Red Hat Inc. and/or its affiliates and other contributors - * as indicated by the @author tags. All rights reserved. - * - * 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.subsystem.server.logging; - -import org.jboss.logging.Messages; -import org.jboss.logging.annotations.MessageBundle; - -/** - * This interface to be fleshed out later when error messages are fully externalized. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2012 Red Hat Inc. - */ -@MessageBundle(projectCode = "KEYCLOAK") -public interface KeycloakMessages { - - /** - * The messages - */ - KeycloakMessages MESSAGES = Messages.getBundle(KeycloakMessages.class); -} diff --git a/wildfly/server-eap6-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension b/wildfly/server-eap6-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension deleted file mode 100644 index e69bf09a0d..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension +++ /dev/null @@ -1 +0,0 @@ -org.keycloak.subsystem.server.as7.KeycloakExtension diff --git a/wildfly/server-eap6-subsystem/src/main/resources/org/keycloak/subsystem/server/as7/LocalDescriptions.properties b/wildfly/server-eap6-subsystem/src/main/resources/org/keycloak/subsystem/server/as7/LocalDescriptions.properties deleted file mode 100755 index 909e6b3818..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/resources/org/keycloak/subsystem/server/as7/LocalDescriptions.properties +++ /dev/null @@ -1,4 +0,0 @@ -keycloak-server.subsystem=Keycloak subsystem -keycloak-server.subsystem.add=Operation Adds Keycloak subsystem -keycloak-server.subsystem.remove=Operation removes Keycloak subsystem -keycloak-server.subsystem.web-context=Web context where Keycloak server is bound. Default value is 'auth'. diff --git a/wildfly/server-eap6-subsystem/src/main/resources/schema/wildfly-keycloak-server_1_1.xsd b/wildfly/server-eap6-subsystem/src/main/resources/schema/wildfly-keycloak-server_1_1.xsd deleted file mode 100755 index b346d36162..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/resources/schema/wildfly-keycloak-server_1_1.xsd +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-datasources.xml b/wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-datasources.xml deleted file mode 100644 index 114545f388..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-datasources.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - org.jboss.as.connector - - - - jdbc:h2:${jboss.server.data.dir}/keycloak;AUTO_SERVER=TRUE - h2 - - sa - sa - - - - - org.h2.jdbcx.JdbcDataSource - - - - - diff --git a/wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-server.xml b/wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-server.xml deleted file mode 100644 index 4a83086787..0000000000 --- a/wildfly/server-eap6-subsystem/src/main/resources/subsystem-templates/keycloak-server.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - org.keycloak.keycloak-server-subsystem - - auth - - diff --git a/wildfly/server-eap6-subsystem/src/test/resources/org/keycloak/subsystem/server/extension/keycloak-server-1.1.xml b/wildfly/server-eap6-subsystem/src/test/resources/org/keycloak/subsystem/server/extension/keycloak-server-1.1.xml deleted file mode 100644 index bc8f11a778..0000000000 --- a/wildfly/server-eap6-subsystem/src/test/resources/org/keycloak/subsystem/server/extension/keycloak-server-1.1.xml +++ /dev/null @@ -1,3 +0,0 @@ - - auth - \ No newline at end of file