From 9a5b85910a98a5f72cb3479744ec619619a047ba Mon Sep 17 00:00:00 2001 From: vramik Date: Tue, 21 May 2019 16:11:13 +0200 Subject: [PATCH] KEYCLOAK-9599 Remove Wildfly 8 adapter --- adapters/oidc/wildfly/pom.xml | 14 - adapters/oidc/wildfly/wf8-subsystem/pom.xml | 110 ------- .../wf8/extension/CredentialAddHandler.java | 47 --- .../wf8/extension/CredentialDefinition.java | 61 ---- .../CredentialReadWriteAttributeHandler.java | 50 --- .../extension/CredentialRemoveHandler.java | 42 --- ...cloakAdapterConfigDeploymentProcessor.java | 129 -------- .../KeycloakAdapterConfigService.java | 230 -------------- .../KeycloakDependencyProcessor.java | 85 ----- .../KeycloakDependencyProcessorWildFly.java | 41 --- .../wf8/extension/KeycloakExtension.java | 84 ----- .../wf8/extension/KeycloakSubsystemAdd.java | 62 ---- .../KeycloakSubsystemDefinition.java | 45 --- .../extension/KeycloakSubsystemParser.java | 295 ------------------ .../wf8/extension/RealmAddHandler.java | 66 ---- .../wf8/extension/RealmDefinition.java | 87 ------ .../wf8/extension/RealmRemoveHandler.java | 41 --- .../extension/RealmWriteAttributeHandler.java | 54 ---- .../extension/SecureDeploymentAddHandler.java | 61 ---- .../extension/SecureDeploymentDefinition.java | 159 ---------- .../SecureDeploymentRemoveHandler.java | 41 --- ...SecureDeploymentWriteAttributeHandler.java | 59 ---- .../extension/SharedAttributeDefinitons.java | 265 ---------------- .../subsystem/wf8/logging/KeycloakLogger.java | 45 --- .../wf8/logging/KeycloakMessages.java | 34 -- .../org.jboss.as.controller.Extension | 18 -- .../extension/LocalDescriptions.properties | 101 ------ .../resources/schema/wildfly-keycloak_1_1.xsd | 135 -------- .../subsystem-templates/keycloak-adapter.xml | 24 -- .../extension/RealmDefinitionTestCase.java | 86 ----- .../extension/SubsystemParsingTestCase.java | 97 ------ .../subsystem/wf8/extension/keycloak-1.1.xml | 49 --- distribution/adapters/pom.xml | 2 - distribution/adapters/wf8-adapter/pom.xml | 37 --- .../wf8-adapter/wf8-adapter-zip/assembly.xml | 56 ---- .../wf8-adapter/wf8-adapter-zip/pom.xml | 93 ------ .../wf8-adapter/wf8-modules/assembly.xml | 39 --- .../wf8-adapter/wf8-modules/build.xml | 97 ------ .../adapters/wf8-adapter/wf8-modules/lib.xml | 277 ---------------- .../adapters/wf8-adapter/wf8-modules/pom.xml | 199 ------------ .../org/apache/httpcomponents/4.3/module.xml | 31 -- .../keycloak-adapter-core/main/module.xml | 40 --- .../keycloak-adapter-spi/main/module.xml | 37 --- .../main/module.xml | 33 -- .../keycloak-authz-client/main/module.xml | 42 --- .../keycloak/keycloak-common/main/module.xml | 34 -- .../keycloak/keycloak-core/main/module.xml | 38 --- .../main/module.xml | 34 -- .../main/module.xml | 36 --- .../keycloak-undertow-adapter/main/module.xml | 48 --- .../keycloak-wf8-subsystem/main/module.xml | 43 --- .../keycloak-wildfly-adapter/main/module.xml | 49 --- .../downloads/src/main/resources/files | 3 +- pom.xml | 18 -- 54 files changed, 1 insertion(+), 4002 deletions(-) delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/pom.xml delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialAddHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialDefinition.java delete mode 100644 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialReadWriteAttributeHandler.java delete mode 100644 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialRemoveHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigDeploymentProcessor.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessor.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessorWildFly.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java delete mode 100644 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemDefinition.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemParser.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmAddHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmDefinition.java delete mode 100644 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmRemoveHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmWriteAttributeHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentAddHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentDefinition.java delete mode 100644 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentRemoveHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentWriteAttributeHandler.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakLogger.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakMessages.java delete mode 100644 adapters/oidc/wildfly/wf8-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd delete mode 100644 adapters/oidc/wildfly/wf8-subsystem/src/main/resources/subsystem-templates/keycloak-adapter.xml delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/RealmDefinitionTestCase.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/SubsystemParsingTestCase.java delete mode 100755 adapters/oidc/wildfly/wf8-subsystem/src/test/resources/org/keycloak/subsystem/wf8/extension/keycloak-1.1.xml delete mode 100644 distribution/adapters/wf8-adapter/pom.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-adapter-zip/assembly.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-adapter-zip/pom.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/assembly.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/build.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/lib.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/pom.xml delete mode 100644 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/apache/httpcomponents/4.3/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-authz-client/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-servlet-oauth-client/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-undertow-adapter/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wf8-subsystem/main/module.xml delete mode 100755 distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adapter/main/module.xml diff --git a/adapters/oidc/wildfly/pom.xml b/adapters/oidc/wildfly/pom.xml index 93d6d5033c..445d1b3afd 100755 --- a/adapters/oidc/wildfly/pom.xml +++ b/adapters/oidc/wildfly/pom.xml @@ -34,18 +34,4 @@ wildfly-adapter wildfly-subsystem - - - - community - - - !product - - - - wf8-subsystem - - - \ No newline at end of file diff --git a/adapters/oidc/wildfly/wf8-subsystem/pom.xml b/adapters/oidc/wildfly/wf8-subsystem/pom.xml deleted file mode 100755 index 12a47ec64b..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - 4.0.0 - - - org.keycloak - keycloak-parent - 7.0.0-SNAPSHOT - ../../../../pom.xml - - - keycloak-wf8-subsystem - Keycloak Wildfly 8 Adapter Subsystem - - jar - - - 8.2.0.Final - 8.2.0.Final - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - true - - - jboss.home - ${jboss.home} - - - - **/*TestCase.java - - - - - - - - - org.wildfly - wildfly-controller - ${wildfly.version} - provided - - - org.wildfly - wildfly-server - ${wildfly.version} - provided - - - org.wildfly - wildfly-web-common - ${wildfly.version} - provided - - - org.jboss.logging - jboss-logging-annotations - ${jboss.logging.tools.wf8.version} - provided - - - - org.jboss.logging - jboss-logging-processor - ${jboss.logging.tools.wf8.version} - provided - - - - org.wildfly - wildfly-subsystem-test-framework - ${wildfly.version} - test - - - junit - junit - test - - - org.keycloak - keycloak-wildfly-adapter - ${project.version} - - - diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialAddHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialAddHandler.java deleted file mode 100755 index 9983af6818..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialAddHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractAddStepHandler; -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.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; - -import java.util.List; - -/** - * Add a credential to a deployment. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public class CredentialAddHandler extends AbstractAddStepHandler { - - public CredentialAddHandler(AttributeDefinition... attributes) { - super(attributes); - } - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.addCredential(operation, context.resolveExpressions(model)); - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialDefinition.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialDefinition.java deleted file mode 100755 index 319c0b7d24..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialDefinition.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.PathElement; -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.operations.validation.StringLengthValidator; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.dmr.ModelType; - -/** - * Defines attributes and operations for a credential. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class CredentialDefinition extends SimpleResourceDefinition { - - public static final String TAG_NAME = "credential"; - - protected static final AttributeDefinition VALUE = - new SimpleAttributeDefinitionBuilder("value", ModelType.STRING, false) - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, false, true)) - .build(); - - public CredentialDefinition() { - super(PathElement.pathElement(TAG_NAME), - KeycloakExtension.getResourceDescriptionResolver(TAG_NAME), - new CredentialAddHandler(VALUE), - CredentialRemoveHandler.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); - resourceRegistration.registerReadWriteAttribute(VALUE, null, new CredentialReadWriteAttributeHandler()); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialReadWriteAttributeHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialReadWriteAttributeHandler.java deleted file mode 100644 index 07bbbdb2e1..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialReadWriteAttributeHandler.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractWriteAttributeHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.dmr.ModelNode; - -/** - * Update a credential value. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public class CredentialReadWriteAttributeHandler extends AbstractWriteAttributeHandler { - - @Override - protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, - ModelNode resolvedValue, ModelNode currentValue, AbstractWriteAttributeHandler.HandbackHolder hh) throws OperationFailedException { - - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.updateCredential(operation, attributeName, resolvedValue); - - hh.setHandback(ckService); - - return false; - } - - @Override - protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, - ModelNode valueToRestore, ModelNode valueToRevert, KeycloakAdapterConfigService ckService) throws OperationFailedException { - ckService.updateCredential(operation, attributeName, valueToRestore); - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialRemoveHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialRemoveHandler.java deleted file mode 100644 index 5bd0716c20..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/CredentialRemoveHandler.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractRemoveStepHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.dmr.ModelNode; - -/** - * Remove a credential from a deployment. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public final class CredentialRemoveHandler extends AbstractRemoveStepHandler { - - public static CredentialRemoveHandler INSTANCE = new CredentialRemoveHandler(); - - private CredentialRemoveHandler() {} - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.removeCredential(operation); - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigDeploymentProcessor.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigDeploymentProcessor.java deleted file mode 100755 index cb341d2f99..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigDeploymentProcessor.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -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; -import org.jboss.as.web.common.WarMetaData; -import org.jboss.logging.Logger; -import org.jboss.metadata.javaee.spec.ParamValueMetaData; -import org.jboss.metadata.web.jboss.JBossWebMetaData; -import org.jboss.metadata.web.spec.LoginConfigMetaData; -import org.keycloak.subsystem.wf8.logging.KeycloakLogger; - -import java.util.ArrayList; -import java.util.List; - -/** - * Pass authentication data (keycloak.json) as a servlet context param so it can be read by the KeycloakServletExtension. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public class KeycloakAdapterConfigDeploymentProcessor implements DeploymentUnitProcessor { - protected Logger log = Logger.getLogger(KeycloakAdapterConfigDeploymentProcessor.class); - - // This param name is defined again in Keycloak Undertow Integration class - // org.keycloak.adapters.undertow.KeycloakServletExtension. We have this value in - // two places to avoid dependency between Keycloak Subsystem and Keyclaok Undertow Integration. - public static final String AUTH_DATA_PARAM_NAME = "org.keycloak.json.adapterConfig"; - - // not sure if we need this yet, keeping here just in case - protected void addSecurityDomain(DeploymentUnit deploymentUnit, KeycloakAdapterConfigService service) { - if (!service.isSecureDeployment(deploymentUnit)) { - return; - } - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) return; - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) return; - - LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - if (loginConfig == null || !loginConfig.getAuthMethod().equalsIgnoreCase("KEYCLOAK")) { - return; - } - - webMetaData.setSecurityDomain("keycloak"); - } - - @Override - public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { - DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); - - KeycloakAdapterConfigService service = KeycloakAdapterConfigService.getInstance(); - if (service.isSecureDeployment(deploymentUnit) && service.isDeploymentConfigured(deploymentUnit)) { - addKeycloakAuthData(phaseContext, service); - } - - // FYI, Undertow Extension will find deployments that have auth-method set to KEYCLOAK - - // todo notsure if we need this - // addSecurityDomain(deploymentUnit, service); - } - - private void addKeycloakAuthData(DeploymentPhaseContext phaseContext, KeycloakAdapterConfigService service) throws DeploymentUnitProcessingException { - DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - throw new DeploymentUnitProcessingException("WarMetaData not found for " + deploymentUnit.getName() + ". Make sure you have specified a WAR as your secure-deployment in the Keycloak subsystem."); - } - - addJSONData(service.getJSON(deploymentUnit), warMetaData); - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - webMetaData = new JBossWebMetaData(); - warMetaData.setMergedJBossWebMetaData(webMetaData); - } - - LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - if (loginConfig == null) { - loginConfig = new LoginConfigMetaData(); - webMetaData.setLoginConfig(loginConfig); - } - loginConfig.setAuthMethod("KEYCLOAK"); - loginConfig.setRealmName(service.getRealmName(deploymentUnit)); - KeycloakLogger.ROOT_LOGGER.deploymentSecured(deploymentUnit.getName()); - } - - private void addJSONData(String json, WarMetaData warMetaData) { - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - webMetaData = new JBossWebMetaData(); - warMetaData.setMergedJBossWebMetaData(webMetaData); - } - - List contextParams = webMetaData.getContextParams(); - if (contextParams == null) { - contextParams = new ArrayList(); - } - - ParamValueMetaData param = new ParamValueMetaData(); - param.setParamName(AUTH_DATA_PARAM_NAME); - param.setParamValue(json); - contextParams.add(param); - - webMetaData.setContextParams(contextParams); - } - - @Override - public void undeploy(DeploymentUnit du) { - - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java deleted file mode 100755 index 1ccd2a07d9..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakAdapterConfigService.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.web.common.WarMetaData; -import org.jboss.dmr.ModelNode; -import org.jboss.dmr.Property; -import org.jboss.metadata.web.jboss.JBossWebMetaData; - -import java.util.HashMap; -import java.util.Map; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADDRESS; - -/** - * 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 { - - private static final String CREDENTIALS_JSON_NAME = "credentials"; - - private static final KeycloakAdapterConfigService INSTANCE = new KeycloakAdapterConfigService(); - - public static KeycloakAdapterConfigService getInstance() { - return INSTANCE; - } - - private final Map realms = new HashMap(); - - // keycloak-secured deployments - private final Map secureDeployments = new HashMap(); - - - private KeycloakAdapterConfigService() { - } - - public void addRealm(ModelNode operation, ModelNode model) { - this.realms.put(realmNameFromOp(operation), model.clone()); - } - - public void updateRealm(ModelNode operation, String attrName, ModelNode resolvedValue) { - ModelNode realm = this.realms.get(realmNameFromOp(operation)); - realm.get(attrName).set(resolvedValue); - } - - public void removeRealm(ModelNode operation) { - this.realms.remove(realmNameFromOp(operation)); - } - - public void addSecureDeployment(ModelNode operation, ModelNode model) { - ModelNode deployment = model.clone(); - this.secureDeployments.put(deploymentNameFromOp(operation), deployment); - } - - public void updateSecureDeployment(ModelNode operation, String attrName, ModelNode resolvedValue) { - ModelNode deployment = this.secureDeployments.get(deploymentNameFromOp(operation)); - deployment.get(attrName).set(resolvedValue); - } - - public void removeSecureDeployment(ModelNode operation) { - this.secureDeployments.remove(deploymentNameFromOp(operation)); - } - - public void addCredential(ModelNode operation, ModelNode model) { - ModelNode credentials = credentialsFromOp(operation); - if (!credentials.isDefined()) { - credentials = new ModelNode(); - } - - String credentialName = credentialNameFromOp(operation); - if (!credentialName.contains(".")) { - credentials.get(credentialName).set(model.get("value").asString()); - } else { - String[] parts = credentialName.split("\\."); - String provider = parts[0]; - String property = parts[1]; - ModelNode credential = credentials.get(provider); - if (!credential.isDefined()) { - credential = new ModelNode(); - } - credential.get(property).set(model.get("value").asString()); - credentials.set(provider, credential); - } - - ModelNode deployment = this.secureDeployments.get(deploymentNameFromOp(operation)); - deployment.get(CREDENTIALS_JSON_NAME).set(credentials); - } - - public void removeCredential(ModelNode operation) { - ModelNode credentials = credentialsFromOp(operation); - if (!credentials.isDefined()) { - throw new RuntimeException("Can not remove credential. No credential defined for deployment in op " + operation.toString()); - } - - String credentialName = credentialNameFromOp(operation); - credentials.remove(credentialName); - } - - public void updateCredential(ModelNode operation, String attrName, ModelNode resolvedValue) { - ModelNode credentials = credentialsFromOp(operation); - if (!credentials.isDefined()) { - throw new RuntimeException("Can not update credential. No credential defined for deployment in op " + operation.toString()); - } - - String credentialName = credentialNameFromOp(operation); - credentials.get(credentialName).set(resolvedValue); - } - - private ModelNode credentialsFromOp(ModelNode operation) { - ModelNode deployment = this.secureDeployments.get(deploymentNameFromOp(operation)); - return deployment.get(CREDENTIALS_JSON_NAME); - } - - private String realmNameFromOp(ModelNode operation) { - return valueFromOpAddress(RealmDefinition.TAG_NAME, operation); - } - - private String deploymentNameFromOp(ModelNode operation) { - return valueFromOpAddress(SecureDeploymentDefinition.TAG_NAME, operation); - } - - private String credentialNameFromOp(ModelNode operation) { - return valueFromOpAddress(CredentialDefinition.TAG_NAME, operation); - } - - private String valueFromOpAddress(String addrElement, ModelNode operation) { - String deploymentName = getValueOfAddrElement(operation.get(ADDRESS), addrElement); - if (deploymentName == null) throw new RuntimeException("Can't find '" + addrElement + "' in address " + operation.toString()); - return deploymentName; - } - - private String getValueOfAddrElement(ModelNode address, String elementName) { - for (ModelNode element : address.asList()) { - if (element.has(elementName)) return element.get(elementName).asString(); - } - - return null; - } - - public String getRealmName(DeploymentUnit deploymentUnit) { - ModelNode deployment = getSecureDeployment(deploymentUnit); - return deployment.get(RealmDefinition.TAG_NAME).asString(); - - } - - protected boolean isDeploymentConfigured(DeploymentUnit deploymentUnit) { - ModelNode deployment = getSecureDeployment(deploymentUnit); - if (! deployment.isDefined()) { - return false; - } - ModelNode resource = deployment.get(SecureDeploymentDefinition.RESOURCE.getName()); - return resource.isDefined(); - } - - public String getJSON(DeploymentUnit deploymentUnit) { - ModelNode deployment = getSecureDeployment(deploymentUnit); - String realmName = deployment.get(RealmDefinition.TAG_NAME).asString(); - ModelNode realm = this.realms.get(realmName); - - ModelNode json = new ModelNode(); - json.get(RealmDefinition.TAG_NAME).set(realmName); - - // Realm values set first. Some can be overridden by deployment values. - if (realm != null) setJSONValues(json, realm); - setJSONValues(json, deployment); - return json.toJSONString(true); - } - - private void setJSONValues(ModelNode json, ModelNode values) { - for (Property prop : values.asPropertyList()) { - String name = prop.getName(); - ModelNode value = prop.getValue(); - if (value.isDefined()) { - json.get(name).set(value); - } - } - } - - public boolean isSecureDeployment(DeploymentUnit deploymentUnit) { - //log.info("********* CHECK KEYCLOAK DEPLOYMENT: deployments.size()" + deployments.size()); - - String deploymentName = preferredDeploymentName(deploymentUnit); - return this.secureDeployments.containsKey(deploymentName); - } - - private ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) { - String deploymentName = preferredDeploymentName(deploymentUnit); - return this.secureDeployments.containsKey(deploymentName) - ? this.secureDeployments.get(deploymentName) - : new ModelNode(); - } - - // KEYCLOAK-3273: prefer module name if available - private String preferredDeploymentName(DeploymentUnit deploymentUnit) { - String deploymentName = deploymentUnit.getName(); - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - return deploymentName; - } - - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - return deploymentName; - } - - String moduleName = webMetaData.getModuleName(); - if (moduleName != null) return moduleName + ".war"; - - return deploymentName; - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessor.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessor.java deleted file mode 100755 index 60d0856d4e..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessor.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.server.deployment.Attachments; -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; -import org.jboss.as.server.deployment.module.ModuleDependency; -import org.jboss.as.server.deployment.module.ModuleSpecification; -import org.jboss.as.web.common.WarMetaData; -import org.jboss.metadata.web.jboss.JBossWebMetaData; -import org.jboss.metadata.web.spec.LoginConfigMetaData; -import org.jboss.modules.Module; -import org.jboss.modules.ModuleIdentifier; -import org.jboss.modules.ModuleLoader; - -/** - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public abstract class KeycloakDependencyProcessor implements DeploymentUnitProcessor { - - private static final ModuleIdentifier KEYCLOAK_JBOSS_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-jboss-adapter-core"); - private static final ModuleIdentifier KEYCLOAK_CORE_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-adapter-core"); - private static final ModuleIdentifier KEYCLOAK_CORE = ModuleIdentifier.create("org.keycloak.keycloak-core"); - private static final ModuleIdentifier KEYCLOAK_COMMON = ModuleIdentifier.create("org.keycloak.keycloak-common"); - - @Override - public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { - final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); - - if (!KeycloakAdapterConfigService.getInstance().isSecureDeployment(deploymentUnit)) { - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - return; - } - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - return; - } - LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - if (loginConfig == null) return; - if (loginConfig.getAuthMethod() == null) return; - if (!loginConfig.getAuthMethod().equals("KEYCLOAK")) return; - } - - final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); - final ModuleLoader moduleLoader = Module.getBootModuleLoader(); - addCommonModules(moduleSpecification, moduleLoader); - addPlatformSpecificModules(moduleSpecification, moduleLoader); - } - - private void addCommonModules(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) { - // ModuleDependency(ModuleLoader moduleLoader, ModuleIdentifier identifier, boolean optional, boolean export, boolean importServices, boolean userSpecified) - moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_JBOSS_CORE_ADAPTER, false, false, false, false)); - moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_CORE_ADAPTER, false, false, false, false)); - moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_CORE, false, false, false, false)); - moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_COMMON, false, false, false, false)); - } - - abstract protected void addPlatformSpecificModules(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader); - - @Override - public void undeploy(DeploymentUnit du) { - - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessorWildFly.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessorWildFly.java deleted file mode 100755 index a3237b69e8..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakDependencyProcessorWildFly.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.server.deployment.module.ModuleDependency; -import org.jboss.as.server.deployment.module.ModuleSpecification; -import org.jboss.modules.ModuleIdentifier; -import org.jboss.modules.ModuleLoader; - -/** - * Add platform-specific modules for WildFly. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2014 Red Hat Inc. - */ -public class KeycloakDependencyProcessorWildFly extends KeycloakDependencyProcessor { - - private static final ModuleIdentifier KEYCLOAK_WILDFLY_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-wildfly-adapter"); - private static final ModuleIdentifier KEYCLOAK_UNDERTOW_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-undertow-adapter"); - - @Override - protected void addPlatformSpecificModules(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) { - // ModuleDependency(ModuleLoader moduleLoader, ModuleIdentifier identifier, boolean optional, boolean export, boolean importServices, boolean userSpecified) - moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_WILDFLY_ADAPTER, false, false, true, false)); - moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, KEYCLOAK_UNDERTOW_ADAPTER, false, false, false, false)); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java deleted file mode 100755 index b1959103c1..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakExtension.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -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 org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.keycloak.subsystem.wf8.logging.KeycloakLogger; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.SUBSYSTEM; - - -/** - * Main Extension class for the subsystem. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class KeycloakExtension implements Extension { - - public static final String SUBSYSTEM_NAME = "keycloak"; - public static final String NAMESPACE = "urn:jboss:domain:keycloak:1.1"; - private static final KeycloakSubsystemParser PARSER = new KeycloakSubsystemParser(); - static final PathElement PATH_SUBSYSTEM = PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME); - private static final String RESOURCE_NAME = KeycloakExtension.class.getPackage().getName() + ".LocalDescriptions"; - private static final int MANAGEMENT_API_MAJOR_VERSION = 1; - private static final int MANAGEMENT_API_MINOR_VERSION = 0; - private static final int MANAGEMENT_API_MICRO_VERSION = 0; - static final PathElement SUBSYSTEM_PATH = PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME); - private static final ResourceDefinition KEYCLOAK_SUBSYSTEM_RESOURCE = new KeycloakSubsystemDefinition(); - static final RealmDefinition REALM_DEFINITION = new RealmDefinition(); - static final SecureDeploymentDefinition SECURE_DEPLOYMENT_DEFINITION = new SecureDeploymentDefinition(); - static final CredentialDefinition CREDENTIAL_DEFINITION = new CredentialDefinition(); - - public 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, KeycloakExtension.NAMESPACE, PARSER); - } - - /** - * {@inheritDoc} - */ - @Override - public void initialize(final ExtensionContext context) { - KeycloakLogger.ROOT_LOGGER.debug("Activating Keycloak Extension"); - final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, MANAGEMENT_API_MAJOR_VERSION, MANAGEMENT_API_MINOR_VERSION, MANAGEMENT_API_MICRO_VERSION); - - ManagementResourceRegistration registration = subsystem.registerSubsystemModel(KEYCLOAK_SUBSYSTEM_RESOURCE); - registration.registerSubModel(REALM_DEFINITION); - ManagementResourceRegistration secureDeploymentRegistration = registration.registerSubModel(SECURE_DEPLOYMENT_DEFINITION); - secureDeploymentRegistration.registerSubModel(CREDENTIAL_DEFINITION); - - subsystem.registerXMLElementWriter(PARSER); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java deleted file mode 100755 index 1f895a05e4..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemAdd.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - - -import org.jboss.as.controller.AbstractBoottimeAddStepHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.ServiceVerificationHandler; -import org.jboss.as.server.AbstractDeploymentChainStep; -import org.jboss.as.server.DeploymentProcessorTarget; -import org.jboss.as.server.deployment.DeploymentUnitProcessor; -import org.jboss.as.server.deployment.Phase; -import org.jboss.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; - -import java.util.List; - -/** - * 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, ModelNode operation, final ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) { - context.addStep(new AbstractDeploymentChainStep() { - @Override - protected void execute(DeploymentProcessorTarget processorTarget) { - processorTarget.addDeploymentProcessor(KeycloakExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, 0, chooseDependencyProcessor()); - processorTarget.addDeploymentProcessor(KeycloakExtension.SUBSYSTEM_NAME, - Phase.POST_MODULE, // PHASE - Phase.POST_MODULE_VALIDATOR_FACTORY - 1, // PRIORITY - chooseConfigDeploymentProcessor()); - } - }, OperationContext.Stage.RUNTIME); - } - - private DeploymentUnitProcessor chooseDependencyProcessor() { - return new KeycloakDependencyProcessorWildFly(); - } - - private DeploymentUnitProcessor chooseConfigDeploymentProcessor() { - return new KeycloakAdapterConfigDeploymentProcessor(); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemDefinition.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemDefinition.java deleted file mode 100644 index f8b59433ed..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemDefinition.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; -import org.jboss.as.controller.SimpleResourceDefinition; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; - -/** - * Definition of subsystem=keycloak. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class KeycloakSubsystemDefinition extends SimpleResourceDefinition { - protected KeycloakSubsystemDefinition() { - super(KeycloakExtension.SUBSYSTEM_PATH, - KeycloakExtension.getResourceDescriptionResolver("subsystem"), - KeycloakSubsystemAdd.INSTANCE, - ReloadRequiredRemoveStepHandler.INSTANCE - ); - } - - @Override - public void registerOperations(ManagementResourceRegistration resourceRegistration) { - super.registerOperations(resourceRegistration); - resourceRegistration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemParser.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemParser.java deleted file mode 100755 index 79ddd72254..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/KeycloakSubsystemParser.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -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.dmr.Property; -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.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -/** - * 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(KeycloakExtension.PATH_SUBSYSTEM)); - list.add(addKeycloakSub); - - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - if (reader.getLocalName().equals(RealmDefinition.TAG_NAME)) { - readRealm(reader, list); - } - else if (reader.getLocalName().equals(SecureDeploymentDefinition.TAG_NAME)) { - readDeployment(reader, list); - } - } - } - - // used for debugging - private int nextTag(XMLExtendedStreamReader reader) throws XMLStreamException { - return reader.nextTag(); - } - - private void readRealm(XMLExtendedStreamReader reader, List list) throws XMLStreamException { - String realmName = readNameAttribute(reader); - ModelNode addRealm = new ModelNode(); - addRealm.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.ADD); - PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, KeycloakExtension.SUBSYSTEM_NAME), - PathElement.pathElement(RealmDefinition.TAG_NAME, realmName)); - addRealm.get(ModelDescriptionConstants.OP_ADDR).set(addr.toModelNode()); - - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - SimpleAttributeDefinition def = RealmDefinition.lookup(tagName); - if (def == null) throw new XMLStreamException("Unknown realm tag " + tagName); - def.parseAndSetParameter(reader.getElementText(), addRealm, reader); - } - - if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(addRealm)) { - //TODO: externalize the message - throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false."); - } - - list.add(addRealm); - } - - private void readDeployment(XMLExtendedStreamReader reader, List resourcesToAdd) throws XMLStreamException { - String name = readNameAttribute(reader); - ModelNode addSecureDeployment = new ModelNode(); - addSecureDeployment.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.ADD); - PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, KeycloakExtension.SUBSYSTEM_NAME), - PathElement.pathElement(SecureDeploymentDefinition.TAG_NAME, name)); - addSecureDeployment.get(ModelDescriptionConstants.OP_ADDR).set(addr.toModelNode()); - List credentialsToAdd = new ArrayList(); - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (tagName.equals(CredentialDefinition.TAG_NAME)) { - readCredential(reader, addr, credentialsToAdd); - continue; - } - - SimpleAttributeDefinition def = SecureDeploymentDefinition.lookup(tagName); - if (def == null) throw new XMLStreamException("Unknown secure-deployment tag " + tagName); - def.parseAndSetParameter(reader.getElementText(), addSecureDeployment, reader); - } - - - /** - * TODO need to check realm-ref first. - if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(addSecureDeployment)) { - //TODO: externalize the message - throw new XMLStreamException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false."); - } - */ - - // Must add credentials after the deployment is added. - resourcesToAdd.add(addSecureDeployment); - resourcesToAdd.addAll(credentialsToAdd); - } - - public void readCredential(XMLExtendedStreamReader reader, PathAddress parent, List credentialsToAdd) throws XMLStreamException { - String name = readNameAttribute(reader); - - Map values = new HashMap<>(); - String textValue = null; - while (reader.hasNext()) { - int next = reader.next(); - if (next == CHARACTERS) { - // text value of credential element (like for "secret" ) - String text = reader.getText(); - if (text == null || text.trim().isEmpty()) { - continue; - } - textValue = text; - } else if (next == START_ELEMENT) { - String key = reader.getLocalName(); - reader.next(); - String value = reader.getText(); - reader.next(); - - values.put(key, value); - } else if (next == END_ELEMENT) { - break; - } - } - - if (textValue != null) { - ModelNode addCredential = getCredentialToAdd(parent, name, textValue); - credentialsToAdd.add(addCredential); - } else { - for (Map.Entry entry : values.entrySet()) { - ModelNode addCredential = getCredentialToAdd(parent, name + "." + entry.getKey(), entry.getValue()); - credentialsToAdd.add(addCredential); - } - } - } - - private ModelNode getCredentialToAdd(PathAddress parent, String name, String value) { - ModelNode addCredential = new ModelNode(); - addCredential.get(ModelDescriptionConstants.OP).set(ModelDescriptionConstants.ADD); - PathAddress addr = PathAddress.pathAddress(parent, PathElement.pathElement(CredentialDefinition.TAG_NAME, name)); - addCredential.get(ModelDescriptionConstants.OP_ADDR).set(addr.toModelNode()); - addCredential.get(CredentialDefinition.VALUE.getName()).set(value); - return addCredential; - } - - // expects that the current tag will have one single attribute called "name" - private String readNameAttribute(XMLExtendedStreamReader reader) throws XMLStreamException { - String name = null; - for (int i = 0; i < reader.getAttributeCount(); i++) { - String attr = reader.getAttributeLocalName(i); - if (attr.equals("name")) { - name = reader.getAttributeValue(i); - continue; - } - throw ParseUtils.unexpectedAttribute(reader, i); - } - if (name == null) { - throw ParseUtils.missingRequired(reader, Collections.singleton("name")); - } - return name; - } - - /** - * {@inheritDoc} - */ - @Override - public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { - context.startSubsystemElement(KeycloakExtension.NAMESPACE, false); - writeRealms(writer, context); - writeSecureDeployments(writer, context); - writer.writeEndElement(); - } - - private void writeRealms(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException { - if (!context.getModelNode().get(RealmDefinition.TAG_NAME).isDefined()) { - return; - } - for (Property realm : context.getModelNode().get(RealmDefinition.TAG_NAME).asPropertyList()) { - writer.writeStartElement(RealmDefinition.TAG_NAME); - writer.writeAttribute("name", realm.getName()); - ModelNode realmElements = realm.getValue(); - for (AttributeDefinition element : RealmDefinition.ALL_ATTRIBUTES) { - element.marshallAsElement(realmElements, writer); - } - - writer.writeEndElement(); - } - } - - private void writeSecureDeployments(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException { - if (!context.getModelNode().get(SecureDeploymentDefinition.TAG_NAME).isDefined()) { - return; - } - for (Property deployment : context.getModelNode().get(SecureDeploymentDefinition.TAG_NAME).asPropertyList()) { - writer.writeStartElement(SecureDeploymentDefinition.TAG_NAME); - writer.writeAttribute("name", deployment.getName()); - ModelNode deploymentElements = deployment.getValue(); - for (AttributeDefinition element : SecureDeploymentDefinition.ALL_ATTRIBUTES) { - element.marshallAsElement(deploymentElements, writer); - } - - ModelNode credentials = deploymentElements.get(CredentialDefinition.TAG_NAME); - if (credentials.isDefined()) { - writeCredentials(writer, credentials); - } - - writer.writeEndElement(); - } - } - - private void writeCredentials(XMLExtendedStreamWriter writer, ModelNode credentials) throws XMLStreamException { - Map parsed = new LinkedHashMap<>(); - for (Property credential : credentials.asPropertyList()) { - String credName = credential.getName(); - String credValue = credential.getValue().get(CredentialDefinition.VALUE.getName()).asString(); - - if (credName.contains(".")) { - String[] parts = credName.split("\\."); - String provider = parts[0]; - String propKey = parts[1]; - - Map currentProviderMap = (Map) parsed.get(provider); - if (currentProviderMap == null) { - currentProviderMap = new LinkedHashMap<>(); - parsed.put(provider, currentProviderMap); - } - currentProviderMap.put(propKey, credValue); - } else { - parsed.put(credName, credValue); - } - } - - for (Map.Entry entry : parsed.entrySet()) { - writer.writeStartElement(CredentialDefinition.TAG_NAME); - writer.writeAttribute("name", entry.getKey()); - - Object value = entry.getValue(); - if (value instanceof String) { - writeCharacters(writer, (String) value); - } else { - Map credentialProps = (Map) value; - for (Map.Entry prop : credentialProps.entrySet()) { - writer.writeStartElement(prop.getKey()); - writeCharacters(writer, prop.getValue()); - writer.writeEndElement(); - } - } - - writer.writeEndElement(); - } - } - - // code taken from org.jboss.as.controller.AttributeMarshaller - private void writeCharacters(XMLExtendedStreamWriter writer, String content) throws XMLStreamException { - if (content.indexOf('\n') > -1) { - // Multiline content. Use the overloaded variant that staxmapper will format - writer.writeCharacters(content); - } else { - // Staxmapper will just output the chars without adding newlines if this is used - char[] chars = content.toCharArray(); - writer.writeCharacters(chars, 0, chars.length); - } - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmAddHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmAddHandler.java deleted file mode 100755 index edc8d37f63..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmAddHandler.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractAddStepHandler; -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.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; - -import java.util.List; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; - -/** - * Add a new realm. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public final class RealmAddHandler extends AbstractAddStepHandler { - - public static RealmAddHandler INSTANCE = new RealmAddHandler(); - - private RealmAddHandler() {} - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - // TODO: localize exception. get id number - if (!operation.get(OP).asString().equals(ADD)) { - throw new OperationFailedException("Unexpected operation for add realm. operation=" + operation.toString()); - } - - for (AttributeDefinition attrib : RealmDefinition.ALL_ATTRIBUTES) { - attrib.validateAndSet(operation, model); - } - - if (!SharedAttributeDefinitons.validateTruststoreSetIfRequired(model.clone())) { - //TODO: externalize message - throw new OperationFailedException("truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false."); - } - } - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.addRealm(operation, context.resolveExpressions(model)); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmDefinition.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmDefinition.java deleted file mode 100755 index ba3ba85fd6..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmDefinition.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleResourceDefinition; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Defines attributes and operations for the Realm - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class RealmDefinition extends SimpleResourceDefinition { - - public static final String TAG_NAME = "realm"; - - - protected static final List REALM_ONLY_ATTRIBUTES = new ArrayList(); - static { - } - - protected static final List ALL_ATTRIBUTES = new ArrayList(); - static { - ALL_ATTRIBUTES.addAll(REALM_ONLY_ATTRIBUTES); - ALL_ATTRIBUTES.addAll(SharedAttributeDefinitons.ATTRIBUTES); - } - - private static final Map DEFINITION_LOOKUP = new HashMap(); - static { - for (SimpleAttributeDefinition def : ALL_ATTRIBUTES) { - DEFINITION_LOOKUP.put(def.getXmlName(), def); - } - } - - private static final RealmWriteAttributeHandler realmAttrHandler = new RealmWriteAttributeHandler(ALL_ATTRIBUTES.toArray(new SimpleAttributeDefinition[0])); - - public RealmDefinition() { - super(PathElement.pathElement("realm"), - KeycloakExtension.getResourceDescriptionResolver("realm"), - RealmAddHandler.INSTANCE, - RealmRemoveHandler.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) { - //TODO: use subclass of realmAttrHandler that can call RealmDefinition.validateTruststoreSetIfRequired - resourceRegistration.registerReadWriteAttribute(attrDef, null, realmAttrHandler); - } - } - - - public static SimpleAttributeDefinition lookup(String name) { - return DEFINITION_LOOKUP.get(name); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmRemoveHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmRemoveHandler.java deleted file mode 100644 index ea25a720d4..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmRemoveHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractRemoveStepHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.dmr.ModelNode; - -/** - * Remove a realm. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public final class RealmRemoveHandler extends AbstractRemoveStepHandler { - - public static RealmRemoveHandler INSTANCE = new RealmRemoveHandler(); - - private RealmRemoveHandler() {} - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.removeRealm(operation); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmWriteAttributeHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmWriteAttributeHandler.java deleted file mode 100755 index 69a7f53acd..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/RealmWriteAttributeHandler.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractWriteAttributeHandler; -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.dmr.ModelNode; - -/** - * Update an attribute on a realm. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class RealmWriteAttributeHandler extends AbstractWriteAttributeHandler { - - public RealmWriteAttributeHandler(AttributeDefinition... definitions) { - super(definitions); - } - - @Override - protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, - ModelNode resolvedValue, ModelNode currentValue, HandbackHolder hh) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.updateRealm(operation, attributeName, resolvedValue); - - hh.setHandback(ckService); - - return false; - } - - @Override - protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, - ModelNode valueToRestore, ModelNode valueToRevert, KeycloakAdapterConfigService ckService) throws OperationFailedException { - ckService.updateRealm(operation, attributeName, valueToRestore); - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentAddHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentAddHandler.java deleted file mode 100755 index e5463c2e75..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentAddHandler.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractAddStepHandler; -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.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; - -import java.util.List; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; - -/** - * Add a deployment to a realm. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public final class SecureDeploymentAddHandler extends AbstractAddStepHandler { - - public static SecureDeploymentAddHandler INSTANCE = new SecureDeploymentAddHandler(); - - private SecureDeploymentAddHandler() {} - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - // TODO: localize exception. get id number - if (!operation.get(OP).asString().equals(ADD)) { - throw new OperationFailedException("Unexpected operation for add secure deployment. operation=" + operation.toString()); - } - - for (AttributeDefinition attr : SecureDeploymentDefinition.ALL_ATTRIBUTES) { - attr.validateAndSet(operation, model); - } - } - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.addSecureDeployment(operation, context.resolveExpressions(model)); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentDefinition.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentDefinition.java deleted file mode 100755 index 1eb783dfd9..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentDefinition.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.PathElement; -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.operations.validation.IntRangeValidator; -import org.jboss.as.controller.operations.validation.StringLengthValidator; -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; - -/** - * Defines attributes and operations for a secure-deployment. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class SecureDeploymentDefinition extends SimpleResourceDefinition { - - public static final String TAG_NAME = "secure-deployment"; - - protected static final SimpleAttributeDefinition REALM = - new SimpleAttributeDefinitionBuilder("realm", ModelType.STRING, true) - .setXmlName("realm") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition RESOURCE = - new SimpleAttributeDefinitionBuilder("resource", ModelType.STRING, true) - .setXmlName("resource") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition USE_RESOURCE_ROLE_MAPPINGS = - new SimpleAttributeDefinitionBuilder("use-resource-role-mappings", ModelType.BOOLEAN, true) - .setXmlName("use-resource-role-mappings") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition BEARER_ONLY = - new SimpleAttributeDefinitionBuilder("bearer-only", ModelType.BOOLEAN, true) - .setXmlName("bearer-only") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition ENABLE_BASIC_AUTH = - new SimpleAttributeDefinitionBuilder("enable-basic-auth", ModelType.BOOLEAN, true) - .setXmlName("enable-basic-auth") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition PUBLIC_CLIENT = - new SimpleAttributeDefinitionBuilder("public-client", ModelType.BOOLEAN, true) - .setXmlName("public-client") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition TURN_OFF_CHANGE_SESSION = - new SimpleAttributeDefinitionBuilder("turn-off-change-session-id-on-login", ModelType.BOOLEAN, true) - .setXmlName("turn-off-change-session-id-on-login") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition TOKEN_MINIMUM_TIME_TO_LIVE = - new SimpleAttributeDefinitionBuilder("token-minimum-time-to-live", ModelType.INT, true) - .setXmlName("token-minimum-time-to-live") - .setValidator(new IntRangeValidator(-1, true)) - .setAllowExpression(true) - .build(); - protected static final SimpleAttributeDefinition MIN_TIME_BETWEEN_JWKS_REQUESTS = - new SimpleAttributeDefinitionBuilder("min-time-between-jwks-requests", ModelType.INT, true) - .setXmlName("min-time-between-jwks-requests") - .setValidator(new IntRangeValidator(-1, true)) - .setAllowExpression(true) - .build(); - protected static final SimpleAttributeDefinition PUBLIC_KEY_CACHE_TTL = - new SimpleAttributeDefinitionBuilder("public-key-cache-ttl", ModelType.INT, true) - .setXmlName("public-key-cache-ttl") - .setAllowExpression(true) - .setValidator(new IntRangeValidator(-1, true)) - .build(); - - protected static final List DEPLOYMENT_ONLY_ATTRIBUTES = new ArrayList(); - static { - DEPLOYMENT_ONLY_ATTRIBUTES.add(REALM); - DEPLOYMENT_ONLY_ATTRIBUTES.add(RESOURCE); - DEPLOYMENT_ONLY_ATTRIBUTES.add(USE_RESOURCE_ROLE_MAPPINGS); - DEPLOYMENT_ONLY_ATTRIBUTES.add(BEARER_ONLY); - DEPLOYMENT_ONLY_ATTRIBUTES.add(ENABLE_BASIC_AUTH); - DEPLOYMENT_ONLY_ATTRIBUTES.add(PUBLIC_CLIENT); - DEPLOYMENT_ONLY_ATTRIBUTES.add(TURN_OFF_CHANGE_SESSION); - DEPLOYMENT_ONLY_ATTRIBUTES.add(TOKEN_MINIMUM_TIME_TO_LIVE); - DEPLOYMENT_ONLY_ATTRIBUTES.add(MIN_TIME_BETWEEN_JWKS_REQUESTS); - DEPLOYMENT_ONLY_ATTRIBUTES.add(PUBLIC_KEY_CACHE_TTL); - } - - protected static final List ALL_ATTRIBUTES = new ArrayList(); - static { - ALL_ATTRIBUTES.addAll(DEPLOYMENT_ONLY_ATTRIBUTES); - ALL_ATTRIBUTES.addAll(SharedAttributeDefinitons.ATTRIBUTES); - } - - private static final Map DEFINITION_LOOKUP = new HashMap(); - static { - for (SimpleAttributeDefinition def : ALL_ATTRIBUTES) { - DEFINITION_LOOKUP.put(def.getXmlName(), def); - } - } - - private static SecureDeploymentWriteAttributeHandler attrHandler = new SecureDeploymentWriteAttributeHandler(ALL_ATTRIBUTES); - - public SecureDeploymentDefinition() { - super(PathElement.pathElement(TAG_NAME), - KeycloakExtension.getResourceDescriptionResolver(TAG_NAME), - SecureDeploymentAddHandler.INSTANCE, - SecureDeploymentRemoveHandler.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/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentRemoveHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentRemoveHandler.java deleted file mode 100644 index 745e4611cd..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentRemoveHandler.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractRemoveStepHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.dmr.ModelNode; - -/** - * Remove a secure-deployment from a realm. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public final class SecureDeploymentRemoveHandler extends AbstractRemoveStepHandler { - - public static SecureDeploymentRemoveHandler INSTANCE = new SecureDeploymentRemoveHandler(); - - private SecureDeploymentRemoveHandler() {} - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - ckService.removeSecureDeployment(operation); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentWriteAttributeHandler.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentWriteAttributeHandler.java deleted file mode 100755 index 66461fffb7..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SecureDeploymentWriteAttributeHandler.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.AbstractWriteAttributeHandler; -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.dmr.ModelNode; - -import java.util.List; - -/** - * Update an attribute on a secure-deployment. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class SecureDeploymentWriteAttributeHandler extends AbstractWriteAttributeHandler { - - public SecureDeploymentWriteAttributeHandler(List definitions) { - this(definitions.toArray(new AttributeDefinition[definitions.size()])); - } - - public SecureDeploymentWriteAttributeHandler(AttributeDefinition... definitions) { - super(definitions); - } - - @Override - protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, - ModelNode resolvedValue, ModelNode currentValue, HandbackHolder hh) throws OperationFailedException { - KeycloakAdapterConfigService ckService = KeycloakAdapterConfigService.getInstance(); - hh.setHandback(ckService); - ckService.updateSecureDeployment(operation, attributeName, resolvedValue); - return false; - } - - @Override - protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, - ModelNode valueToRestore, ModelNode valueToRevert, KeycloakAdapterConfigService ckService) throws OperationFailedException { - ckService.updateSecureDeployment(operation, attributeName, valueToRestore); - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java deleted file mode 100755 index 94180e89a6..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/extension/SharedAttributeDefinitons.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.as.controller.operations.validation.IntRangeValidator; -import org.jboss.as.controller.operations.validation.StringLengthValidator; -import org.jboss.dmr.ModelNode; -import org.jboss.dmr.ModelType; - -import java.util.ArrayList; -import java.util.List; - -/** - * Defines attributes that can be present in both a realm and an application (secure-deployment). - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class SharedAttributeDefinitons { - - protected static final SimpleAttributeDefinition REALM_PUBLIC_KEY = - new SimpleAttributeDefinitionBuilder("realm-public-key", ModelType.STRING, true) - .setXmlName("realm-public-key") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition AUTH_SERVER_URL = - new SimpleAttributeDefinitionBuilder("auth-server-url", ModelType.STRING, true) - .setXmlName("auth-server-url") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition SSL_REQUIRED = - new SimpleAttributeDefinitionBuilder("ssl-required", ModelType.STRING, true) - .setXmlName("ssl-required") - .setAllowExpression(true) - .setDefaultValue(new ModelNode("external")) - .build(); - protected static final SimpleAttributeDefinition ALLOW_ANY_HOSTNAME = - new SimpleAttributeDefinitionBuilder("allow-any-hostname", ModelType.BOOLEAN, true) - .setXmlName("allow-any-hostname") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition DISABLE_TRUST_MANAGER = - new SimpleAttributeDefinitionBuilder("disable-trust-manager", ModelType.BOOLEAN, true) - .setXmlName("disable-trust-manager") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition TRUSTSTORE = - new SimpleAttributeDefinitionBuilder("truststore", ModelType.STRING, true) - .setXmlName("truststore") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition TRUSTSTORE_PASSWORD = - new SimpleAttributeDefinitionBuilder("truststore-password", ModelType.STRING, true) - .setXmlName("truststore-password") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition CONNECTION_POOL_SIZE = - new SimpleAttributeDefinitionBuilder("connection-pool-size", ModelType.INT, true) - .setXmlName("connection-pool-size") - .setAllowExpression(true) - .setValidator(new IntRangeValidator(0, true)) - .build(); - - protected static final SimpleAttributeDefinition ENABLE_CORS = - new SimpleAttributeDefinitionBuilder("enable-cors", ModelType.BOOLEAN, true) - .setXmlName("enable-cors") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition CLIENT_KEYSTORE = - new SimpleAttributeDefinitionBuilder("client-keystore", ModelType.STRING, true) - .setXmlName("client-keystore") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition CLIENT_KEYSTORE_PASSWORD = - new SimpleAttributeDefinitionBuilder("client-keystore-password", ModelType.STRING, true) - .setXmlName("client-keystore-password") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition CLIENT_KEY_PASSWORD = - new SimpleAttributeDefinitionBuilder("client-key-password", ModelType.STRING, true) - .setXmlName("client-key-password") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition CORS_MAX_AGE = - new SimpleAttributeDefinitionBuilder("cors-max-age", ModelType.INT, true) - .setXmlName("cors-max-age") - .setAllowExpression(true) - .setValidator(new IntRangeValidator(-1, true)) - .build(); - protected static final SimpleAttributeDefinition CORS_ALLOWED_HEADERS = - new SimpleAttributeDefinitionBuilder("cors-allowed-headers", ModelType.STRING, true) - .setXmlName("cors-allowed-headers") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition CORS_ALLOWED_METHODS = - new SimpleAttributeDefinitionBuilder("cors-allowed-methods", ModelType.STRING, true) - .setXmlName("cors-allowed-methods") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition CORS_EXPOSED_HEADERS = - new SimpleAttributeDefinitionBuilder("cors-exposed-headers", ModelType.STRING, true) - .setXmlName("cors-exposed-headers") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition EXPOSE_TOKEN = - new SimpleAttributeDefinitionBuilder("expose-token", ModelType.BOOLEAN, true) - .setXmlName("expose-token") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition AUTH_SERVER_URL_FOR_BACKEND_REQUESTS = - new SimpleAttributeDefinitionBuilder("auth-server-url-for-backend-requests", ModelType.STRING, true) - .setXmlName("auth-server-url-for-backend-requests") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition ALWAYS_REFRESH_TOKEN = - new SimpleAttributeDefinitionBuilder("always-refresh-token", ModelType.BOOLEAN, true) - .setXmlName("always-refresh-token") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition REGISTER_NODE_AT_STARTUP = - new SimpleAttributeDefinitionBuilder("register-node-at-startup", ModelType.BOOLEAN, true) - .setXmlName("register-node-at-startup") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - protected static final SimpleAttributeDefinition REGISTER_NODE_PERIOD = - new SimpleAttributeDefinitionBuilder("register-node-period", ModelType.INT, true) - .setXmlName("register-node-period") - .setAllowExpression(true) - .setValidator(new IntRangeValidator(-1, true)) - .build(); - protected static final SimpleAttributeDefinition TOKEN_STORE = - new SimpleAttributeDefinitionBuilder("token-store", ModelType.STRING, true) - .setXmlName("token-store") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - protected static final SimpleAttributeDefinition PRINCIPAL_ATTRIBUTE = - new SimpleAttributeDefinitionBuilder("principal-attribute", ModelType.STRING, true) - .setXmlName("principal-attribute") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - - protected static final SimpleAttributeDefinition AUTODETECT_BEARER_ONLY = - new SimpleAttributeDefinitionBuilder("autodetect-bearer-only", ModelType.BOOLEAN, true) - .setXmlName("autodetect-bearer-only") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - - protected static final SimpleAttributeDefinition IGNORE_OAUTH_QUERY_PARAMETER = - new SimpleAttributeDefinitionBuilder("ignore-oauth-query-parameter", ModelType.BOOLEAN, true) - .setXmlName("ignore-oauth-query-parameter") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - - protected static final SimpleAttributeDefinition PROXY_URL = - new SimpleAttributeDefinitionBuilder("proxy-url", ModelType.STRING, true) - .setXmlName("proxy-url") - .setAllowExpression(true) - .setValidator(new StringLengthValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - - protected static final SimpleAttributeDefinition VERIFY_TOKEN_AUDIENCE = - new SimpleAttributeDefinitionBuilder("verify-token-audience", ModelType.BOOLEAN, true) - .setXmlName("verify-token-audience") - .setAllowExpression(true) - .setDefaultValue(new ModelNode(false)) - .build(); - - protected static final List ATTRIBUTES = new ArrayList(); - static { - ATTRIBUTES.add(REALM_PUBLIC_KEY); - ATTRIBUTES.add(AUTH_SERVER_URL); - ATTRIBUTES.add(TRUSTSTORE); - ATTRIBUTES.add(TRUSTSTORE_PASSWORD); - ATTRIBUTES.add(SSL_REQUIRED); - ATTRIBUTES.add(ALLOW_ANY_HOSTNAME); - ATTRIBUTES.add(DISABLE_TRUST_MANAGER); - ATTRIBUTES.add(CONNECTION_POOL_SIZE); - ATTRIBUTES.add(ENABLE_CORS); - ATTRIBUTES.add(CLIENT_KEYSTORE); - ATTRIBUTES.add(CLIENT_KEYSTORE_PASSWORD); - ATTRIBUTES.add(CLIENT_KEY_PASSWORD); - ATTRIBUTES.add(CORS_MAX_AGE); - ATTRIBUTES.add(CORS_ALLOWED_HEADERS); - ATTRIBUTES.add(CORS_ALLOWED_METHODS); - ATTRIBUTES.add(CORS_EXPOSED_HEADERS); - ATTRIBUTES.add(EXPOSE_TOKEN); - ATTRIBUTES.add(AUTH_SERVER_URL_FOR_BACKEND_REQUESTS); - ATTRIBUTES.add(ALWAYS_REFRESH_TOKEN); - ATTRIBUTES.add(REGISTER_NODE_AT_STARTUP); - ATTRIBUTES.add(REGISTER_NODE_PERIOD); - ATTRIBUTES.add(TOKEN_STORE); - ATTRIBUTES.add(PRINCIPAL_ATTRIBUTE); - ATTRIBUTES.add(AUTODETECT_BEARER_ONLY); - ATTRIBUTES.add(IGNORE_OAUTH_QUERY_PARAMETER); - ATTRIBUTES.add(PROXY_URL); - ATTRIBUTES.add(VERIFY_TOKEN_AUDIENCE); - } - - /** - * truststore and truststore-password must be set if ssl-required is not none and disable-trust-manager is false. - * - * @param attributes The full set of attributes. - * - * @return true if the attributes are valid, false otherwise. - */ - public static boolean validateTruststoreSetIfRequired(ModelNode attributes) { - if (isSet(attributes, DISABLE_TRUST_MANAGER)) { - return true; - } - - if (isSet(attributes, SSL_REQUIRED) && attributes.get(SSL_REQUIRED.getName()).asString().equals("none")) { - return true; - } - - return isSet(attributes, TRUSTSTORE) && isSet(attributes, TRUSTSTORE_PASSWORD); - } - - private static boolean isSet(ModelNode attributes, SimpleAttributeDefinition def) { - ModelNode attribute = attributes.get(def.getName()); - - if (def.getType() == ModelType.BOOLEAN) { - return attribute.isDefined() && attribute.asBoolean(); - } - - return attribute.isDefined() && !attribute.asString().isEmpty(); - } - - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakLogger.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakLogger.java deleted file mode 100755 index 9e251c7dd4..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakLogger.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.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"); - - @LogMessage(level = INFO) - @Message(value = "Keycloak subsystem override for deployment %s") - void deploymentSecured(String deployment); - - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakMessages.java b/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakMessages.java deleted file mode 100755 index 4563fd02e6..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/java/org/keycloak/subsystem/wf8/logging/KeycloakMessages.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.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/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension deleted file mode 100644 index f26a5fac8b..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright 2016 Red Hat, Inc. and/or its affiliates -# and other contributors as indicated by the @author tags. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -org.keycloak.subsystem.wf8.extension.KeycloakExtension diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties deleted file mode 100755 index e14c718807..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/org/keycloak/subsystem/wf8/extension/LocalDescriptions.properties +++ /dev/null @@ -1,101 +0,0 @@ -# -# Copyright 2016 Red Hat, Inc. and/or its affiliates -# and other contributors as indicated by the @author tags. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -keycloak.subsystem=Keycloak adapter subsystem -keycloak.subsystem.add=Operation Adds Keycloak adapter subsystem -keycloak.subsystem.remove=Operation removes Keycloak adapter subsystem -keycloak.subsystem.realm=A Keycloak realm. -keycloak.subsystem.secure-deployment=A deployment secured by Keycloak. - -keycloak.realm=A Keycloak realm. -keycloak.realm.add=Add a realm definition to the subsystem. -keycloak.realm.remove=Remove a realm from the subsystem. -keycloak.realm.realm-public-key=Public key of the realm -keycloak.realm.auth-server-url=Base URL of the Realm Auth Server -keycloak.realm.disable-trust-manager=Adapter will not use a trust manager when making adapter HTTPS requests -keycloak.realm.ssl-required=Specify if SSL is required (valid values are all, external and none) -keycloak.realm.allow-any-hostname=SSL Setting -keycloak.realm.truststore=Truststore used for adapter client HTTPS requests -keycloak.realm.truststore-password=Password of the Truststore -keycloak.realm.connection-pool-size=Connection pool size for the client used by the adapter -keycloak.realm.enable-cors=Enable Keycloak CORS support -keycloak.realm.client-keystore=n/a -keycloak.realm.client-keystore-password=n/a -keycloak.realm.client-key-password=n/a -keycloak.realm.cors-max-age=CORS max-age header -keycloak.realm.cors-allowed-headers=CORS allowed headers -keycloak.realm.cors-allowed-methods=CORS allowed methods -keycloak.realm.cors-exposed-headers=CORS exposed headers -keycloak.realm.expose-token=Enable secure URL that exposes access token -keycloak.realm.auth-server-url-for-backend-requests=URL to use to make background calls to auth server -keycloak.realm.always-refresh-token=Refresh token on every single web request -keycloak.realm.register-node-at-startup=Cluster setting -keycloak.realm.register-node-period=how often to re-register node -keycloak.realm.token-store=cookie or session storage for auth session data -keycloak.realm.principal-attribute=token attribute to use to set Principal name -keycloak.realm.autodetect-bearer-only=autodetect bearer-only requests -keycloak.realm.ignore-oauth-query-parameter=disable query parameter parsing for access_token -keycloak.realm.proxy-url=The URL for the HTTP proxy if one is used. -keycloak.realm.verify-token-audience=If true, then during bearer-only authentication, the adapter will verify if token contains this client name (resource) as an audience - -keycloak.secure-deployment=A deployment secured by Keycloak -keycloak.secure-deployment.add=Add a deployment to be secured by Keycloak -keycloak.secure-deployment.realm=Keycloak realm -keycloak.secure-deployment.remove=Remove a deployment to be secured by Keycloak -keycloak.secure-deployment.realm-public-key=Public key of the realm -keycloak.secure-deployment.auth-server-url=Base URL of the Realm Auth Server -keycloak.secure-deployment.disable-trust-manager=Adapter will not use a trust manager when making adapter HTTPS requests -keycloak.secure-deployment.ssl-required=Specify if SSL is required (valid values are all, external and none) -keycloak.secure-deployment.allow-any-hostname=SSL Setting -keycloak.secure-deployment.truststore=Truststore used for adapter client HTTPS requests -keycloak.secure-deployment.truststore-password=Password of the Truststore -keycloak.secure-deployment.connection-pool-size=Connection pool size for the client used by the adapter -keycloak.secure-deployment.resource=Application name -keycloak.secure-deployment.use-resource-role-mappings=Use resource level permissions from token -keycloak.secure-deployment.credentials=Adapter credentials -keycloak.secure-deployment.bearer-only=Bearer Token Auth only -keycloak.secure-deployment.enable-basic-auth=Enable Basic Authentication -keycloak.secure-deployment.public-client=Public client -keycloak.secure-deployment.enable-cors=Enable Keycloak CORS support -keycloak.secure-deployment.client-keystore=n/a -keycloak.secure-deployment.client-keystore-password=n/a -keycloak.secure-deployment.client-key-password=n/a -keycloak.secure-deployment.cors-max-age=CORS max-age header -keycloak.secure-deployment.cors-allowed-headers=CORS allowed headers -keycloak.secure-deployment.cors-allowed-methods=CORS allowed methods -keycloak.secure-deployment.cors-exposed-headers=CORS exposed headers -keycloak.secure-deployment.expose-token=Enable secure URL that exposes access token -keycloak.secure-deployment.auth-server-url-for-backend-requests=URL to use to make background calls to auth server -keycloak.secure-deployment.always-refresh-token=Refresh token on every single web request -keycloak.secure-deployment.register-node-at-startup=Cluster setting -keycloak.secure-deployment.register-node-period=how often to re-register node -keycloak.secure-deployment.token-store=cookie or session storage for auth session data -keycloak.secure-deployment.principal-attribute=token attribute to use to set Principal name -keycloak.secure-deployment.turn-off-change-session-id-on-login=The session id is changed by default on a successful login. Change this to true if you want to turn this off -keycloak.secure-deployment.token-minimum-time-to-live=The adapter will refresh the token if the current token is expired OR will expire in 'token-minimum-time-to-live' seconds or less -keycloak.secure-deployment.min-time-between-jwks-requests=If adapter recognize token signed by unknown public key, it will try to download new public key from keycloak server. However it won't try to download if already tried it in less than 'min-time-between-jwks-requests' seconds -keycloak.secure-deployment.public-key-cache-ttl=Maximum time the downloaded public keys are considered valid. When this time reach, the adapter is forced to download public keys from keycloak server -keycloak.secure-deployment.autodetect-bearer-only=autodetect bearer-only requests -keycloak.secure-deployment.ignore-oauth-query-parameter=disable query parameter parsing for access_token -keycloak.secure-deployment.proxy-url=The URL for the HTTP proxy if one is used. -keycloak.secure-deployment.verify-token-audience=If true, then during bearer-only authentication, the adapter will verify if token contains this client name (resource) as an audience -keycloak.secure-deployment.credential=Credential value - -keycloak.credential=Credential -keycloak.credential.value=Credential value -keycloak.credential.add=Credential add -keycloak.credential.remove=Credential remove \ No newline at end of file diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd deleted file mode 100755 index 4d00ed6384..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/schema/wildfly-keycloak_1_1.xsd +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/subsystem-templates/keycloak-adapter.xml b/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/subsystem-templates/keycloak-adapter.xml deleted file mode 100644 index e8c09f3f8a..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/main/resources/subsystem-templates/keycloak-adapter.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - org.keycloak.keycloak-adapter-subsystem - - - diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/RealmDefinitionTestCase.java b/adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/RealmDefinitionTestCase.java deleted file mode 100755 index b52e483344..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/RealmDefinitionTestCase.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.dmr.ModelNode; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -/** - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class RealmDefinitionTestCase { - - private ModelNode model; - - @Before - public void setUp() { - model = new ModelNode(); - model.get("realm").set("demo"); - model.get("resource").set("customer-portal"); - model.get("realm-public-key").set("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB"); - model.get("auth-url").set("http://localhost:8080/auth-server/rest/realms/demo/protocol/openid-connect/login"); - model.get("code-url").set("http://localhost:8080/auth-server/rest/realms/demo/protocol/openid-connect/access/codes"); - model.get("expose-token").set(true); - ModelNode credential = new ModelNode(); - credential.get("password").set("password"); - model.get("credentials").set(credential); - } - - @Test - public void testIsTruststoreSetIfRequired() throws Exception { - model.get("ssl-required").set("none"); - model.get("disable-trust-manager").set(true); - Assert.assertTrue(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - - model.get("ssl-required").set("none"); - model.get("disable-trust-manager").set(false); - Assert.assertTrue(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - - model.get("ssl-required").set("all"); - model.get("disable-trust-manager").set(true); - Assert.assertTrue(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - - model.get("ssl-required").set("all"); - model.get("disable-trust-manager").set(false); - Assert.assertFalse(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - - model.get("ssl-required").set("external"); - model.get("disable-trust-manager").set(false); - Assert.assertFalse(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - - model.get("ssl-required").set("all"); - model.get("disable-trust-manager").set(false); - model.get("truststore").set("foo"); - Assert.assertFalse(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - - model.get("ssl-required").set("all"); - model.get("disable-trust-manager").set(false); - model.get("truststore").set("foo"); - model.get("truststore-password").set("password"); - Assert.assertTrue(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - - model.get("ssl-required").set("external"); - model.get("disable-trust-manager").set(false); - model.get("truststore").set("foo"); - model.get("truststore-password").set("password"); - Assert.assertTrue(SharedAttributeDefinitons.validateTruststoreSetIfRequired(model)); - } - -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/SubsystemParsingTestCase.java b/adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/SubsystemParsingTestCase.java deleted file mode 100755 index 2daec3cb4f..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/test/java/org/keycloak/subsystem/wf8/extension/SubsystemParsingTestCase.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.wf8.extension; - -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; -import org.jboss.dmr.ModelNode; -import org.junit.Test; - -import java.io.IOException; - - -/** - * Tests all management expects for subsystem, parsing, marshaling, model definition and other - * Here is an example that allows you a fine grained controller over what is tested and how. So it can give you ideas what can be done and tested. - * If you have no need for advanced testing of subsystem you look at {@link SubsystemBaseParsingTestCase} that testes same stuff but most of the code - * is hidden inside of test harness - * - * @author Kabir Khan - * @author Tomaz Cerar - * @author Marko Strukelj - */ -public class SubsystemParsingTestCase extends AbstractSubsystemBaseTest { - - public SubsystemParsingTestCase() { - super(KeycloakExtension.SUBSYSTEM_NAME, new KeycloakExtension()); - } - - @Test - public void testJson() throws Exception { - ModelNode node = new ModelNode(); - node.get("realm").set("demo"); - node.get("resource").set("customer-portal"); - node.get("realm-public-key").set("MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB"); - node.get("auth-url").set("http://localhost:8080/auth-server/rest/realms/demo/protocol/openid-connect/login"); - node.get("code-url").set("http://localhost:8080/auth-server/rest/realms/demo/protocol/openid-connect/access/codes"); - node.get("ssl-required").set("external"); - node.get("expose-token").set(true); - - ModelNode jwtCredential = new ModelNode(); - jwtCredential.get("client-keystore-file").set("/tmp/keystore.jks"); - jwtCredential.get("client-keystore-password").set("changeit"); - ModelNode credential = new ModelNode(); - credential.get("jwt").set(jwtCredential); - node.get("credentials").set(credential); - - System.out.println("json=" + node.toJSONString(false)); - } - - @Test - public void testJsonFromSignedJWTCredentials() { - KeycloakAdapterConfigService service = KeycloakAdapterConfigService.getInstance(); - - PathAddress addr = PathAddress.pathAddress(PathElement.pathElement("subsystem", "keycloak"), PathElement.pathElement("secure-deployment", "foo")); - ModelNode deploymentOp = new ModelNode(); - deploymentOp.get(ModelDescriptionConstants.OP_ADDR).set(addr.toModelNode()); - ModelNode deployment = new ModelNode(); - deployment.get("realm").set("demo"); - deployment.get("resource").set("customer-portal"); - service.addSecureDeployment(deploymentOp, deployment); - - addCredential(addr, service, "secret", "secret1"); - addCredential(addr, service, "jwt.client-keystore-file", "/tmp/foo.jks"); - addCredential(addr, service, "jwt.token-timeout", "10"); - } - - private void addCredential(PathAddress parent, KeycloakAdapterConfigService service, String key, String value) { - PathAddress credAddr = PathAddress.pathAddress(parent, PathElement.pathElement("credential", key)); - ModelNode credOp = new ModelNode(); - credOp.get(ModelDescriptionConstants.OP_ADDR).set(credAddr.toModelNode()); - ModelNode credential = new ModelNode(); - credential.get("value").set(value); - service.addCredential(credOp, credential); - } - - - @Override - protected String getSubsystemXml() throws IOException { - return readResource("keycloak-1.1.xml"); - } -} diff --git a/adapters/oidc/wildfly/wf8-subsystem/src/test/resources/org/keycloak/subsystem/wf8/extension/keycloak-1.1.xml b/adapters/oidc/wildfly/wf8-subsystem/src/test/resources/org/keycloak/subsystem/wf8/extension/keycloak-1.1.xml deleted file mode 100755 index 2315ea02ad..0000000000 --- a/adapters/oidc/wildfly/wf8-subsystem/src/test/resources/org/keycloak/subsystem/wf8/extension/keycloak-1.1.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - master - web-console - true - false - 10 - 20 - 3600 - - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4siLKUew0WYxdtq6/rwk4Uj/4amGFFnE/yzIxQVU0PUqz3QBRVkUWpDj0K6ZnS5nzJV/y6DHLEy7hjZTdRDphyF1sq09aDOYnVpzu8o2sIlMM8q5RnUyEfIyUZqwo8pSZDJ90fS0s+IDUJNCSIrAKO3w1lqZDHL6E/YFHXyzkvQIDAQAB - - http://localhost:8080/auth - EXTERNAL - http://localhost:9000 - true - 0aa31d98-e0aa-404c-b6e0-e771dba1e798 - - - master - http-endpoint - true - - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4siLKUew0WYxdtq6/rwk4Uj/4amGFFnE/yzIxQVU0PUqz3QBRVkUWpDj0K6ZnS5nzJV/y6DHLEy7hjZTdRDphyF1sq09aDOYnVpzu8o2sIlMM8q5RnUyEfIyUZqwo8pSZDJ90fS0s+IDUJNCSIrAKO3w1lqZDHL6E/YFHXyzkvQIDAQAB - - http://localhost:8080/auth - EXTERNAL - - /tmp/keystore.jks - - - \ No newline at end of file diff --git a/distribution/adapters/pom.xml b/distribution/adapters/pom.xml index a871eb72be..9ebe42cdfd 100755 --- a/distribution/adapters/pom.xml +++ b/distribution/adapters/pom.xml @@ -35,7 +35,6 @@ fuse-adapter-zip js-adapter-zip osgi - wildfly-adapter @@ -53,7 +52,6 @@ jetty92-adapter-zip jetty93-adapter-zip jetty94-adapter-zip - wf8-adapter js-adapter-npm-zip diff --git a/distribution/adapters/wf8-adapter/pom.xml b/distribution/adapters/wf8-adapter/pom.xml deleted file mode 100644 index 4d9ad77012..0000000000 --- a/distribution/adapters/wf8-adapter/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - keycloak-parent - org.keycloak - 7.0.0-SNAPSHOT - ../../../pom.xml - - Keycloak Wildfly 8 Adapter - - 4.0.0 - - keycloak-wf8-adapter-dist-pom - pom - - - wf8-modules - wf8-adapter-zip - - diff --git a/distribution/adapters/wf8-adapter/wf8-adapter-zip/assembly.xml b/distribution/adapters/wf8-adapter/wf8-adapter-zip/assembly.xml deleted file mode 100755 index fb3bf418d1..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-adapter-zip/assembly.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - war-dist - - - zip - tar.gz - - false - - - - ${project.build.directory}/unpacked - - org/apache/httpcomponents/** - org/keycloak/keycloak-common/** - org/keycloak/keycloak-core/** - org/keycloak/keycloak-adapter-spi/** - org/keycloak/keycloak-adapter-core/** - org/keycloak/keycloak-jboss-adapter-core/** - org/keycloak/keycloak-undertow-adapter/** - org/keycloak/keycloak-wildfly-adapter/** - org/keycloak/keycloak-wf8-subsystem/** - org/keycloak/keycloak-adapter-subsystem/** - org/keycloak/keycloak-servlet-oauth-client/** - org/keycloak/keycloak-authz-client/** - - - **/*.war - - modules/system/add-ons/keycloak - - - - - ../../shared-cli/adapter-install.cli - bin - - - diff --git a/distribution/adapters/wf8-adapter/wf8-adapter-zip/pom.xml b/distribution/adapters/wf8-adapter/wf8-adapter-zip/pom.xml deleted file mode 100755 index 3e2a5c3859..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-adapter-zip/pom.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - 4.0.0 - - keycloak-parent - org.keycloak - 7.0.0-SNAPSHOT - ../../../../pom.xml - - - keycloak-wf8-adapter-dist - pom - Keycloak Wildfly 8 Adapter Distro - - - - - org.keycloak - keycloak-wf8-modules - zip - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - prepare-package - - unpack - - - - - org.keycloak - keycloak-wf8-modules - zip - ${project.build.directory}/unpacked - - - - - - - - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - - target - - - target/assembly/work - - false - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/assembly.xml b/distribution/adapters/wf8-adapter/wf8-modules/assembly.xml deleted file mode 100755 index 4acef09b9c..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/assembly.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - dist - - - zip - - false - - - - ../../ - - License.html - - - - - ${project.build.directory}/modules - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/build.xml b/distribution/adapters/wf8-adapter/wf8-modules/build.xml deleted file mode 100755 index 457e6730e2..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/build.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/lib.xml b/distribution/adapters/wf8-adapter/wf8-modules/lib.xml deleted file mode 100755 index 5794c22ec0..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/lib.xml +++ /dev/null @@ -1,277 +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/adapters/wf8-adapter/wf8-modules/pom.xml b/distribution/adapters/wf8-adapter/wf8-modules/pom.xml deleted file mode 100755 index f8983a4fde..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/pom.xml +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - 4.0.0 - - - keycloak-parent - org.keycloak - 7.0.0-SNAPSHOT - ../../../../pom.xml - - - keycloak-wf8-modules - - Keycloak Wildfly 8 Modules - pom - - - org.keycloak - keycloak-common - - - org.keycloak - keycloak-core - - - org.keycloak - keycloak-adapter-spi - - - org.keycloak - keycloak-undertow-adapter-spi - - - org.keycloak - keycloak-adapter-core - - - org.keycloak - keycloak-jboss-adapter-core - - - org.keycloak - keycloak-undertow-adapter - - - org.keycloak - keycloak-wildfly-adapter - - - org.keycloak - keycloak-wf8-subsystem - - - org.keycloak - keycloak-servlet-oauth-client - - - org.apache.httpcomponents - httpmime - - - org.apache.httpcomponents - httpcore - - - - - org.keycloak - keycloak-authz-client - - - - - - - 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 - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-resources - - validate - - copy-resources - - - ${project.build.directory}/modules/org/keycloak/keycloak-adapter-subsystem - - - src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem - true - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/apache/httpcomponents/4.3/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/apache/httpcomponents/4.3/module.xml deleted file mode 100644 index 36cc37c1b1..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/apache/httpcomponents/4.3/module.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml deleted file mode 100755 index da78bf3568..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml deleted file mode 100755 index e08eb2ea7c..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem/main/module.xml deleted file mode 100755 index 3d520227ae..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem/main/module.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-authz-client/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-authz-client/main/module.xml deleted file mode 100755 index 208810166a..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-authz-client/main/module.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml deleted file mode 100755 index 695dc1a9ad..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml deleted file mode 100755 index f40e1e3165..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml deleted file mode 100755 index f04205bf01..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-servlet-oauth-client/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-servlet-oauth-client/main/module.xml deleted file mode 100755 index ca45251ebb..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-servlet-oauth-client/main/module.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-undertow-adapter/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-undertow-adapter/main/module.xml deleted file mode 100755 index 651aaf0498..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-undertow-adapter/main/module.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wf8-subsystem/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wf8-subsystem/main/module.xml deleted file mode 100755 index b2328193c8..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wf8-subsystem/main/module.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adapter/main/module.xml b/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adapter/main/module.xml deleted file mode 100755 index 1e33034a2b..0000000000 --- a/distribution/adapters/wf8-adapter/wf8-modules/src/main/resources/modules/org/keycloak/keycloak-wildfly-adapter/main/module.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/downloads/src/main/resources/files b/distribution/downloads/src/main/resources/files index 736f660115..a7bc4fe984 100644 --- a/distribution/downloads/src/main/resources/files +++ b/distribution/downloads/src/main/resources/files @@ -13,7 +13,6 @@ keycloak-js-adapter-dist keycloak-tomcat7-adapter-dist keycloak-tomcat8-adapter-dist - keycloak-wf8-adapter-dist keycloak-wildfly-adapter-dist keycloak-fuse-adapter-dist @@ -25,4 +24,4 @@ keycloak-saml-jetty94-adapter-dist keycloak-saml-tomcat7-adapter-dist keycloak-saml-tomcat8-adapter-dist - keycloak-saml-wildfly-adapter-dist \ No newline at end of file + keycloak-saml-wildfly-adapter-dist diff --git a/pom.xml b/pom.xml index 6eb2be86bc..b4d07cc048 100755 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,6 @@ 1.6.2 3.3.2.Final 2.1.0.Final - 1.2.0.Final 1.0.2.Final 1.1.1.Final 1.0.1.Final @@ -925,11 +924,6 @@ keycloak-as7-subsystem ${project.version} - - org.keycloak - keycloak-wf8-subsystem - ${project.version} - org.keycloak keycloak-wildfly-subsystem @@ -1187,12 +1181,6 @@ ${project.version} zip - - org.keycloak - keycloak-wf8-modules - ${project.version} - zip - org.keycloak keycloak-wildfly-modules @@ -1264,12 +1252,6 @@ ${project.version} zip - - org.keycloak - keycloak-wf8-adapter-dist - ${project.version} - zip - org.keycloak keycloak-tomcat7-adapter-dist