diff --git a/adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml b/adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml deleted file mode 100755 index 17c98bcf1c..0000000000 --- a/adapters/oidc/as7-eap6/as7-adapter-spi/pom.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - keycloak-as7-integration-pom - org.keycloak - 999-SNAPSHOT - ../pom.xml - - 4.0.0 - - keycloak-as7-adapter-spi - Keycloak AS7 SPI - - - - - - jboss - https://repository.jboss.org/nexus/content/groups/public/ - - false - - - - - - - org.keycloak - keycloak-adapter-spi - - - org.apache.httpcomponents - httpclient - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - org.jboss.logging - jboss-logging - provided - - - org.jboss.web - jbossweb - 7.0.17.Final - provided - - - org.jboss.as - jboss-as-web - 7.1.2.Final - provided - - - org.keycloak - keycloak-tomcat-adapter-spi - - - org.apache.tomcat - tomcat-servlet-api - - - org.apache.tomcat - tomcat-catalina - - - org.apache.tomcat - catalina - - - - - junit - junit - test - - - diff --git a/adapters/oidc/as7-eap6/as7-adapter-spi/src/main/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactory.java b/adapters/oidc/as7-eap6/as7-adapter-spi/src/main/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactory.java deleted file mode 100755 index b7916f20de..0000000000 --- a/adapters/oidc/as7-eap6/as7-adapter-spi/src/main/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactory.java +++ /dev/null @@ -1,179 +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.adapters.jbossweb; - -import org.apache.catalina.Realm; -import org.apache.catalina.realm.GenericPrincipal; -import org.jboss.as.web.security.JBossGenericPrincipal; -import org.jboss.security.NestableGroup; -import org.jboss.security.SecurityConstants; -import org.jboss.security.SecurityContext; -import org.jboss.security.SecurityContextAssociation; -import org.jboss.security.SimpleGroup; -import org.jboss.security.SimplePrincipal; -import org.keycloak.adapters.spi.KeycloakAccount; -import org.keycloak.adapters.tomcat.PrincipalFactory; - -import javax.security.auth.Subject; -import java.lang.reflect.Constructor; -import java.security.Principal; -import java.security.acl.Group; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Enumeration; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class JBossWebPrincipalFactory implements PrincipalFactory { - - private static Constructor jbossWebPrincipalConstructor = findJBossGenericPrincipalConstructor(); - - @Override - public GenericPrincipal createPrincipal(Realm realm, final Principal identity, final Set roleSet) { - KeycloakAccount account = new KeycloakAccount() { - @Override - public Principal getPrincipal() { - return identity; - } - - @Override - public Set getRoles() { - return roleSet; - } - }; - Subject subject = new Subject(); - Set principals = subject.getPrincipals(); - principals.add(identity); - Group[] roleSets = getRoleSets(roleSet); - for (int g = 0; g < roleSets.length; g++) { - Group group = roleSets[g]; - String name = group.getName(); - Group subjectGroup = createGroup(name, principals); - if (subjectGroup instanceof NestableGroup) { - /* A NestableGroup only allows Groups to be added to it so we - need to add a SimpleGroup to subjectRoles to contain the roles - */ - SimpleGroup tmp = new SimpleGroup("Roles"); - subjectGroup.addMember(tmp); - subjectGroup = tmp; - } - // Copy the group members to the Subject group - Enumeration members = group.members(); - while (members.hasMoreElements()) { - Principal role = (Principal) members.nextElement(); - subjectGroup.addMember(role); - } - } - // add the CallerPrincipal group if none has been added in getRoleSets - Group callerGroup = new SimpleGroup(SecurityConstants.CALLER_PRINCIPAL_GROUP); - callerGroup.addMember(identity); - principals.add(callerGroup); - SecurityContext sc = SecurityContextAssociation.getSecurityContext(); - Principal userPrincipal = getPrincipal(subject); - sc.getUtil().createSubjectInfo(userPrincipal, account, subject); - List rolesAsStringList = new ArrayList<>(roleSet); - - try { - return (GenericPrincipal) jbossWebPrincipalConstructor.newInstance(realm, userPrincipal.getName(), null, rolesAsStringList, userPrincipal, null, account, null, subject); - } catch (Throwable t) { - throw new RuntimeException("Failed to create JBossGenericPrincipal", t); - } - } - - /** - * Get the Principal given the authenticated Subject. Currently the first subject that is not of type {@code Group} is - * considered or the single subject inside the CallerPrincipal group. - * - * @param subject - * @return the authenticated subject - */ - protected Principal getPrincipal(Subject subject) { - Principal principal = null; - Principal callerPrincipal = null; - if (subject != null) { - Set principals = subject.getPrincipals(); - if (principals != null && !principals.isEmpty()) { - for (Principal p : principals) { - if (!(p instanceof Group) && principal == null) { - principal = p; - } - if (p instanceof Group) { - Group g = Group.class.cast(p); - if (g.getName().equals(SecurityConstants.CALLER_PRINCIPAL_GROUP) && callerPrincipal == null) { - Enumeration e = g.members(); - if (e.hasMoreElements()) - callerPrincipal = e.nextElement(); - } - } - } - } - } - return callerPrincipal == null ? principal : callerPrincipal; - } - - protected Group createGroup(String name, Set principals) { - Group roles = null; - Iterator iter = principals.iterator(); - while (iter.hasNext()) { - Object next = iter.next(); - if (!(next instanceof Group)) - continue; - Group grp = (Group) next; - if (grp.getName().equals(name)) { - roles = grp; - break; - } - } - // If we did not find a group create one - if (roles == null) { - roles = new SimpleGroup(name); - principals.add(roles); - } - return roles; - } - - protected Group[] getRoleSets(Collection roleSet) { - SimpleGroup roles = new SimpleGroup("Roles"); - Group[] roleSets = {roles}; - for (String role : roleSet) { - roles.addMember(new SimplePrincipal(role)); - } - return roleSets; - } - - static Constructor findJBossGenericPrincipalConstructor() { - for (Constructor c : JBossGenericPrincipal.class.getConstructors()) { - if (c.getParameterTypes().length == 9 && - c.getParameterTypes()[0].equals(Realm.class) && - c.getParameterTypes()[1].equals(String.class) && - c.getParameterTypes()[3].equals(List.class) && - c.getParameterTypes()[4].equals(Principal.class) && - c.getParameterTypes()[6].equals(Object.class) && - c.getParameterTypes()[8].equals(Subject.class)) { - return c; - } - } - return null; - } - -} diff --git a/adapters/oidc/as7-eap6/as7-adapter-spi/src/test/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactoryTest.java b/adapters/oidc/as7-eap6/as7-adapter-spi/src/test/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactoryTest.java deleted file mode 100644 index 46ab0b565c..0000000000 --- a/adapters/oidc/as7-eap6/as7-adapter-spi/src/test/java/org/keycloak/adapters/jbossweb/JBossWebPrincipalFactoryTest.java +++ /dev/null @@ -1,46 +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.adapters.jbossweb; - -import org.apache.catalina.Realm; -import org.junit.Assert; -import org.junit.Test; - -import javax.security.auth.Subject; -import java.lang.reflect.Constructor; -import java.security.Principal; -import java.util.List; - -/** - * @author Stian Thorgersen - */ -public class JBossWebPrincipalFactoryTest { - - @Test - public void test() { - Constructor constructor = JBossWebPrincipalFactory.findJBossGenericPrincipalConstructor(); - Assert.assertNotNull(constructor); - Assert.assertEquals(Realm.class, constructor.getParameterTypes()[0]); - Assert.assertEquals(String.class, constructor.getParameterTypes()[1]); - Assert.assertEquals(List.class, constructor.getParameterTypes()[3]); - Assert.assertEquals(Principal.class, constructor.getParameterTypes()[4]); - Assert.assertEquals(Object.class, constructor.getParameterTypes()[6]); - Assert.assertEquals(Subject.class, constructor.getParameterTypes()[8]); - } - -} diff --git a/adapters/oidc/as7-eap6/as7-adapter/pom.xml b/adapters/oidc/as7-eap6/as7-adapter/pom.xml deleted file mode 100755 index 2067a9d710..0000000000 --- a/adapters/oidc/as7-eap6/as7-adapter/pom.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - - keycloak-as7-integration-pom - org.keycloak - 999-SNAPSHOT - ../pom.xml - - 4.0.0 - - keycloak-as7-adapter - Keycloak AS7 Integration - - - - - - jboss - https://repository.jboss.org/nexus/content/groups/public/ - - false - - - - - - - org.keycloak - keycloak-core - - - org.keycloak - keycloak-as7-adapter-spi - - - org.keycloak - keycloak-adapter-spi - - - org.keycloak - keycloak-adapter-core - - - org.keycloak - keycloak-jboss-adapter-core - - - org.apache.httpcomponents - httpclient - - - org.bouncycastle - bcprov-jdk15on - - - com.fasterxml.jackson.core - jackson-core - - - com.fasterxml.jackson.core - jackson-databind - - - com.fasterxml.jackson.core - jackson-annotations - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - org.jboss.logging - jboss-logging - ${jboss.logging.version} - provided - - - org.jboss.web - jbossweb - 7.0.17.Final - provided - - - org.jboss.as - jboss-as-web - 7.1.2.Final - provided - - - org.keycloak - keycloak-tomcat-core-adapter - - - org.apache.tomcat - tomcat-servlet-api - - - org.apache.tomcat - tomcat-catalina - - - org.apache.tomcat - catalina - - - - - junit - junit - test - - - diff --git a/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/AuthenticatedActionsValve.java b/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/AuthenticatedActionsValve.java deleted file mode 100644 index a8b800f38b..0000000000 --- a/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/AuthenticatedActionsValve.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.keycloak.adapters.jbossweb; - -import org.apache.catalina.Container; -import org.apache.catalina.Valve; -import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.tomcat.AbstractAuthenticatedActionsValve; - -public class AuthenticatedActionsValve extends AbstractAuthenticatedActionsValve { - - public AuthenticatedActionsValve(AdapterDeploymentContext deploymentContext, Valve next, Container container) { - super(deploymentContext, next, container); - } -} diff --git a/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/KeycloakAuthenticatorValve.java b/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/KeycloakAuthenticatorValve.java deleted file mode 100755 index f21b75a9f4..0000000000 --- a/adapters/oidc/as7-eap6/as7-adapter/src/main/java/org/keycloak/adapters/jbossweb/KeycloakAuthenticatorValve.java +++ /dev/null @@ -1,76 +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.adapters.jbossweb; - -import org.apache.catalina.Container; -import org.apache.catalina.LifecycleException; -import org.apache.catalina.Valve; -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; -import org.apache.catalina.core.StandardContext; -import org.apache.catalina.deploy.LoginConfig; -import org.keycloak.adapters.AdapterDeploymentContext; -import org.keycloak.adapters.tomcat.AbstractAuthenticatedActionsValve; -import org.keycloak.adapters.tomcat.AbstractKeycloakAuthenticatorValve; -import org.keycloak.adapters.tomcat.PrincipalFactory; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * Keycloak authentication valve - * - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class KeycloakAuthenticatorValve extends AbstractKeycloakAuthenticatorValve { - public boolean authenticate(Request request, HttpServletResponse response, LoginConfig config) throws java.io.IOException { - return authenticateInternal(request, response, config); - } - - @Override - protected boolean forwardToErrorPageInternal(Request request, HttpServletResponse response, Object loginConfig) throws IOException { - if (loginConfig == null) return false; - LoginConfig config = (LoginConfig)loginConfig; - if (config.getErrorPage() == null) return false; - forwardToErrorPage(request, (Response)response, config); - return true; - } - - - @Override - public void start() throws LifecycleException { - StandardContext standardContext = (StandardContext) context; - standardContext.addLifecycleListener(this); - super.start(); - } - - public void logout(Request request) { - logoutInternal(request); - } - - @Override - protected PrincipalFactory createPrincipalFactory() { - return new JBossWebPrincipalFactory(); - } - - @Override - protected AbstractAuthenticatedActionsValve createAuthenticatedActionsValve(AdapterDeploymentContext deploymentContext, Valve next, Container container) { - return new AuthenticatedActionsValve(deploymentContext, next, container); - } -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/pom.xml b/adapters/oidc/as7-eap6/as7-subsystem/pom.xml deleted file mode 100755 index ee56cc90db..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/pom.xml +++ /dev/null @@ -1,112 +0,0 @@ - - - - 4.0.0 - - - org.keycloak - keycloak-as7-integration-pom - 999-SNAPSHOT - ../pom.xml - - - keycloak-as7-subsystem - Keycloak AS7 Subsystem - - jar - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - true - -Xmx512m - - - jboss.home - ${jboss.home} - - - - **/*TestCase.java - - once - - - - - - - - org.keycloak - keycloak-as7-adapter - - - - org.jboss.as - jboss-as-naming - - - - org.jboss.as - jboss-as-server - - - - org.jboss.as - jboss-as-ee - - - - org.jboss.as - jboss-as-web - - - - org.jboss.logging - jboss-logging - - 3.3.2.Final - - - - - org.jboss.logging - jboss-logging-processor - - provided - true - 1.0.0.Final - - - - org.jboss.msc - jboss-msc - - - - junit - junit - test - - - diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialAddHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialAddHandler.java deleted file mode 100755 index 94da8eeec3..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialAddHandler.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.as7; - -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.Collection; -import java.util.LinkedList; -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 { - - protected Collection attributes = new LinkedList<>(); - - public CredentialAddHandler(AttributeDefinition... attrs) { - for (AttributeDefinition attr : attrs) { - attributes.add(attr); - } - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - if (attributes != null) { - for (AttributeDefinition attr : 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.addCredential(operation, context.resolveExpressions(model)); - } - -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialDefinition.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialDefinition.java deleted file mode 100755 index a8f0c8d85d..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialDefinition.java +++ /dev/null @@ -1,63 +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.as7; - -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.descriptions.ModelDescriptionConstants; -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.as.controller.registry.OperationEntry; -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(ModelDescriptionConstants.DESCRIBE, GenericSubsystemDescribeHandler.INSTANCE, GenericSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE); - } - - @Override - public void registerAttributes(ManagementResourceRegistration resourceRegistration) { - super.registerAttributes(resourceRegistration); - resourceRegistration.registerReadWriteAttribute(VALUE, null, new CredentialReadWriteAttributeHandler()); - } -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialReadWriteAttributeHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialReadWriteAttributeHandler.java deleted file mode 100644 index 7b1be7e79c..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialRemoveHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/CredentialRemoveHandler.java deleted file mode 100644 index e11436451e..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigDeploymentProcessor.java deleted file mode 100755 index 9f5bd74f14..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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.deployment.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.jboss.ValveMetaData; -import org.jboss.metadata.web.spec.LoginConfigMetaData; -import org.keycloak.adapters.jbossweb.KeycloakAuthenticatorValve; -import org.keycloak.subsystem.as7.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"; - - - @Override - public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { - DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); - - // if it's not a web-app there's nothing to secure - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - return; - } - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - webMetaData = new JBossWebMetaData(); - warMetaData.setMergedJBossWebMetaData(webMetaData); - } - - KeycloakAdapterConfigService service = KeycloakAdapterConfigService.getInstance(); - - // otherwise - LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - - boolean hasSubsystemConfig = service.isSecureDeployment(deploymentUnit); - boolean webRequiresKC = loginConfig != null && "KEYCLOAK".equalsIgnoreCase(loginConfig.getAuthMethod()); - boolean isConfigured = service.isDeploymentConfigured(deploymentUnit); - - if ((hasSubsystemConfig && isConfigured) || webRequiresKC) { - log.debug("Setting up KEYCLOAK auth method for WAR: " + deploymentUnit.getName()); - - // if secure-deployment configuration exists for web app, we force KEYCLOAK auth method on it - if (hasSubsystemConfig) { - addJSONData(service.getJSON(deploymentUnit), warMetaData); - if (loginConfig != null) { - loginConfig.setAuthMethod("KEYCLOAK"); - loginConfig.setRealmName(service.getRealmName(deploymentUnit)); - } else { - log.warn("Failed to set up KEYCLOAK auth method for WAR: " + deploymentUnit.getName() + " (loginConfig == null)"); - } - } - addValve(webMetaData); - KeycloakLogger.ROOT_LOGGER.deploymentSecured(deploymentUnit.getName()); - } - } - - private void addValve(JBossWebMetaData webMetaData) { - List valves = webMetaData.getValves(); - if (valves == null) { - valves = new ArrayList<>(1); - webMetaData.setValves(valves); - } - ValveMetaData valve = new ValveMetaData(); - valve.setValveClass(KeycloakAuthenticatorValve.class.getName()); - valve.setModule("org.keycloak.keycloak-as7-adapter"); - //log.info("******* adding Keycloak valve to: " + deploymentName); - valves.add(valve); - } - - 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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigService.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigService.java deleted file mode 100755 index 1d1f517ff7..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakAdapterConfigService.java +++ /dev/null @@ -1,231 +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.as7; - -import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.web.deployment.WarMetaData; -import org.jboss.dmr.ModelNode; -import org.jboss.dmr.Property; -import org.jboss.logging.Logger; -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 { - protected Logger log = Logger.getLogger(KeycloakAdapterConfigService.class); - 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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakDependencyProcessor.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakDependencyProcessor.java deleted file mode 100755 index b778dc03b1..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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.deployment.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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakDependencyProcessorAS7.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakDependencyProcessorAS7.java deleted file mode 100644 index fa8c89fabf..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakDependencyProcessorAS7.java +++ /dev/null @@ -1,36 +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.as7; - -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; - -/** - * @author Marko Strukelj - */ -public class KeycloakDependencyProcessorAS7 extends KeycloakDependencyProcessor { - - private static final ModuleIdentifier KEYCLOAK_AS7_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-as7-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_AS7_ADAPTER, false, false, true, false)); - }} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakExtension.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakExtension.java deleted file mode 100755 index f9390c476d..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakExtension.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.as7; - -import org.jboss.as.controller.Extension; -import org.jboss.as.controller.ExtensionContext; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.ResourceDefinition; -import org.jboss.as.controller.SubsystemRegistration; -import org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver; -import org.jboss.as.controller.parsing.ExtensionParsingContext; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.keycloak.subsystem.as7.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_1_1 = "urn:jboss:domain:keycloak:1.1"; - public static final String NAMESPACE_1_2 = "urn:jboss:domain:keycloak:1.2"; - public static final String CURRENT_NAMESPACE = NAMESPACE_1_2; - 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 MGMT_API_VERSION_MAJOR = 1; - private static final int MGMT_API_VERSION_MINOR = 1; - - 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_1_1, PARSER); - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, KeycloakExtension.NAMESPACE_1_2, PARSER); - } - - /** - * {@inheritDoc} - */ - @Override - public void initialize(final ExtensionContext context) { - KeycloakLogger.ROOT_LOGGER.debug("Activating Keycloak Extension"); - final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, MGMT_API_VERSION_MAJOR, MGMT_API_VERSION_MINOR); - - 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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemAdd.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemAdd.java deleted file mode 100755 index f4cb6c4ad3..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemAdd.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.as7; - - -import org.jboss.as.controller.AbstractBoottimeAddStepHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -import org.jboss.as.controller.ServiceVerificationHandler; -import org.jboss.as.server.AbstractDeploymentChainStep; -import org.jboss.as.server.DeploymentProcessorTarget; -import org.jboss.as.server.deployment.Phase; -import org.jboss.dmr.ModelNode; -import org.jboss.msc.service.ServiceController; - -import java.util.List; - -/** - * 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(Phase.DEPENDENCIES, 0, new KeycloakDependencyProcessorAS7()); - processorTarget.addDeploymentProcessor( - Phase.POST_MODULE, // PHASE - Phase.POST_MODULE_VALIDATOR_FACTORY - 1, // PRIORITY - new KeycloakAdapterConfigDeploymentProcessor()); - } - }, OperationContext.Stage.RUNTIME); - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - model.setEmptyObject(); - } -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemDefinition.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemDefinition.java deleted file mode 100644 index ded19a6b53..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemDefinition.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.as7; - -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; -import org.jboss.as.controller.SimpleResourceDefinition; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.as.controller.registry.OperationEntry; - -/** - * 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(ModelDescriptionConstants.DESCRIBE, GenericSubsystemDescribeHandler.INSTANCE, GenericSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE); - } - -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemParser.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemParser.java deleted file mode 100755 index f0245cdd1a..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/KeycloakSubsystemParser.java +++ /dev/null @@ -1,294 +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.as7; - -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.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.CURRENT_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.indexOf('.') > -1) { - 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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmAddHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmAddHandler.java deleted file mode 100755 index bbb834e4b6..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmAddHandler.java +++ /dev/null @@ -1,58 +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.as7; - -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 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 { - 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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmDefinition.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmDefinition.java deleted file mode 100755 index 418e393283..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmDefinition.java +++ /dev/null @@ -1,89 +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.as7; - -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.descriptions.ModelDescriptionConstants; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.as.controller.registry.OperationEntry; - -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. - */ -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(ModelDescriptionConstants.DESCRIBE, GenericSubsystemDescribeHandler.INSTANCE, GenericSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE); - } - - @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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmRemoveHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmRemoveHandler.java deleted file mode 100644 index d05d4d67b2..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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. - */ -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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmWriteAttributeHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/RealmWriteAttributeHandler.java deleted file mode 100755 index 3a4ec04a99..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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. - */ -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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentAddHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentAddHandler.java deleted file mode 100755 index 5dbee67f2c..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentAddHandler.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.as7; - -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 deployment to a realm. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -final class SecureDeploymentAddHandler extends AbstractAddStepHandler { - - public static SecureDeploymentAddHandler INSTANCE = new SecureDeploymentAddHandler(); - - private SecureDeploymentAddHandler() { - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - 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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentDefinition.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentDefinition.java deleted file mode 100755 index 525a418fd2..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentDefinition.java +++ /dev/null @@ -1,161 +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.as7; - -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.descriptions.ModelDescriptionConstants; -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.as.controller.registry.OperationEntry; -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. - */ -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(ModelDescriptionConstants.DESCRIBE, GenericSubsystemDescribeHandler.INSTANCE, GenericSubsystemDescribeHandler.INSTANCE, false, OperationEntry.EntryType.PRIVATE); - } - - @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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentRemoveHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentRemoveHandler.java deleted file mode 100644 index 3fbd27e095..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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. - */ -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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentWriteAttributeHandler.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SecureDeploymentWriteAttributeHandler.java deleted file mode 100755 index 04b26f643b..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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. - */ -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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SharedAttributeDefinitons.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/SharedAttributeDefinitons.java deleted file mode 100755 index e4eb1e8e7f..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7; - -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.LongRangeValidator; -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. - */ -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 SOCKET_TIMEOUT = - new SimpleAttributeDefinitionBuilder("socket-timeout-millis", ModelType.LONG, true) - .setXmlName("socket-timeout-millis") - .setAllowExpression(true) - .setValidator(new LongRangeValidator(-1L, true)) - .build(); - protected static final SimpleAttributeDefinition CONNECTION_TTL = - new SimpleAttributeDefinitionBuilder("connection-ttl-millis", ModelType.LONG, true) - .setXmlName("connection-ttl-millis") - .setAllowExpression(true) - .setValidator(new LongRangeValidator(-1L, true)) - .build(); - protected static final SimpleAttributeDefinition CONNECTION_TIMEOUT = - new SimpleAttributeDefinitionBuilder("connection-timeout-millis", ModelType.LONG, true) - .setXmlName("connection-timeout-millis") - .setAllowExpression(true) - .setValidator(new LongRangeValidator(-1L, 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) - .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 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(SOCKET_TIMEOUT); - ATTRIBUTES.add(CONNECTION_TTL); - ATTRIBUTES.add(CONNECTION_TIMEOUT); - 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(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(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; - } - //TODO, look into alternatives & requires properties on AttributeDefinition - 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/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/Util.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/Util.java deleted file mode 100644 index c20c131823..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/Util.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.as7; - -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -import org.jboss.dmr.ModelNode; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class Util { - public static ModelNode createAddOperation(final PathAddress address) { - return createOperation(ModelDescriptionConstants.ADD, address); - } - - public static ModelNode createAddOperation() { - return createEmptyOperation(ModelDescriptionConstants.ADD, null); - } - - public static ModelNode createRemoveOperation(final PathAddress address) { - return createOperation(ModelDescriptionConstants.REMOVE, address); - } - - public static ModelNode createOperation(final String operationName, final PathAddress address) { - return createEmptyOperation(operationName, address); - } - - public static ModelNode createEmptyOperation(String operationName, final PathAddress address) { - ModelNode op = new ModelNode(); - op.get(OP).set(operationName); - if (address != null) { - op.get(OP_ADDR).set(address.toModelNode()); - } else { - // Just establish the standard structure; caller can fill in address later - op.get(OP_ADDR); - } - return op; - } -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/logging/KeycloakLogger.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/logging/KeycloakLogger.java deleted file mode 100755 index fb4bc0f3a3..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/logging/KeycloakLogger.java +++ /dev/null @@ -1,49 +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.as7.logging; - -import org.jboss.logging.BasicLogger; -import org.jboss.logging.LogMessage; -import org.jboss.logging.Logger; -import org.jboss.logging.Message; -import org.jboss.logging.MessageLogger; - -import static org.jboss.logging.Logger.Level.DEBUG; -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); - - @LogMessage(level = DEBUG) - @Message(value = "Keycloak has overriden and secured deployment %s") - void warSecured(String deployment); - -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/logging/KeycloakMessages.java b/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/logging/KeycloakMessages.java deleted file mode 100755 index 10c8e6f02a..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/java/org/keycloak/subsystem/as7/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.as7.logging; - -import org.jboss.logging.MessageBundle; -import org.jboss.logging.Messages; - -/** - * 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 = "TLIP") -public interface KeycloakMessages { - - /** - * The messages - */ - KeycloakMessages MESSAGES = Messages.getBundle(KeycloakMessages.class); -} diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension b/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension deleted file mode 100755 index f16dc384c5..0000000000 --- a/adapters/oidc/as7-eap6/as7-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.as7.KeycloakExtension diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/org/keycloak/subsystem/as7/LocalDescriptions.properties b/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/org/keycloak/subsystem/as7/LocalDescriptions.properties deleted file mode 100755 index bc929a41cd..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/org/keycloak/subsystem/as7/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.socket-timeout-millis=Timeout for socket waiting for data in milliseconds -keycloak.realm.connection-ttl-millis=Connection time to live in milliseconds -keycloak.realm.connection-timeout-millis=Timeout for establishing the connection with the remote host in milliseconds -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.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.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.socket-timeout-millis=Timeout for socket waiting for data in milliseconds -keycloak.secure-deployment.connection-ttl-millis=Connection time to live in milliseconds -keycloak.secure-deployment.connection-timeout-millis=Timeout for establishing the connection with the remote host in milliseconds -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.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.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/as7-eap6/as7-subsystem/src/main/resources/schema/keycloak_1_1.xsd b/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/schema/keycloak_1_1.xsd deleted file mode 100755 index 0aee4225c0..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/schema/keycloak_1_1.xsd +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/schema/keycloak_1_2.xsd b/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/schema/keycloak_1_2.xsd deleted file mode 100755 index d313791f1d..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/main/resources/schema/keycloak_1_2.xsd +++ /dev/null @@ -1,135 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - diff --git a/adapters/oidc/as7-eap6/as7-subsystem/src/test/java/org/keycloak/subsystem/as7/RealmDefinitionTestCase.java b/adapters/oidc/as7-eap6/as7-subsystem/src/test/java/org/keycloak/subsystem/as7/RealmDefinitionTestCase.java deleted file mode 100755 index eaa9f0e464..0000000000 --- a/adapters/oidc/as7-eap6/as7-subsystem/src/test/java/org/keycloak/subsystem/as7/RealmDefinitionTestCase.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.as7; - - -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/realms/demo/protocol/openid-connect/login"); - model.get("code-url").set("http://localhost:8080/auth-server/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/as7-eap6/pom.xml b/adapters/oidc/as7-eap6/pom.xml deleted file mode 100755 index eb24ff34f1..0000000000 --- a/adapters/oidc/as7-eap6/pom.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - keycloak-parent - org.keycloak - 999-SNAPSHOT - ../../../pom.xml - - Keycloak AS7 / JBoss EAP 6 Integration - - 4.0.0 - - keycloak-as7-integration-pom - pom - - - 1.8 - 1.8 - - - - - - org.jboss.as - jboss-as-parent - ${jboss.as.version} - pom - import - - - - - - as7-adapter-spi - as7-adapter - as7-subsystem - - diff --git a/adapters/oidc/pom.xml b/adapters/oidc/pom.xml index 58fdf0b42c..815fbad3ec 100755 --- a/adapters/oidc/pom.xml +++ b/adapters/oidc/pom.xml @@ -48,16 +48,4 @@ wildfly wildfly-elytron - - - - AS7 - - [,9) - - - as7-eap6 - - - diff --git a/adapters/saml/as7-eap6/adapter/pom.xml b/adapters/saml/as7-eap6/adapter/pom.xml deleted file mode 100755 index fca3973842..0000000000 --- a/adapters/saml/as7-eap6/adapter/pom.xml +++ /dev/null @@ -1,128 +0,0 @@ - - - - - - keycloak-saml-eap-integration-pom - org.keycloak - 999-SNAPSHOT - ../pom.xml - - 4.0.0 - - keycloak-saml-as7-adapter - Keycloak SAML AS7 Integration - - - - - - jboss - https://repository.jboss.org/nexus/content/groups/public/ - - false - - - - - - - org.keycloak - keycloak-common - - - org.keycloak - keycloak-as7-adapter-spi - - - org.keycloak - keycloak-adapter-spi - - - org.keycloak - keycloak-saml-adapter-api-public - - - org.keycloak - keycloak-saml-adapter-core - - - org.bouncycastle - bcprov-jdk15on - - - org.jboss.spec.javax.servlet - jboss-servlet-api_3.0_spec - provided - - - org.jboss.logging - jboss-logging - provided - - - org.jboss.web - jbossweb - 7.0.17.Final - provided - - - org.jboss.as - jboss-as-web - 7.1.2.Final - provided - - - org.infinispan - infinispan-core - provided - 5.2.20.Final - - - org.infinispan - infinispan-cachestore-remote - provided - 5.2.20.Final - - - org.keycloak - keycloak-saml-tomcat-adapter-core - - - org.apache.tomcat - tomcat-servlet-api - - - org.apache.tomcat - tomcat-catalina - - - org.apache.tomcat - catalina - - - - - junit - junit - test - - - - diff --git a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/SamlAuthenticatorValve.java b/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/SamlAuthenticatorValve.java deleted file mode 100755 index e5399d90e8..0000000000 --- a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/SamlAuthenticatorValve.java +++ /dev/null @@ -1,82 +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.adapters.saml.jbossweb; - -import org.apache.catalina.LifecycleException; -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; -import org.apache.catalina.core.StandardContext; -import org.apache.catalina.deploy.LoginConfig; - -import org.keycloak.adapters.jbossweb.JBossWebPrincipalFactory; -import org.keycloak.adapters.saml.*; -import org.keycloak.adapters.spi.SessionIdMapperUpdater; -import org.keycloak.adapters.tomcat.PrincipalFactory; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -/** - * Keycloak authentication valve - * - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class SamlAuthenticatorValve extends AbstractSamlAuthenticatorValve { - public boolean authenticate(Request request, HttpServletResponse response, LoginConfig config) throws java.io.IOException { - return authenticateInternal(request, response, config); - } - - @Override - protected boolean forwardToErrorPageInternal(Request request, HttpServletResponse response, Object loginConfig) throws IOException { - if (loginConfig == null) return false; - LoginConfig config = (LoginConfig)loginConfig; - if (config.getErrorPage() == null) return false; - forwardToErrorPage(request, (Response)response, config); - return true; - } - - @Override - protected void forwardToLogoutPage(Request request, HttpServletResponse response, SamlDeployment deployment) { - super.forwardToLogoutPage(request, response, deployment); - } - - @Override - public void start() throws LifecycleException { - StandardContext standardContext = (StandardContext) context; - standardContext.addLifecycleListener(this); - super.start(); - } - - - public void logout(Request request) { - logoutInternal(request); - } - - @Override - protected PrincipalFactory createPrincipalFactory() { - return new JBossWebPrincipalFactory(); - } - - @Override - protected void addTokenStoreUpdaters() { - context.addApplicationListenerInstance(new IdMapperUpdaterSessionListener(mapper)); - setIdMapperUpdater(SessionIdMapperUpdater.EXTERNAL); - super.addTokenStoreUpdaters(); - } -} diff --git a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/InfinispanSessionCacheIdMapperUpdater.java b/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/InfinispanSessionCacheIdMapperUpdater.java deleted file mode 100644 index dd19a7b7e6..0000000000 --- a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/InfinispanSessionCacheIdMapperUpdater.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2017 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.adapters.saml.jbossweb.infinispan; - -import org.keycloak.adapters.saml.AdapterConstants; -import org.keycloak.adapters.spi.SessionIdMapper; -import org.keycloak.adapters.spi.SessionIdMapperUpdater; - -import java.util.List; -import javax.naming.InitialContext; -import javax.naming.NamingException; -import javax.servlet.ServletContext; -import org.apache.catalina.Context; -import org.infinispan.Cache; -import org.infinispan.configuration.cache.CacheMode; -import org.infinispan.configuration.cache.Configuration; -import org.infinispan.loaders.CacheLoaderManager; -import org.infinispan.loaders.remote.RemoteCacheStore; -import org.infinispan.manager.EmbeddedCacheManager; -import org.jboss.logging.Logger; - -/** - * - * @author hmlnarik - */ -public class InfinispanSessionCacheIdMapperUpdater { - - private static final Logger LOG = Logger.getLogger(InfinispanSessionCacheIdMapperUpdater.class); - - public static final String DEFAULT_CACHE_CONTAINER_JNDI_NAME = "java:jboss/infinispan/container"; - - public static SessionIdMapperUpdater addTokenStoreUpdaters(Context context, SessionIdMapper mapper, SessionIdMapperUpdater previousIdMapperUpdater) { - ServletContext servletContext = context.getServletContext(); - String containerName = servletContext == null ? null : servletContext.getInitParameter(AdapterConstants.REPLICATION_CONFIG_CONTAINER_PARAM_NAME); - String cacheName = servletContext == null ? null : servletContext.getInitParameter(AdapterConstants.REPLICATION_CONFIG_SSO_CACHE_PARAM_NAME); - - // the following is based on https://github.com/jbossas/jboss-as/blob/7.2.0.Final/clustering/web-infinispan/src/main/java/org/jboss/as/clustering/web/infinispan/DistributedCacheManagerFactory.java#L116-L122 - String host = context.getParent() == null ? "" : context.getParent().getName(); - String contextPath = context.getPath(); - if ("/".equals(contextPath)) { - contextPath = "/ROOT"; - } - String deploymentSessionCacheName = host + contextPath; - - if (containerName == null || cacheName == null || deploymentSessionCacheName == null) { - LOG.warnv("Cannot determine parameters of SSO cache for deployment {0}.", host + contextPath); - - return previousIdMapperUpdater; - } - - String cacheContainerLookup = DEFAULT_CACHE_CONTAINER_JNDI_NAME + "/" + containerName; - - try { - EmbeddedCacheManager cacheManager = (EmbeddedCacheManager) new InitialContext().lookup(cacheContainerLookup); - - Configuration ssoCacheConfiguration = cacheManager.getCacheConfiguration(cacheName); - if (ssoCacheConfiguration == null) { - Configuration cacheConfiguration = cacheManager.getCacheConfiguration(deploymentSessionCacheName); - if (cacheConfiguration == null) { - LOG.debugv("Using default configuration for SSO cache {0}.{1}.", containerName, cacheName); - ssoCacheConfiguration = cacheManager.getDefaultCacheConfiguration(); - } else { - LOG.debugv("Using distributed HTTP session cache configuration for SSO cache {0}.{1}, configuration taken from cache {2}", - containerName, cacheName, deploymentSessionCacheName); - ssoCacheConfiguration = cacheConfiguration; - cacheManager.defineConfiguration(cacheName, ssoCacheConfiguration); - } - } else { - LOG.debugv("Using custom configuration of SSO cache {0}.{1}.", containerName, cacheName); - } - - CacheMode ssoCacheMode = ssoCacheConfiguration.clustering().cacheMode(); - if (ssoCacheMode != CacheMode.REPL_ASYNC && ssoCacheMode != CacheMode.REPL_SYNC) { - LOG.warnv("SSO cache mode is {0}, it is recommended to use replicated mode instead.", ssoCacheConfiguration.clustering().cacheModeString()); - } - - Cache ssoCache = cacheManager.getCache(cacheName, true); - final SsoSessionCacheListener listener = new SsoSessionCacheListener(ssoCache, mapper); - ssoCache.addListener(listener); - - // Not possible to add listener for cross-DC support because of too old Infinispan in AS 7 - warnIfRemoteStoreIsUsed(ssoCache); - - LOG.debugv("Added distributed SSO session cache, lookup={0}, cache name={1}", cacheContainerLookup, cacheName); - - SsoCacheSessionIdMapperUpdater updater = new SsoCacheSessionIdMapperUpdater(ssoCache, previousIdMapperUpdater); - - return updater; - } catch (NamingException ex) { - LOG.warnv("Failed to obtain distributed session cache container, lookup={0}", cacheContainerLookup); - return previousIdMapperUpdater; - } - } - - private static void warnIfRemoteStoreIsUsed(Cache ssoCache) { - final List stores = getRemoteStores(ssoCache); - if (stores == null || stores.isEmpty()) { - return; - } - - LOG.warnv("Unable to listen for events on remote stores configured for cache {0} (unsupported in this Infinispan limitations), logouts will not be propagated.", ssoCache.getName()); - } - - public static List getRemoteStores(Cache ssoCache) { - return ssoCache.getAdvancedCache().getComponentRegistry().getComponent(CacheLoaderManager.class).getCacheLoaders(RemoteCacheStore.class); - } -} diff --git a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/SsoCacheSessionIdMapperUpdater.java b/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/SsoCacheSessionIdMapperUpdater.java deleted file mode 100644 index 47dbb84962..0000000000 --- a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/SsoCacheSessionIdMapperUpdater.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2017 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.adapters.saml.jbossweb.infinispan; - -import org.keycloak.adapters.spi.SessionIdMapper; -import org.keycloak.adapters.spi.SessionIdMapperUpdater; - -import org.infinispan.Cache; - -/** - * - * @author hmlnarik - */ -public class SsoCacheSessionIdMapperUpdater implements SessionIdMapperUpdater { - - private final SessionIdMapperUpdater delegate; - /** - * Cache where key is a HTTP session ID, and value is a pair (user session ID, principal name) of Strings. - */ - private final Cache httpSessionToSsoCache; - - public SsoCacheSessionIdMapperUpdater(Cache httpSessionToSsoCache, SessionIdMapperUpdater previousIdMapperUpdater) { - this.delegate = previousIdMapperUpdater; - this.httpSessionToSsoCache = httpSessionToSsoCache; - } - - // SessionIdMapperUpdater methods - - @Override - public void clear(SessionIdMapper idMapper) { - httpSessionToSsoCache.clear(); - this.delegate.clear(idMapper); - } - - @Override - public boolean refreshMapping(SessionIdMapper idMapper, String httpSessionId) { - String[] ssoAndPrincipal = httpSessionToSsoCache.get(httpSessionId); - if (ssoAndPrincipal != null) { - this.delegate.map(idMapper, ssoAndPrincipal[0], ssoAndPrincipal[1], httpSessionId); - return true; - } - return false; - } - - @Override - public void map(SessionIdMapper idMapper, String sso, String principal, String httpSessionId) { - httpSessionToSsoCache.put(httpSessionId, new String[] {sso, principal}); - this.delegate.map(idMapper, sso, principal, httpSessionId); - } - - @Override - public void removeSession(SessionIdMapper idMapper, String httpSessionId) { - httpSessionToSsoCache.remove(httpSessionId); - this.delegate.removeSession(idMapper, httpSessionId); - } -} diff --git a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/SsoSessionCacheListener.java b/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/SsoSessionCacheListener.java deleted file mode 100644 index aded4a38e9..0000000000 --- a/adapters/saml/as7-eap6/adapter/src/main/java/org/keycloak/adapters/saml/jbossweb/infinispan/SsoSessionCacheListener.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2017 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.adapters.saml.jbossweb.infinispan; - -import org.keycloak.adapters.spi.SessionIdMapper; - -import java.util.*; -import java.util.concurrent.*; -import org.infinispan.Cache; -import org.infinispan.notifications.Listener; -import org.infinispan.notifications.cachelistener.annotation.*; -import org.infinispan.notifications.cachelistener.event.*; -import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStarted; -import org.infinispan.notifications.cachemanagerlistener.annotation.CacheStopped; -import org.infinispan.notifications.cachemanagerlistener.event.CacheStartedEvent; -import org.infinispan.notifications.cachemanagerlistener.event.CacheStoppedEvent; -import org.infinispan.transaction.xa.GlobalTransaction; -import org.jboss.logging.Logger; - -/** - * - * @author hmlnarik - */ -@Listener -public class SsoSessionCacheListener { - - private static final Logger LOG = Logger.getLogger(SsoSessionCacheListener.class); - - private final ConcurrentMap> map = new ConcurrentHashMap<>(); - - private final SessionIdMapper idMapper; - - private final Cache ssoCache; - - private ExecutorService executor = Executors.newSingleThreadExecutor(); - - public SsoSessionCacheListener(Cache ssoCache, SessionIdMapper idMapper) { - this.ssoCache = ssoCache; - this.idMapper = idMapper; - } - - @TransactionRegistered - public void startTransaction(TransactionRegisteredEvent event) { - map.put(event.getGlobalTransaction(), new ConcurrentLinkedQueue()); - } - - @CacheStarted - public void cacheStarted(CacheStartedEvent event) { - this.executor = Executors.newSingleThreadExecutor(); - } - - @CacheStopped - public void cacheStopped(CacheStoppedEvent event) { - this.executor.shutdownNow(); - } - - @CacheEntryCreated - @CacheEntryRemoved - @CacheEntryModified - public void addEvent(TransactionalEvent event) { - if (event.getGlobalTransaction() != null) { - map.get(event.getGlobalTransaction()).add(event); - } else { - processEvent(event); - } - } - - @TransactionCompleted - public void endTransaction(TransactionCompletedEvent event) { - Queue events = map.remove(event.getGlobalTransaction()); - - if (events == null || ! event.isTransactionSuccessful()) { - return; - } - - if (event.isOriginLocal()) { - // Local events are processed by local HTTP session listener - return; - } - - for (final Event e : events) { - processEvent(e); - } - } - - private void processEvent(final Event e) { - switch (e.getType()) { - case CACHE_ENTRY_CREATED: - this.executor.submit(new Runnable() { - @Override public void run() { - cacheEntryCreated((CacheEntryCreatedEvent) e); - } - }); - break; - - case CACHE_ENTRY_MODIFIED: - this.executor.submit(new Runnable() { - @Override public void run() { - cacheEntryModified((CacheEntryModifiedEvent) e); - } - }); - break; - - case CACHE_ENTRY_REMOVED: - this.executor.submit(new Runnable() { - @Override public void run() { - cacheEntryRemoved((CacheEntryRemovedEvent) e); - } - }); - break; - } - } - - private void cacheEntryCreated(CacheEntryCreatedEvent event) { - if (! (event.getKey() instanceof String)) { - return; - } - - String httpSessionId = (String) event.getKey(); - - if (idMapper.hasSession(httpSessionId)) { - // Ignore local events generated by remote store - LOG.tracev("IGNORING cacheEntryCreated {0}", httpSessionId); - return; - } - - String[] value = ssoCache.get((String) httpSessionId); - - String ssoId = value[0]; - String principal = value[1]; - - LOG.tracev("cacheEntryCreated {0}:{1}", httpSessionId, ssoId); - - this.idMapper.map(ssoId, principal, httpSessionId); - } - - private void cacheEntryModified(CacheEntryModifiedEvent event) { - if (! (event.getKey() instanceof String) || ! (event.getValue() instanceof String[])) { - return; - } - String httpSessionId = (String) event.getKey(); - String[] value = (String[]) event.getValue(); - String ssoId = value[0]; - String principal = value[1]; - - LOG.tracev("cacheEntryModified {0}:{1}", httpSessionId, ssoId); - - this.idMapper.removeSession(httpSessionId); - this.idMapper.map(ssoId, principal, httpSessionId); - } - - private void cacheEntryRemoved(CacheEntryRemovedEvent event) { - if (! (event.getKey() instanceof String)) { - return; - } - - LOG.tracev("cacheEntryRemoved {0}", event.getKey()); - - this.idMapper.removeSession((String) event.getKey()); - } -} diff --git a/adapters/saml/as7-eap6/pom.xml b/adapters/saml/as7-eap6/pom.xml deleted file mode 100755 index 000ba1e060..0000000000 --- a/adapters/saml/as7-eap6/pom.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - keycloak-parent - org.keycloak - 999-SNAPSHOT - ../../../pom.xml - - Keycloak SAML EAP Integration - - 4.0.0 - - keycloak-saml-eap-integration-pom - pom - - - 1.8 - 1.8 - - - - - - org.jboss.as - jboss-as-parent - ${jboss.as.version} - pom - import - - - - - - adapter - subsystem - - diff --git a/adapters/saml/as7-eap6/subsystem/pom.xml b/adapters/saml/as7-eap6/subsystem/pom.xml deleted file mode 100755 index 3711ee094e..0000000000 --- a/adapters/saml/as7-eap6/subsystem/pom.xml +++ /dev/null @@ -1,164 +0,0 @@ - - - - 4.0.0 - - - org.keycloak - keycloak-saml-eap-integration-pom - 999-SNAPSHOT - ../pom.xml - - - keycloak-saml-as7-subsystem - Keycloak SAML AS7 Subsystem - - jar - - - 1.8 - 1.8 - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - false - true - -Xmx512m - - - jboss.home - ${jboss.home} - - - - **/*TestCase.java - - once - - - - - - - - org.keycloak - keycloak-saml-as7-adapter - - - - org.jboss.as - jboss-as-naming - - - - org.jboss.as - jboss-as-server - - - - org.jboss.as - jboss-as-ee - - - - org.jboss.as - jboss-as-web - - - - org.jboss.logging - jboss-logging - - 3.3.2.Final - - - - - org.jboss.logging - jboss-logging-processor - - provided - true - 1.0.0.Final - - - - org.jboss.as - jboss-as-controller - - - - junit - junit - test - - - - - - community - - - !product - - - - - - org.jboss.as - jboss-as-subsystem-test - test - - - - - - product - - - product - - - - - redhat-ga - https://maven.repository.redhat.com/ga/ - - false - - - - - - - org.jboss.as - jboss-as-subsystem-test - ${jboss.as.subsystem.test.version} - pom - test - - - - - diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/AllowedClockSkew.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/AllowedClockSkew.java deleted file mode 100644 index 997c75e2b6..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/AllowedClockSkew.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2019 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.saml.as7; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.as.controller.operations.validation.EnumValidator; -import org.jboss.as.controller.operations.validation.IntRangeValidator; -import org.jboss.dmr.ModelNode; -import org.jboss.dmr.ModelType; - -/** - * - * @author rmartinc - */ -abstract public class AllowedClockSkew { - - static final SimpleAttributeDefinition ALLOWED_CLOCK_SKEW_VALUE = - new SimpleAttributeDefinitionBuilder(Constants.Model.ALLOWED_CLOCK_SKEW_VALUE, ModelType.INT, false) - .setXmlName(Constants.XML.ALLOWED_CLOCK_SKEW) - .setAllowExpression(true) - .setValidator(new IntRangeValidator(1, Integer.MAX_VALUE, true, true)) - .build(); - - static private enum AllowedClockSkewUnits {MINUTES, SECONDS, MILLISECONDS, MICROSECONDS, NANOSECONDS}; - - static final SimpleAttributeDefinition ALLOWED_CLOCK_SKEW_UNIT = - new SimpleAttributeDefinitionBuilder(Constants.Model.ALLOWED_CLOCK_SKEW_UNIT, ModelType.STRING, true) - .setXmlName(Constants.XML.ALLOWED_CLOCK_SKEW_UNIT) - .setAllowExpression(true) - .setDefaultValue(new ModelNode(AllowedClockSkewUnits.SECONDS.name())) - .setValidator(EnumValidator.create(AllowedClockSkewUnits.class, true, true)) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {ALLOWED_CLOCK_SKEW_UNIT, ALLOWED_CLOCK_SKEW_VALUE}; -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Configuration.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Configuration.java deleted file mode 100644 index 580d4cf85a..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Configuration.java +++ /dev/null @@ -1,94 +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.saml.as7; - -import java.util.List; - -import org.jboss.as.controller.OperationFailedException; -import org.jboss.as.server.deployment.DeploymentUnit; -import org.jboss.as.web.deployment.WarMetaData; -import org.jboss.dmr.ModelNode; -import org.jboss.dmr.Property; -import org.jboss.metadata.web.jboss.JBossWebMetaData; - -/** - * @author Marko Strukelj - */ -public class Configuration { - - static final Configuration INSTANCE = new Configuration(); - - private ModelNode config = new ModelNode(); - - private Configuration() { - } - - void updateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - this.updateModel(operation, model, false); - } - - void updateModel(final ModelNode operation, final ModelNode model, final boolean checkSingleton) throws OperationFailedException { - ModelNode node = config; - - final List addressNodes = operation.get("address").asPropertyList(); - final int lastIndex = addressNodes.size() - 1; - for (int i = 0; i < addressNodes.size(); i++) { - Property addressNode = addressNodes.get(i); - // if checkSingleton is true, we verify if the key for the last element (e.g. SP or IDP) in the address path is already defined - if (i == lastIndex && checkSingleton) { - if (node.get(addressNode.getName()).isDefined()) { - // found an existing resource, throw an exception - throw new OperationFailedException("Duplicate resource: " + addressNode.getName()); - } - } - node = node.get(addressNode.getName()).get(addressNode.getValue().asString()); - } - node.set(model); - } - - public ModelNode getSecureDeployment(DeploymentUnit deploymentUnit) { - String name = preferredDeploymentName(deploymentUnit); - ModelNode secureDeployment = config.get("subsystem").get("keycloak-saml").get(Constants.Model.SECURE_DEPLOYMENT); - if (secureDeployment.hasDefined(name)) { - return secureDeployment.get(name); - } - return null; - } - - public boolean isSecureDeployment(DeploymentUnit deploymentUnit) { - return getSecureDeployment(deploymentUnit) != null; - } - - // 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/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Constants.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Constants.java deleted file mode 100755 index 6c11dd68c5..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Constants.java +++ /dev/null @@ -1,180 +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.saml.as7; - -/** - * @author Marko Strukelj - */ -public class Constants { - - static class Model { - static final String SECURE_DEPLOYMENT = "secure-deployment"; - static final String SERVICE_PROVIDER = "SP"; - - static final String SSL_POLICY = "sslPolicy"; - static final String NAME_ID_POLICY_FORMAT = "nameIDPolicyFormat"; - static final String LOGOUT_PAGE = "logoutPage"; - static final String FORCE_AUTHENTICATION = "forceAuthentication"; - static final String KEEP_DOM_ASSERTION = "keepDOMAssertion"; - static final String IS_PASSIVE = "isPassive"; - static final String TURN_OFF_CHANGE_SESSSION_ID_ON_LOGIN = "turnOffChangeSessionIdOnLogin"; - static final String AUTODETECT_BEARER_ONLY = "autodetectBearerOnly"; - static final String ROLE_ATTRIBUTES = "RoleIdentifiers"; - static final String SIGNING = "signing"; - static final String ENCRYPTION = "encryption"; - static final String KEY = "Key"; - static final String RESOURCE = "resource"; - static final String PASSWORD = "password"; - - static final String PRIVATE_KEY_ALIAS = "PrivateKey-alias"; - static final String PRIVATE_KEY_PASSWORD = "PrivateKey-password"; - static final String CERTIFICATE_ALIAS = "Certificate-alias"; - static final String KEY_STORE = "KeyStore"; - static final String SIGN_REQUEST = "signRequest"; - static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature"; - static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature"; - static final String ASSERTION_CONSUMER_SERVICE_URL = "assertionConsumerServiceUrl"; - - static final String REQUEST_BINDING = "requestBinding"; - static final String BINDING_URL = "bindingUrl"; - static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature"; - static final String SIGN_RESPONSE = "signResponse"; - static final String RESPONSE_BINDING = "responseBinding"; - static final String POST_BINDING_URL = "postBindingUrl"; - static final String REDIRECT_BINDING_URL = "redirectBindingUrl"; - static final String SINGLE_SIGN_ON = "SingleSignOnService"; - static final String SINGLE_LOGOUT = "SingleLogoutService"; - static final String IDENTITY_PROVIDER = "IDP"; - static final String PRINCIPAL_NAME_MAPPING_POLICY = "PrincipalNameMapping-policy"; - static final String PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME = "PrincipalNameMapping-attribute-name"; - static final String SIGNATURE_ALGORITHM = "signatureAlgorithm"; - static final String SIGNATURE_CANONICALIZATION_METHOD = "signatureCanonicalizationMethod"; - static final String METADATA_URL = "metadataUrl"; - static final String PRIVATE_KEY_PEM = "PrivateKeyPem"; - static final String PUBLIC_KEY_PEM = "PublicKeyPem"; - static final String CERTIFICATE_PEM = "CertificatePem"; - static final String TYPE = "type"; - static final String ALIAS = "alias"; - static final String FILE = "file"; - static final String SIGNATURES_REQUIRED = "signaturesRequired"; - - // role mappings provider model constants. - static final String ROLE_MAPPINGS_PROVIDER_ID = "roleMappingsProviderId"; - static final String ROLE_MAPPINGS_PROVIDER_CONFIG = "roleMappingsProviderConfig"; - - // allowed clock skew model constants - static final String ALLOWED_CLOCK_SKEW = "AllowedClockSkew"; - static final String ALLOWED_CLOCK_SKEW_UNIT = "unit"; - static final String ALLOWED_CLOCK_SKEW_VALUE = "value"; - - // http client model constants - static final String HTTP_CLIENT = "HttpClient"; - static final String ALLOW_ANY_HOSTNAME = "allowAnyHostname"; - static final String CLIENT_KEYSTORE = "clientKeystore"; - static final String CLIENT_KEYSTORE_PASSWORD = "clientKeystorePassword"; - static final String CONNECTION_POOL_SIZE = "connectionPoolSize"; - static final String DISABLE_TRUST_MANAGER = "disableTrustManager"; - static final String PROXY_URL = "proxyUrl"; - static final String TRUSTSTORE = "truststore"; - static final String TRUSTSTORE_PASSWORD = "truststorePassword"; - static final String SOCKET_TIMEOUT = "socketTimeout"; - static final String CONNECTION_TIMEOUT = "connectionTimeout"; - static final String CONNECTION_TTL = "connectionTtl"; - } - - static class XML { - static final String SECURE_DEPLOYMENT = "secure-deployment"; - static final String SERVICE_PROVIDER = "SP"; - - static final String NAME = "name"; - static final String ENTITY_ID = "entityID"; - static final String SSL_POLICY = "sslPolicy"; - static final String NAME_ID_POLICY_FORMAT = "nameIDPolicyFormat"; - static final String LOGOUT_PAGE = "logoutPage"; - static final String FORCE_AUTHENTICATION = "forceAuthentication"; - static final String KEEP_DOM_ASSERTION = "keepDOMAssertion"; - static final String ROLE_IDENTIFIERS = "RoleIdentifiers"; - static final String SIGNING = "signing"; - static final String ENCRYPTION = "encryption"; - static final String KEYS = "Keys"; - static final String KEY = "Key"; - static final String RESOURCE = "resource"; - static final String PASSWORD = "password"; - static final String KEY_STORE = "KeyStore"; - static final String PRIVATE_KEY = "PrivateKey"; - static final String CERTIFICATE = "Certificate"; - static final String IS_PASSIVE = "isPassive"; - static final String TURN_OFF_CHANGE_SESSSION_ID_ON_LOGIN = "turnOffChangeSessionIdOnLogin"; - static final String AUTODETECT_BEARER_ONLY = "autodetectBearerOnly"; - - static final String PRIVATE_KEY_ALIAS = "alias"; - static final String PRIVATE_KEY_PASSWORD = "password"; - static final String CERTIFICATE_ALIAS = "alias"; - static final String SIGN_REQUEST = "signRequest"; - static final String VALIDATE_RESPONSE_SIGNATURE = "validateResponseSignature"; - static final String VALIDATE_ASSERTION_SIGNATURE = "validateAssertionSignature"; - static final String REQUEST_BINDING = "requestBinding"; - static final String BINDING_URL = "bindingUrl"; - static final String VALIDATE_REQUEST_SIGNATURE = "validateRequestSignature"; - static final String SIGN_RESPONSE = "signResponse"; - static final String RESPONSE_BINDING = "responseBinding"; - static final String POST_BINDING_URL = "postBindingUrl"; - static final String REDIRECT_BINDING_URL = "redirectBindingUrl"; - static final String SINGLE_SIGN_ON = "SingleSignOnService"; - static final String SINGLE_LOGOUT = "SingleLogoutService"; - static final String IDENTITY_PROVIDER = "IDP"; - static final String PRINCIPAL_NAME_MAPPING = "PrincipalNameMapping"; - static final String PRINCIPAL_NAME_MAPPING_POLICY = "policy"; - static final String PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME = "attribute"; - static final String ATTRIBUTE = "Attribute"; - static final String SIGNATURE_ALGORITHM = "signatureAlgorithm"; - static final String SIGNATURE_CANONICALIZATION_METHOD = "signatureCanonicalizationMethod"; - static final String METADATA_URL = "metadataUrl"; - static final String PRIVATE_KEY_PEM = "PrivateKeyPem"; - static final String PUBLIC_KEY_PEM = "PublicKeyPem"; - static final String CERTIFICATE_PEM = "CertificatePem"; - static final String TYPE = "type"; - static final String ALIAS = "alias"; - static final String FILE = "file"; - static final String SIGNATURES_REQUIRED = "signaturesRequired"; - static final String ASSERTION_CONSUMER_SERVICE_URL = "assertionConsumerServiceUrl"; - - // role mappings provider XML constants - static final String ID = "id"; - static final String VALUE = "value"; - static final String PROPERTY = "Property"; - static final String ROLE_MAPPINGS_PROVIDER = "RoleMappingsProvider"; - - // allowed clock skew XML constants - static final String ALLOWED_CLOCK_SKEW = "AllowedClockSkew"; - static final String ALLOWED_CLOCK_SKEW_UNIT = "unit"; - - // http client XML constants - static final String HTTP_CLIENT = "HttpClient"; - static final String ALLOW_ANY_HOSTNAME = "allowAnyHostname"; - static final String CLIENT_KEYSTORE = "clientKeystore"; - static final String CLIENT_KEYSTORE_PASSWORD = "clientKeystorePassword"; - static final String CONNECTION_POOL_SIZE = "connectionPoolSize"; - static final String DISABLE_TRUST_MANAGER = "disableTrustManager"; - static final String PROXY_URL = "proxyUrl"; - static final String TRUSTSTORE = "truststore"; - static final String TRUSTSTORE_PASSWORD = "truststorePassword"; - static final String SOCKET_TIMEOUT = "socketTimeout"; - static final String CONNECTION_TIMEOUT = "connectionTimeout"; - static final String CONNECTION_TTL = "connectionTtl"; - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/HttpClientDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/HttpClientDefinition.java deleted file mode 100644 index 2592e3050d..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/HttpClientDefinition.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.saml.as7; - -import java.util.HashMap; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.dmr.ModelType; - -/** - * This class contains the definitions for the {@code HttpClient} attributes, as specified in the schema's {@code http-client-type} - * complex type. - * - * @author Stefan Guilhen - */ -abstract class HttpClientDefinition { - - private static final SimpleAttributeDefinition ALLOW_ANY_HOSTNAME = - new SimpleAttributeDefinitionBuilder(Constants.Model.ALLOW_ANY_HOSTNAME, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.ALLOW_ANY_HOSTNAME) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition CLIENT_KEYSTORE = - new SimpleAttributeDefinitionBuilder(Constants.Model.CLIENT_KEYSTORE, ModelType.STRING, true) - .setXmlName(Constants.XML.CLIENT_KEYSTORE) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition CLIENT_KEYSTORE_PASSWORD = - new SimpleAttributeDefinitionBuilder(Constants.Model.CLIENT_KEYSTORE_PASSWORD, ModelType.STRING, true) - .setXmlName(Constants.XML.CLIENT_KEYSTORE_PASSWORD) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition CONNECTION_POOL_SIZE = - new SimpleAttributeDefinitionBuilder(Constants.Model.CONNECTION_POOL_SIZE, ModelType.INT, true) - .setXmlName(Constants.XML.CONNECTION_POOL_SIZE) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition DISABLE_TRUST_MANAGER = - new SimpleAttributeDefinitionBuilder(Constants.Model.DISABLE_TRUST_MANAGER, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.DISABLE_TRUST_MANAGER) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition PROXY_URL = - new SimpleAttributeDefinitionBuilder(Constants.Model.PROXY_URL, ModelType.STRING, true) - .setXmlName(Constants.XML.PROXY_URL) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition TRUSTSTORE = - new SimpleAttributeDefinitionBuilder(Constants.Model.TRUSTSTORE, ModelType.STRING, true) - .setXmlName(Constants.XML.TRUSTSTORE) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition TRUSTSTORE_PASSWORD = - new SimpleAttributeDefinitionBuilder(Constants.Model.TRUSTSTORE_PASSWORD, ModelType.STRING, true) - .setXmlName(Constants.XML.TRUSTSTORE_PASSWORD) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition SOCKET_TIMEOUT = - new SimpleAttributeDefinitionBuilder(Constants.Model.SOCKET_TIMEOUT, ModelType.LONG, true) - .setXmlName(Constants.XML.SOCKET_TIMEOUT) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition CONNECTION_TIMEOUT = - new SimpleAttributeDefinitionBuilder(Constants.Model.CONNECTION_TIMEOUT, ModelType.LONG, true) - .setXmlName(Constants.XML.CONNECTION_TIMEOUT) - .setAllowExpression(true) - .build(); - - private static final SimpleAttributeDefinition CONNECTION_TTL = - new SimpleAttributeDefinitionBuilder(Constants.Model.CONNECTION_TTL, ModelType.LONG, true) - .setXmlName(Constants.XML.CONNECTION_TTL) - .setAllowExpression(true) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {ALLOW_ANY_HOSTNAME, CLIENT_KEYSTORE, CLIENT_KEYSTORE_PASSWORD, - CONNECTION_POOL_SIZE, DISABLE_TRUST_MANAGER, PROXY_URL, TRUSTSTORE, TRUSTSTORE_PASSWORD, SOCKET_TIMEOUT, CONNECTION_TIMEOUT, CONNECTION_TTL}; - - private static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/IdentityProviderAddHandler.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/IdentityProviderAddHandler.java deleted file mode 100644 index be8bb250f7..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/IdentityProviderAddHandler.java +++ /dev/null @@ -1,48 +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.saml.as7; - -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; - -/** - * @author Marko Strukelj - */ -class IdentityProviderAddHandler extends AbstractAddStepHandler { - - IdentityProviderAddHandler() { - } - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) throws OperationFailedException { - Configuration.INSTANCE.updateModel(operation, model, true); - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - for (AttributeDefinition attr : IdentityProviderDefinition.ALL_ATTRIBUTES) { - attr.validateAndSet(operation, model); - } - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/IdentityProviderDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/IdentityProviderDefinition.java deleted file mode 100644 index ce88abbe79..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/IdentityProviderDefinition.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates - * and other contributors as indicated by the @author tags. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.keycloak.subsystem.saml.as7; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.ObjectTypeAttributeDefinition; -import org.jboss.as.controller.OperationStepHandler; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; -import org.jboss.as.controller.ReloadRequiredWriteAttributeHandler; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.as.controller.SimpleResourceDefinition; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.dmr.ModelType; - -import java.util.HashMap; - -/** - * @author Marko Strukelj - */ -public class IdentityProviderDefinition extends SimpleResourceDefinition { - - private static final SimpleAttributeDefinition SIGNATURES_REQUIRED = - new SimpleAttributeDefinitionBuilder(Constants.Model.SIGNATURES_REQUIRED, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.SIGNATURES_REQUIRED) - .build(); - - private static final SimpleAttributeDefinition SIGNATURE_ALGORITHM = - new SimpleAttributeDefinitionBuilder(Constants.Model.SIGNATURE_ALGORITHM, ModelType.STRING, true) - .setXmlName(Constants.XML.SIGNATURE_ALGORITHM) - .build(); - - private static final SimpleAttributeDefinition SIGNATURE_CANONICALIZATION_METHOD = - new SimpleAttributeDefinitionBuilder(Constants.Model.SIGNATURE_CANONICALIZATION_METHOD, ModelType.STRING, true) - .setXmlName(Constants.XML.SIGNATURE_CANONICALIZATION_METHOD) - .build(); - - private static final SimpleAttributeDefinition METADATA_URL = - new SimpleAttributeDefinitionBuilder(Constants.Model.METADATA_URL, ModelType.STRING, true) - .setXmlName(Constants.XML.METADATA_URL) - .setAllowExpression(true) - .build(); - - private static final ObjectTypeAttributeDefinition SINGLE_SIGN_ON = - ObjectTypeAttributeDefinition.Builder.of(Constants.Model.SINGLE_SIGN_ON, - SingleSignOnDefinition.ATTRIBUTES) - .setAllowNull(false) - .build(); - - private static final ObjectTypeAttributeDefinition SINGLE_LOGOUT = - ObjectTypeAttributeDefinition.Builder.of(Constants.Model.SINGLE_LOGOUT, - SingleLogoutDefinition.ATTRIBUTES) - .setAllowNull(false) - .build(); - - private static final ObjectTypeAttributeDefinition ALLOWED_CLOCK_SKEW = - ObjectTypeAttributeDefinition.Builder.of(Constants.Model.ALLOWED_CLOCK_SKEW, - AllowedClockSkew.ATTRIBUTES) - .setAllowNull(true) - .build(); - - private static final ObjectTypeAttributeDefinition HTTP_CLIENT = - ObjectTypeAttributeDefinition.Builder.of(Constants.Model.HTTP_CLIENT, - HttpClientDefinition.ATTRIBUTES) - .setAllowNull(true) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGNATURES_REQUIRED, SIGNATURE_ALGORITHM, SIGNATURE_CANONICALIZATION_METHOD, METADATA_URL}; - - static final SimpleAttributeDefinition[] ALL_ATTRIBUTES = {SIGNATURES_REQUIRED, SIGNATURE_ALGORITHM, SIGNATURE_CANONICALIZATION_METHOD, METADATA_URL, - SINGLE_SIGN_ON, SINGLE_LOGOUT, ALLOWED_CLOCK_SKEW, HTTP_CLIENT}; - - private static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ALL_ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - } - - static final IdentityProviderDefinition INSTANCE = new IdentityProviderDefinition(); - - private IdentityProviderDefinition() { - super(PathElement.pathElement(Constants.Model.IDENTITY_PROVIDER), - KeycloakSamlExtension.getResourceDescriptionResolver(Constants.Model.IDENTITY_PROVIDER), - new IdentityProviderAddHandler(), - ReloadRequiredRemoveStepHandler.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); - - final OperationStepHandler writeHandler = new ReloadRequiredWriteAttributeHandler(ALL_ATTRIBUTES); - for (AttributeDefinition attribute : ALL_ATTRIBUTES) { - resourceRegistration.registerReadWriteAttribute(attribute, null, writeHandler); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } -} \ No newline at end of file diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyAddHandler.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyAddHandler.java deleted file mode 100644 index b6f99f8dc8..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyAddHandler.java +++ /dev/null @@ -1,48 +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.saml.as7; - -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; - -/** - * @author Marko Strukelj - */ -class KeyAddHandler extends AbstractAddStepHandler { - - KeyAddHandler() { - } - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) throws OperationFailedException { - Configuration.INSTANCE.updateModel(operation, model); - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - for (AttributeDefinition attr : KeyDefinition.ALL_ATTRIBUTES) { - attr.validateAndSet(operation, model); - } - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyDefinition.java deleted file mode 100644 index 9ea5cf9051..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyDefinition.java +++ /dev/null @@ -1,121 +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.saml.as7; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.ObjectTypeAttributeDefinition; -import org.jboss.as.controller.OperationStepHandler; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; -import org.jboss.as.controller.ReloadRequiredWriteAttributeHandler; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.as.controller.SimpleResourceDefinition; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.dmr.ModelType; - -import java.util.HashMap; - -/** - * @author Marko Strukelj - */ -public class KeyDefinition extends SimpleResourceDefinition { - - static final SimpleAttributeDefinition SIGNING = - new SimpleAttributeDefinitionBuilder(Constants.Model.SIGNING, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.SIGNING) - .build(); - - static final SimpleAttributeDefinition ENCRYPTION = - new SimpleAttributeDefinitionBuilder(Constants.Model.ENCRYPTION, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.ENCRYPTION) - .build(); - - static final SimpleAttributeDefinition PRIVATE_KEY_PEM = - new SimpleAttributeDefinitionBuilder(Constants.Model.PRIVATE_KEY_PEM, ModelType.STRING, true) - .setXmlName(Constants.XML.PRIVATE_KEY_PEM) - .build(); - - static final SimpleAttributeDefinition PUBLIC_KEY_PEM = - new SimpleAttributeDefinitionBuilder(Constants.Model.PUBLIC_KEY_PEM, ModelType.STRING, true) - .setXmlName(Constants.XML.PUBLIC_KEY_PEM) - .build(); - - static final SimpleAttributeDefinition CERTIFICATE_PEM = - new SimpleAttributeDefinitionBuilder(Constants.Model.CERTIFICATE_PEM, ModelType.STRING, true) - .setXmlName(Constants.XML.CERTIFICATE_PEM) - .build(); - - static final ObjectTypeAttributeDefinition KEY_STORE = - ObjectTypeAttributeDefinition.Builder.of(Constants.Model.KEY_STORE, - KeyStoreDefinition.ALL_ATTRIBUTES) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGNING, ENCRYPTION}; - static final SimpleAttributeDefinition[] ELEMENTS = {PRIVATE_KEY_PEM, PUBLIC_KEY_PEM, CERTIFICATE_PEM}; - static final AttributeDefinition[] ALL_ATTRIBUTES = {SIGNING, ENCRYPTION, PRIVATE_KEY_PEM, PUBLIC_KEY_PEM, CERTIFICATE_PEM, KEY_STORE}; - - static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - } - - static final HashMap ELEMENT_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ELEMENTS) { - ELEMENT_MAP.put(def.getXmlName(), def); - } - } - - static final KeyDefinition INSTANCE = new KeyDefinition(); - - private KeyDefinition() { - super(PathElement.pathElement(Constants.Model.KEY), - KeycloakSamlExtension.getResourceDescriptionResolver(Constants.Model.KEY), - new KeyAddHandler(), - ReloadRequiredRemoveStepHandler.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); - - final OperationStepHandler writeHandler = new ReloadRequiredWriteAttributeHandler(ALL_ATTRIBUTES); - for (AttributeDefinition attribute : ALL_ATTRIBUTES) { - resourceRegistration.registerReadWriteAttribute(attribute, null, writeHandler); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } - - static SimpleAttributeDefinition lookupElement(String xmlName) { - return ELEMENT_MAP.get(xmlName); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStoreCertificateDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStoreCertificateDefinition.java deleted file mode 100644 index 3a7cbe77bc..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStoreCertificateDefinition.java +++ /dev/null @@ -1,36 +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.saml.as7; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.dmr.ModelType; - -/** - * @author Marko Strukelj - */ -public class KeyStoreCertificateDefinition { - - static final SimpleAttributeDefinition CERTIFICATE_ALIAS = - new SimpleAttributeDefinitionBuilder(Constants.Model.CERTIFICATE_ALIAS, ModelType.STRING, true) - .setXmlName(Constants.XML.CERTIFICATE_ALIAS) - .build(); - - static SimpleAttributeDefinition lookup(String xmlName) { - return Constants.XML.CERTIFICATE_ALIAS.equals(xmlName) ? CERTIFICATE_ALIAS : null; - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStoreDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStoreDefinition.java deleted file mode 100644 index 22d30fbf0b..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStoreDefinition.java +++ /dev/null @@ -1,73 +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.saml.as7; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.dmr.ModelType; - -import java.util.HashMap; - -/** - * @author Marko Strukelj - */ -abstract class KeyStoreDefinition { - - static final SimpleAttributeDefinition RESOURCE = - new SimpleAttributeDefinitionBuilder(Constants.Model.RESOURCE, ModelType.STRING, true) - .setXmlName(Constants.XML.RESOURCE) - .build(); - - static final SimpleAttributeDefinition PASSWORD = - new SimpleAttributeDefinitionBuilder(Constants.Model.PASSWORD, ModelType.STRING, true) - .setXmlName(Constants.XML.PASSWORD) - .build(); - - static final SimpleAttributeDefinition FILE = - new SimpleAttributeDefinitionBuilder(Constants.Model.FILE, ModelType.STRING, true) - .setXmlName(Constants.XML.FILE) - .build(); - - static final SimpleAttributeDefinition TYPE = - new SimpleAttributeDefinitionBuilder(Constants.Model.TYPE, ModelType.STRING, true) - .setXmlName(Constants.XML.TYPE) - .build(); - - static final SimpleAttributeDefinition ALIAS = - new SimpleAttributeDefinitionBuilder(Constants.Model.ALIAS, ModelType.STRING, true) - .setXmlName(Constants.XML.ALIAS) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {RESOURCE, PASSWORD, FILE, TYPE, ALIAS}; - static final SimpleAttributeDefinition[] ALL_ATTRIBUTES = {RESOURCE, PASSWORD, FILE, TYPE, ALIAS, - KeyStorePrivateKeyDefinition.PRIVATE_KEY_ALIAS, - KeyStorePrivateKeyDefinition.PRIVATE_KEY_PASSWORD, - KeyStoreCertificateDefinition.CERTIFICATE_ALIAS - }; - - static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStorePrivateKeyDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStorePrivateKeyDefinition.java deleted file mode 100644 index beea59df4e..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeyStorePrivateKeyDefinition.java +++ /dev/null @@ -1,52 +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.saml.as7; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.dmr.ModelType; - -import java.util.HashMap; - -/** - * @author Marko Strukelj - */ -public class KeyStorePrivateKeyDefinition { - static final SimpleAttributeDefinition PRIVATE_KEY_ALIAS = - new SimpleAttributeDefinitionBuilder(Constants.Model.PRIVATE_KEY_ALIAS, ModelType.STRING, true) - .setXmlName(Constants.XML.PRIVATE_KEY_ALIAS) - .build(); - - static final SimpleAttributeDefinition PRIVATE_KEY_PASSWORD = - new SimpleAttributeDefinitionBuilder(Constants.Model.PRIVATE_KEY_PASSWORD, ModelType.STRING, true) - .setXmlName(Constants.XML.PRIVATE_KEY_PASSWORD) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {PRIVATE_KEY_ALIAS, PRIVATE_KEY_PASSWORD}; - - static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakAdapterConfigDeploymentProcessor.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakAdapterConfigDeploymentProcessor.java deleted file mode 100755 index 48ab715d3a..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakAdapterConfigDeploymentProcessor.java +++ /dev/null @@ -1,148 +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.saml.as7; - -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.deployment.WarMetaData; -import org.jboss.dmr.ModelNode; -import org.jboss.logging.Logger; -import org.jboss.metadata.javaee.spec.ParamValueMetaData; -import org.jboss.metadata.web.jboss.JBossWebMetaData; -import org.jboss.metadata.web.jboss.ValveMetaData; -import org.jboss.metadata.web.spec.LoginConfigMetaData; -import org.jboss.staxmapper.XMLExtendedStreamWriter; -import org.keycloak.adapters.saml.AdapterConstants; -import org.keycloak.adapters.saml.jbossweb.SamlAuthenticatorValve; -import org.keycloak.subsystem.saml.as7.logging.KeycloakLogger; -import org.keycloak.subsystem.saml.as7.xml.FormattingXMLStreamWriter; - -import javax.xml.stream.XMLOutputFactory; -import javax.xml.stream.XMLStreamException; -import java.io.ByteArrayOutputStream; -import java.nio.charset.Charset; -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); - - @Override - public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { - DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); - - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - return; - } - - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - webMetaData = new JBossWebMetaData(); - warMetaData.setMergedJBossWebMetaData(webMetaData); - } - - // otherwise - LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - - try { - boolean webRequiresKC = loginConfig != null && "KEYCLOAK-SAML".equalsIgnoreCase(loginConfig.getAuthMethod()); - boolean hasSubsystemConfig = Configuration.INSTANCE.isSecureDeployment(deploymentUnit); - if (hasSubsystemConfig || webRequiresKC) { - log.debug("Setting up KEYCLOAK-SAML auth method for WAR: " + deploymentUnit.getName()); - - // if secure-deployment configuration exists for web app, we force KEYCLOAK-SAML auth method on it - if (hasSubsystemConfig) { - addXMLData(getXML(deploymentUnit), warMetaData); - if (loginConfig != null) { - loginConfig.setAuthMethod("KEYCLOAK-SAML"); - //loginConfig.setRealmName(service.getRealmName(deploymentName)); - } else { - log.warn("Failed to set up KEYCLOAK-SAML auth method for WAR: " + deploymentUnit.getName() + " (loginConfig == null)"); - } - } - addValve(webMetaData); - KeycloakLogger.ROOT_LOGGER.deploymentSecured(deploymentUnit.getName()); - } - } catch (Exception e) { - throw new DeploymentUnitProcessingException("Failed to configure KeycloakSamlExtension from subsystem model", e); - } - } - - private String getXML(DeploymentUnit deploymentUnit) throws XMLStreamException { - ModelNode node = Configuration.INSTANCE.getSecureDeployment(deploymentUnit); - if (node != null) { - KeycloakSubsystemParser writer = new KeycloakSubsystemParser(); - ByteArrayOutputStream output = new ByteArrayOutputStream(); - XMLExtendedStreamWriter streamWriter = new FormattingXMLStreamWriter(XMLOutputFactory.newInstance().createXMLStreamWriter(output)); - try { - streamWriter.writeStartElement("keycloak-saml-adapter"); - writer.writeSps(streamWriter, node); - streamWriter.writeEndElement(); - } finally { - streamWriter.close(); - } - return new String(output.toByteArray(), Charset.forName("utf-8")); - } - return null; - } - - private void addXMLData(String xml, 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(AdapterConstants.AUTH_DATA_PARAM_NAME); - param.setParamValue(xml); - contextParams.add(param); - - webMetaData.setContextParams(contextParams); - } - - private void addValve(JBossWebMetaData webMetaData) { - List valves = webMetaData.getValves(); - if (valves == null) { - valves = new ArrayList(1); - webMetaData.setValves(valves); - } - ValveMetaData valve = new ValveMetaData(); - valve.setValveClass(SamlAuthenticatorValve.class.getName()); - valve.setModule("org.keycloak.keycloak-saml-as7-adapter"); - //log.info("******* adding Keycloak valve to: " + deploymentName); - valves.add(valve); - } - - @Override - public void undeploy(DeploymentUnit du) { - - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakClusteredSsoDeploymentProcessor.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakClusteredSsoDeploymentProcessor.java deleted file mode 100644 index a0f0f10baf..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakClusteredSsoDeploymentProcessor.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2017 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.saml.as7; - -import org.keycloak.adapters.saml.AdapterConstants; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -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.deployment.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.jboss.msc.service.ServiceName; -import org.jboss.msc.service.ServiceTarget; - -/** - * - * @author hmlnarik - */ -public class KeycloakClusteredSsoDeploymentProcessor implements DeploymentUnitProcessor { - - private static final Logger LOG = Logger.getLogger(KeycloakClusteredSsoDeploymentProcessor.class); - - private static final String DEFAULT_CACHE_CONTAINER = "web"; - private static final String SSO_CACHE_CONTAINER_NAME_PARAM_NAME = "keycloak.sessionIdMapperUpdater.infinispan.containerName"; - private static final String SSO_CACHE_NAME_PARAM_NAME = "keycloak.sessionIdMapperUpdater.infinispan.cacheName"; - - @Override - public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { - final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); - - if (isKeycloakSamlAuthMethod(deploymentUnit) && isDistributable(deploymentUnit)) { - addSamlReplicationConfiguration(deploymentUnit, phaseContext); - } - } - - public static boolean isDistributable(final DeploymentUnit deploymentUnit) { - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - return false; - } - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - return false; - } - - return webMetaData.getDistributable() != null || webMetaData.getReplicationConfig() != null; - } - - public static boolean isKeycloakSamlAuthMethod(final DeploymentUnit deploymentUnit) { - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - return false; - } - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - return false; - } - - if (Configuration.INSTANCE.isSecureDeployment(deploymentUnit)) { - return true; - } - - LoginConfigMetaData loginConfig = webMetaData.getLoginConfig(); - - return loginConfig != null && Objects.equals(loginConfig.getAuthMethod(), "KEYCLOAK-SAML"); - } - - @Override - public void undeploy(DeploymentUnit du) { - - } - - private void addSamlReplicationConfiguration(DeploymentUnit deploymentUnit, DeploymentPhaseContext context) { - WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); - if (warMetaData == null) { - return; - } - - JBossWebMetaData webMetaData = warMetaData.getMergedJBossWebMetaData(); - if (webMetaData == null) { - webMetaData = new JBossWebMetaData(); - warMetaData.setMergedJBossWebMetaData(webMetaData); - } - - // Find out default names of cache container and cache - String cacheContainer = DEFAULT_CACHE_CONTAINER; - String deploymentSessionCacheName = - (deploymentUnit.getParent() == null - ? "" - : deploymentUnit.getParent().getName() + ".") - + deploymentUnit.getName(); - - // Update names from jboss-web.xml's - if (webMetaData.getReplicationConfig() != null && webMetaData.getReplicationConfig().getCacheName() != null) { - ServiceName sn = ServiceName.parse(webMetaData.getReplicationConfig().getCacheName()); - cacheContainer = (sn.length() > 1) ? sn.getParent().getSimpleName() : sn.getSimpleName(); - deploymentSessionCacheName = sn.getSimpleName(); - } - String ssoCacheName = deploymentSessionCacheName + ".ssoCache"; - - // Override if they were set in the context parameters - List contextParams = webMetaData.getContextParams(); - if (contextParams == null) { - contextParams = new ArrayList<>(); - } - for (ParamValueMetaData contextParam : contextParams) { - if (Objects.equals(contextParam.getParamName(), SSO_CACHE_CONTAINER_NAME_PARAM_NAME)) { - cacheContainer = contextParam.getParamValue(); - } else if (Objects.equals(contextParam.getParamName(), SSO_CACHE_NAME_PARAM_NAME)) { - ssoCacheName = contextParam.getParamValue(); - } - } - - LOG.debugv("Determined SSO cache container configuration: container: {0}, cache: {1}", cacheContainer, ssoCacheName); -// addCacheDependency(context, deploymentUnit, cacheContainer, cacheName); - - // Set context parameters for SSO cache container/name - ParamValueMetaData paramContainer = new ParamValueMetaData(); - paramContainer.setParamName(AdapterConstants.REPLICATION_CONFIG_CONTAINER_PARAM_NAME); - paramContainer.setParamValue(cacheContainer); - contextParams.add(paramContainer); - - ParamValueMetaData paramSsoCache = new ParamValueMetaData(); - paramSsoCache.setParamName(AdapterConstants.REPLICATION_CONFIG_SSO_CACHE_PARAM_NAME); - paramSsoCache.setParamValue(ssoCacheName); - contextParams.add(paramSsoCache); - - webMetaData.setContextParams(contextParams); - } - - private void addCacheDependency(DeploymentPhaseContext context, DeploymentUnit deploymentUnit, String cacheContainer, String cacheName) { - ServiceName jbossAsCacheContainerService = ServiceName.of("jboss", "infinispan", cacheContainer); - ServiceTarget st = context.getServiceTarget(); - st.addDependency(jbossAsCacheContainerService.append(cacheName)); - } - -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakDependencyProcessor.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakDependencyProcessor.java deleted file mode 100755 index 51988b21c7..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/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.saml.as7; - -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.deployment.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-saml-adapter-core"); - private static final ModuleIdentifier KEYCLOAK_API_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-adapter-api-public"); - 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 (Configuration.INSTANCE.getSecureDeployment(deploymentUnit) == null) { - 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-SAML")) 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_API_ADAPTER, 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/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakDependencyProcessorAS7.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakDependencyProcessorAS7.java deleted file mode 100755 index 8c64a70784..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakDependencyProcessorAS7.java +++ /dev/null @@ -1,36 +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.saml.as7; - -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; - -/** - * @author Marko Strukelj - */ -public class KeycloakDependencyProcessorAS7 extends KeycloakDependencyProcessor { - - private static final ModuleIdentifier KEYCLOAK_AS7_ADAPTER = ModuleIdentifier.create("org.keycloak.keycloak-saml-as7-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_AS7_ADAPTER, false, false, true, false)); - }} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSamlExtension.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSamlExtension.java deleted file mode 100755 index 1782731a20..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSamlExtension.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.saml.as7; - -import org.jboss.as.controller.Extension; -import org.jboss.as.controller.ExtensionContext; -import org.jboss.as.controller.ModelVersion; -import org.jboss.as.controller.PathElement; -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 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 KeycloakSamlExtension implements Extension { - - static final String SUBSYSTEM_NAME = "keycloak-saml"; - private static final String NAMESPACE_1_1 = "urn:jboss:domain:keycloak-saml:1.1"; - private static final String NAMESPACE_1_2 = "urn:jboss:domain:keycloak-saml:1.2"; - private static final String NAMESPACE_1_3 = "urn:jboss:domain:keycloak-saml:1.3"; - private static final String NAMESPACE_1_4 = "urn:jboss:domain:keycloak-saml:1.4"; - - static final String CURRENT_NAMESPACE = NAMESPACE_1_4; - private static final KeycloakSubsystemParser PARSER = new KeycloakSubsystemParser(); - static final PathElement PATH_SUBSYSTEM = PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME); - private static final String RESOURCE_NAME = KeycloakSamlExtension.class.getPackage().getName() + ".LocalDescriptions"; - private static final ModelVersion MGMT_API_VERSION = ModelVersion.create(1, 1, 0); - static final PathElement SUBSYSTEM_PATH = PathElement.pathElement(SUBSYSTEM, SUBSYSTEM_NAME); - - 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, KeycloakSamlExtension.class.getClassLoader(), true, false); - } - - /** - * {@inheritDoc} - */ - @Override - public void initializeParsers(final ExtensionParsingContext context) { - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, KeycloakSamlExtension.NAMESPACE_1_1, PARSER); - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, KeycloakSamlExtension.NAMESPACE_1_2, PARSER); - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, KeycloakSamlExtension.NAMESPACE_1_3, PARSER); - context.setSubsystemXmlMapping(SUBSYSTEM_NAME, KeycloakSamlExtension.NAMESPACE_1_4, PARSER); - } - - /** - * {@inheritDoc} - */ - @Override - public void initialize(final ExtensionContext context) { - final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, - MGMT_API_VERSION.getMajor(), MGMT_API_VERSION.getMinor(), MGMT_API_VERSION.getMicro()); - - ManagementResourceRegistration registration = subsystem.registerSubsystemModel(KeycloakSubsystemDefinition.INSTANCE); - ManagementResourceRegistration secureDeploymentRegistration = registration.registerSubModel(SecureDeploymentDefinition.INSTANCE); - ManagementResourceRegistration serviceProviderRegistration = secureDeploymentRegistration.registerSubModel(ServiceProviderDefinition.INSTANCE); - serviceProviderRegistration.registerSubModel(KeyDefinition.INSTANCE); - ManagementResourceRegistration idpRegistration = serviceProviderRegistration.registerSubModel(IdentityProviderDefinition.INSTANCE); - idpRegistration.registerSubModel(KeyDefinition.INSTANCE); - subsystem.registerXMLElementWriter(PARSER); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemAdd.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemAdd.java deleted file mode 100755 index 30a853ffa6..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemAdd.java +++ /dev/null @@ -1,74 +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.saml.as7; - -import org.jboss.as.controller.AbstractBoottimeAddStepHandler; -import org.jboss.as.controller.OperationContext; -import org.jboss.as.controller.OperationFailedException; -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(KeycloakSamlExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, 0, chooseDependencyProcessor()); - processorTarget.addDeploymentProcessor(KeycloakSamlExtension.SUBSYSTEM_NAME, - Phase.POST_MODULE, // PHASE - Phase.POST_MODULE_VALIDATOR_FACTORY - 1, // PRIORITY - chooseConfigDeploymentProcessor()); - processorTarget.addDeploymentProcessor(KeycloakSamlExtension.SUBSYSTEM_NAME, - Phase.POST_MODULE, // PHASE - Phase.POST_MODULE_VALIDATOR_FACTORY - 1, // PRIORITY - chooseClusteredSsoDeploymentProcessor()); - } - }, OperationContext.Stage.RUNTIME); - } - - private DeploymentUnitProcessor chooseDependencyProcessor() { - return new KeycloakDependencyProcessorAS7(); - } - - private DeploymentUnitProcessor chooseConfigDeploymentProcessor() { - return new KeycloakAdapterConfigDeploymentProcessor(); - } - - private DeploymentUnitProcessor chooseClusteredSsoDeploymentProcessor() { - return new KeycloakClusteredSsoDeploymentProcessor(); - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemDefinition.java deleted file mode 100755 index 795619a0d8..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemDefinition.java +++ /dev/null @@ -1,46 +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.saml.as7; - -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-saml. - * - * @author Stan Silvert ssilvert@redhat.com (C) 2013 Red Hat Inc. - */ -public class KeycloakSubsystemDefinition extends SimpleResourceDefinition { - - static final KeycloakSubsystemDefinition INSTANCE = new KeycloakSubsystemDefinition(); - - private KeycloakSubsystemDefinition() { - super(KeycloakSamlExtension.SUBSYSTEM_PATH, - KeycloakSamlExtension.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/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemParser.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemParser.java deleted file mode 100755 index 983990238d..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/KeycloakSubsystemParser.java +++ /dev/null @@ -1,703 +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.saml.as7; - -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.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -/** - * 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(KeycloakSamlExtension.PATH_SUBSYSTEM)); - list.add(addKeycloakSub); - - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - if (reader.getLocalName().equals(Constants.XML.SECURE_DEPLOYMENT)) { - readSecureDeployment(reader, list); - } else { - throw ParseUtils.unexpectedElement(reader); - } - } - } - - // used for debugging - private int nextTag(XMLExtendedStreamReader reader) throws XMLStreamException { - return reader.nextTag(); - } - - void readSecureDeployment(XMLExtendedStreamReader reader, List list) throws XMLStreamException { - String name = readRequiredAttribute(reader, Constants.XML.NAME); - - PathAddress addr = PathAddress.pathAddress( - PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, KeycloakSamlExtension.SUBSYSTEM_NAME), - PathElement.pathElement(Constants.Model.SECURE_DEPLOYMENT, name)); - ModelNode addSecureDeployment = Util.createAddOperation(addr); - list.add(addSecureDeployment); - - Set parsedElements = new HashSet<>(); - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (parsedElements.contains(tagName)) { - // all sub-elements of the secure deployment type should occur only once. - throw ParseUtils.unexpectedElement(reader); - } - if (tagName.equals(Constants.XML.SERVICE_PROVIDER)) { - readServiceProvider(reader, list, addr); - } else { - throw ParseUtils.unexpectedElement(reader); - } - parsedElements.add(tagName); - } - } - - void readServiceProvider(XMLExtendedStreamReader reader, List list, PathAddress parentAddr) throws XMLStreamException { - String entityId = readRequiredAttribute(reader, Constants.XML.ENTITY_ID); - - PathAddress addr = PathAddress.pathAddress(parentAddr, - PathElement.pathElement(Constants.Model.SERVICE_PROVIDER, entityId)); - ModelNode addServiceProvider = Util.createAddOperation(addr); - list.add(addServiceProvider); - - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - if (Constants.XML.ENTITY_ID.equals(name)) { - continue; - } - - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = ServiceProviderDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, addServiceProvider, reader); - } - - Set parsedElements = new HashSet<>(); - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (parsedElements.contains(tagName)) { - // all sub-elements of the service provider type should occur only once. - throw ParseUtils.unexpectedElement(reader); - } - - if (Constants.XML.KEYS.equals(tagName)) { - readKeys(list, reader, addr); - } else if (Constants.XML.PRINCIPAL_NAME_MAPPING.equals(tagName)) { - readPrincipalNameMapping(addServiceProvider, reader); - } else if (Constants.XML.ROLE_IDENTIFIERS.equals(tagName)) { - readRoleIdentifiers(addServiceProvider, reader); - } else if (Constants.XML.ROLE_MAPPINGS_PROVIDER.equals(tagName)) { - readRoleMappingsProvider(addServiceProvider, reader); - } else if (Constants.XML.IDENTITY_PROVIDER.equals(tagName)) { - readIdentityProvider(list, reader, addr); - } else { - throw ParseUtils.unexpectedElement(reader); - } - parsedElements.add(tagName); - } - } - - void readIdentityProvider(List list, XMLExtendedStreamReader reader, PathAddress parentAddr) throws XMLStreamException { - String entityId = readRequiredAttribute(reader, Constants.XML.ENTITY_ID); - - PathAddress addr = PathAddress.pathAddress(parentAddr, - PathElement.pathElement(Constants.Model.IDENTITY_PROVIDER, entityId)); - ModelNode addIdentityProvider = Util.createAddOperation(addr); - list.add(addIdentityProvider); - - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - if (Constants.XML.ENTITY_ID.equals(name) - // don't break if encountering this noop attr from client-adapter/core keycloak_saml_adapter_1_6.xsd - || "encryption".equals(name)) { - continue; - } - SimpleAttributeDefinition attr = IdentityProviderDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, addIdentityProvider, reader); - } - - Set parsedElements = new HashSet<>(); - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (parsedElements.contains(tagName)) { - // all sub-elements of the identity provider type should occur only once. - throw ParseUtils.unexpectedElement(reader); - } - - if (Constants.XML.SINGLE_SIGN_ON.equals(tagName)) { - readSingleSignOn(addIdentityProvider, reader); - } else if (Constants.XML.SINGLE_LOGOUT.equals(tagName)) { - readSingleLogout(addIdentityProvider, reader); - } else if (Constants.XML.KEYS.equals(tagName)) { - readKeys(list, reader, addr); - } else if (Constants.XML.HTTP_CLIENT.equals(tagName)) { - readHttpClient(addIdentityProvider, reader); - } else if (Constants.XML.ALLOWED_CLOCK_SKEW.equals(tagName)) { - readAllowedClockSkew(addIdentityProvider, reader); - } else { - throw ParseUtils.unexpectedElement(reader); - } - parsedElements.add(tagName); - } - } - - void readSingleSignOn(ModelNode addIdentityProvider, XMLExtendedStreamReader reader) throws XMLStreamException { - ModelNode sso = addIdentityProvider.get(Constants.Model.SINGLE_SIGN_ON); - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = SingleSignOnDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, sso, reader); - } - ParseUtils.requireNoContent(reader); - } - - void readSingleLogout(ModelNode addIdentityProvider, XMLExtendedStreamReader reader) throws XMLStreamException { - ModelNode slo = addIdentityProvider.get(Constants.Model.SINGLE_LOGOUT); - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = SingleLogoutDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, slo, reader); - } - ParseUtils.requireNoContent(reader); - } - - void readKeys(List list, XMLExtendedStreamReader reader, PathAddress parentAddr) throws XMLStreamException { - ParseUtils.requireNoAttributes(reader); - List keyList = new LinkedList<>(); - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (!Constants.XML.KEY.equals(tagName)) { - throw ParseUtils.unexpectedElement(reader); - } - readKey(keyList, reader, parentAddr); - } - list.addAll(keyList); - } - - void readHttpClient(final ModelNode addIdentityProvider, final XMLExtendedStreamReader reader) throws XMLStreamException { - ModelNode httpClientNode = addIdentityProvider.get(Constants.Model.HTTP_CLIENT); - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = HttpClientDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, httpClientNode, reader); - } - ParseUtils.requireNoContent(reader); - } - - void readAllowedClockSkew(ModelNode addIdentityProvider, XMLExtendedStreamReader reader) throws XMLStreamException { - ModelNode allowedClockSkew = addIdentityProvider.get(Constants.Model.ALLOWED_CLOCK_SKEW); - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - if (Constants.XML.ALLOWED_CLOCK_SKEW_UNIT.equals(name)) { - SimpleAttributeDefinition attr = AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT; - attr.parseAndSetParameter(value, allowedClockSkew, reader); - } else { - throw ParseUtils.unexpectedAttribute(reader, i); - } - } - // the real value is the content - String value = reader.getElementText(); - SimpleAttributeDefinition attr = AllowedClockSkew.ALLOWED_CLOCK_SKEW_VALUE; - attr.parseAndSetParameter(value, allowedClockSkew, reader); - } - - void readKey(List list, XMLExtendedStreamReader reader, PathAddress parentAddr) throws XMLStreamException { - PathAddress addr = PathAddress.pathAddress(parentAddr, - PathElement.pathElement(Constants.Model.KEY, "key-" + list.size())); - ModelNode addKey = Util.createAddOperation(addr); - list.add(addKey); - - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = KeyDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, addKey, reader); - } - - Set parsedElements = new HashSet<>(); - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (parsedElements.contains(tagName)) { - // all sub-elements of the key type should occur only once. - throw ParseUtils.unexpectedElement(reader); - } - - if (Constants.XML.KEY_STORE.equals(tagName)) { - readKeyStore(addKey, reader); - } else if (Constants.XML.PRIVATE_KEY_PEM.equals(tagName) - || Constants.XML.PUBLIC_KEY_PEM.equals(tagName) - || Constants.XML.CERTIFICATE_PEM.equals(tagName)) { - - readNoAttrElementContent(KeyDefinition.lookupElement(tagName), addKey, reader); - } else { - throw ParseUtils.unexpectedElement(reader); - } - parsedElements.add(tagName); - } - } - - void readNoAttrElementContent(SimpleAttributeDefinition attr, ModelNode model, XMLExtendedStreamReader reader) throws XMLStreamException { - ParseUtils.requireNoAttributes(reader); - String value = reader.getElementText(); - attr.parseAndSetParameter(value, model, reader); - } - - void readKeyStore(ModelNode addKey, XMLExtendedStreamReader reader) throws XMLStreamException { - ModelNode addKeyStore = addKey.get(Constants.Model.KEY_STORE); - - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = KeyStoreDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, addKeyStore, reader); - } - - if (!addKeyStore.hasDefined(Constants.Model.FILE) && !addKeyStore.hasDefined(Constants.Model.RESOURCE)) { - throw new XMLStreamException("KeyStore element must have 'file' or 'resource' attribute set", reader.getLocation()); - } - if (!addKeyStore.hasDefined(Constants.Model.PASSWORD)) { - throw ParseUtils.missingRequired(reader, asSet(Constants.XML.PASSWORD)); - } - - Set parsedElements = new HashSet<>(); - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (parsedElements.contains(tagName)) { - // all sub-elements of the keystore type should occur only once. - throw ParseUtils.unexpectedElement(reader); - } - if (Constants.XML.PRIVATE_KEY.equals(tagName)) { - readPrivateKey(reader, addKeyStore); - } else if (Constants.XML.CERTIFICATE.equals(tagName)) { - readCertificate(reader, addKeyStore); - } else { - throw ParseUtils.unexpectedElement(reader); - } - parsedElements.add(tagName); - } - } - - - void readPrivateKey(XMLExtendedStreamReader reader, ModelNode addKeyStore) throws XMLStreamException { - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = KeyStorePrivateKeyDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, addKeyStore, reader); - } - - if (!addKeyStore.hasDefined(Constants.Model.PRIVATE_KEY_ALIAS)) { - throw ParseUtils.missingRequired(reader, asSet(Constants.XML.PRIVATE_KEY_ALIAS)); - } - if (!addKeyStore.hasDefined(Constants.Model.PRIVATE_KEY_PASSWORD)) { - throw ParseUtils.missingRequired(reader, asSet(Constants.XML.PRIVATE_KEY_PASSWORD)); - } - - ParseUtils.requireNoContent(reader); - } - - void readCertificate(XMLExtendedStreamReader reader, ModelNode addKeyStore) throws XMLStreamException { - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - SimpleAttributeDefinition attr = KeyStoreCertificateDefinition.lookup(name); - if (attr == null) { - throw ParseUtils.unexpectedAttribute(reader, i); - } - attr.parseAndSetParameter(value, addKeyStore, reader); - } - - if (!addKeyStore.hasDefined(Constants.Model.CERTIFICATE_ALIAS)) { - throw ParseUtils.missingRequired(reader, asSet(Constants.XML.CERTIFICATE_ALIAS)); - } - - ParseUtils.requireNoContent(reader); - } - - void readRoleIdentifiers(ModelNode addServiceProvider, XMLExtendedStreamReader reader) throws XMLStreamException { - ParseUtils.requireNoAttributes(reader); - - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - - if (!Constants.XML.ATTRIBUTE.equals(tagName)) { - throw ParseUtils.unexpectedElement(reader); - } - - ParseUtils.requireSingleAttribute(reader, Constants.XML.NAME); - String name = ParseUtils.readStringAttributeElement(reader, Constants.XML.NAME); - - ServiceProviderDefinition.ROLE_ATTRIBUTES.parseAndAddParameterElement(name, addServiceProvider, reader); - } - } - - void readRoleMappingsProvider(final ModelNode addServiceProvider, final XMLExtendedStreamReader reader) throws XMLStreamException { - String providerId = readRequiredAttribute(reader, Constants.XML.ID); - ServiceProviderDefinition.ROLE_MAPPINGS_PROVIDER_ID.parseAndSetParameter(providerId, addServiceProvider, reader); - - while (reader.hasNext() && nextTag(reader) != END_ELEMENT) { - String tagName = reader.getLocalName(); - if (!Constants.XML.PROPERTY.equals(tagName)) { - throw ParseUtils.unexpectedElement(reader); - } - final String[] array = ParseUtils.requireAttributes(reader, Constants.XML.NAME, Constants.XML.VALUE); - ServiceProviderDefinition.ROLE_MAPPINGS_PROVIDER_CONFIG.parseAndAddParameterElement(array[0], array[1], addServiceProvider, reader); - ParseUtils.requireNoContent(reader); - } - } - - void readPrincipalNameMapping(ModelNode addServiceProvider, XMLExtendedStreamReader reader) throws XMLStreamException { - - boolean policySet = false; - - for (int i = 0; i < reader.getAttributeCount(); i++) { - String name = reader.getAttributeLocalName(i); - String value = reader.getAttributeValue(i); - - if (Constants.XML.PRINCIPAL_NAME_MAPPING_POLICY.equals(name)) { - policySet = true; - ServiceProviderDefinition.PRINCIPAL_NAME_MAPPING_POLICY.parseAndSetParameter(value, addServiceProvider, reader); - } else if (Constants.XML.PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME.equals(name)) { - ServiceProviderDefinition.PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME.parseAndSetParameter(value, addServiceProvider, reader); - } else { - throw ParseUtils.unexpectedAttribute(reader, i); - } - } - - if (!policySet) { - throw ParseUtils.missingRequired(reader, asSet(Constants.XML.PRINCIPAL_NAME_MAPPING_POLICY)); - } - ParseUtils.requireNoContent(reader); - } - - /** - * Read an attribute, and throw exception if attribute is not present - */ - String readRequiredAttribute(XMLExtendedStreamReader reader, String attrName) throws XMLStreamException { - String value = null; - for (int i = 0; i < reader.getAttributeCount(); i++) { - String attr = reader.getAttributeLocalName(i); - if (attr.equals(attrName)) { - value = reader.getAttributeValue(i); - break; - } - } - if (value == null) { - throw ParseUtils.missingRequired(reader, Collections.singleton(attrName)); - } - return value; - } - - /** - * {@inheritDoc} - */ - @Override - public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException { - context.startSubsystemElement(KeycloakSamlExtension.CURRENT_NAMESPACE, false); - writeSecureDeployment(writer, context.getModelNode()); - writer.writeEndElement(); - } - - public void writeSecureDeployment(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - if (!model.get(Constants.Model.SECURE_DEPLOYMENT).isDefined()) { - return; - } - - for (Property sp : model.get(Constants.Model.SECURE_DEPLOYMENT).asPropertyList()) { - writer.writeStartElement(Constants.XML.SECURE_DEPLOYMENT); - writer.writeAttribute(Constants.XML.NAME, sp.getName()); - - writeSps(writer, sp.getValue()); - writer.writeEndElement(); - } - } - - void writeSps(final XMLExtendedStreamWriter writer, final ModelNode model) throws XMLStreamException { - if (!model.isDefined()) { - return; - } - for (Property sp : model.get(Constants.Model.SERVICE_PROVIDER).asPropertyList()) { - writer.writeStartElement(Constants.XML.SERVICE_PROVIDER); - writer.writeAttribute(Constants.XML.ENTITY_ID, sp.getName()); - ModelNode spAttributes = sp.getValue(); - for (SimpleAttributeDefinition attr : ServiceProviderDefinition.ATTRIBUTES) { - attr.getAttributeMarshaller().marshallAsAttribute(attr, spAttributes, false, writer); - } - writeKeys(writer, spAttributes.get(Constants.Model.KEY)); - writePrincipalNameMapping(writer, spAttributes); - writeRoleIdentifiers(writer, spAttributes); - writeRoleMappingsProvider(writer, spAttributes); - writeIdentityProvider(writer, spAttributes.get(Constants.Model.IDENTITY_PROVIDER)); - - writer.writeEndElement(); - } - } - - void writeIdentityProvider(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - if (!model.isDefined()) { - return; - } - - for (Property idp : model.asPropertyList()) { - writer.writeStartElement(Constants.XML.IDENTITY_PROVIDER); - writer.writeAttribute(Constants.XML.ENTITY_ID, idp.getName()); - - ModelNode idpAttributes = idp.getValue(); - for (SimpleAttributeDefinition attr : IdentityProviderDefinition.ATTRIBUTES) { - attr.getAttributeMarshaller().marshallAsAttribute(attr, idpAttributes, false, writer); - } - - writeSingleSignOn(writer, idpAttributes.get(Constants.Model.SINGLE_SIGN_ON)); - writeSingleLogout(writer, idpAttributes.get(Constants.Model.SINGLE_LOGOUT)); - writeKeys(writer, idpAttributes.get(Constants.Model.KEY)); - writeHttpClient(writer, idpAttributes.get(Constants.Model.HTTP_CLIENT)); - writeAllowedClockSkew(writer, idpAttributes.get(Constants.Model.ALLOWED_CLOCK_SKEW)); - writer.writeEndElement(); - } - } - - void writeSingleSignOn(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - if (!model.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.SINGLE_SIGN_ON); - for (SimpleAttributeDefinition attr : SingleSignOnDefinition.ATTRIBUTES) { - attr.getAttributeMarshaller().marshallAsAttribute(attr, model, false, writer); - } - writer.writeEndElement(); - } - - void writeSingleLogout(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - if (!model.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.SINGLE_LOGOUT); - for (SimpleAttributeDefinition attr : SingleLogoutDefinition.ATTRIBUTES) { - attr.getAttributeMarshaller().marshallAsAttribute(attr, model, false, writer); - } - writer.writeEndElement(); - } - - void writeKeys(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - if (!model.isDefined()) { - return; - } - boolean contains = false; - for (Property key : model.asPropertyList()) { - if (!contains) { - writer.writeStartElement(Constants.XML.KEYS); - contains = true; - } - writer.writeStartElement(Constants.XML.KEY); - - ModelNode keyAttributes = key.getValue(); - for (SimpleAttributeDefinition attr : KeyDefinition.ATTRIBUTES) { - attr.getAttributeMarshaller().marshallAsAttribute(attr, keyAttributes, false, writer); - } - for (SimpleAttributeDefinition attr : KeyDefinition.ELEMENTS) { - attr.getAttributeMarshaller().marshallAsElement(attr, keyAttributes, false, writer); - } - writeKeyStore(writer, keyAttributes.get(Constants.Model.KEY_STORE)); - - writer.writeEndElement(); - } - if (contains) { - writer.writeEndElement(); - } - } - - void writeHttpClient(XMLExtendedStreamWriter writer, ModelNode httpClientModel) throws XMLStreamException { - if (!httpClientModel.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.HTTP_CLIENT); - for (SimpleAttributeDefinition attr : HttpClientDefinition.ATTRIBUTES) { - attr.marshallAsAttribute(httpClientModel, false, writer); - } - writer.writeEndElement(); - } - void writeAllowedClockSkew(XMLExtendedStreamWriter writer, ModelNode allowedClockSkew) throws XMLStreamException { - if (!allowedClockSkew.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.ALLOWED_CLOCK_SKEW); - AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT.getAttributeMarshaller().marshallAsAttribute(AllowedClockSkew.ALLOWED_CLOCK_SKEW_UNIT, allowedClockSkew, false, writer); - ModelNode allowedClockSkewValue = allowedClockSkew.get(Constants.Model.ALLOWED_CLOCK_SKEW_VALUE); - char[] chars = allowedClockSkewValue.asString().toCharArray(); - writer.writeCharacters(chars, 0, chars.length); - writer.writeEndElement(); - } - - void writeKeyStore(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - if (!model.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.KEY_STORE); - for (SimpleAttributeDefinition attr : KeyStoreDefinition.ATTRIBUTES) { - attr.getAttributeMarshaller().marshallAsAttribute(attr, model, false, writer); - } - writePrivateKey(writer, model); - writeCertificate(writer, model); - writer.writeEndElement(); - } - - void writeCertificate(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - ModelNode value = model.get(Constants.Model.CERTIFICATE_ALIAS); - if (!value.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.CERTIFICATE); - SimpleAttributeDefinition attr = KeyStoreCertificateDefinition.CERTIFICATE_ALIAS; - attr.getAttributeMarshaller().marshallAsAttribute(attr, model, false, writer); - writer.writeEndElement(); - } - - void writePrivateKey(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - ModelNode pk_alias = model.get(Constants.Model.PRIVATE_KEY_ALIAS); - ModelNode pk_password = model.get(Constants.Model.PRIVATE_KEY_PASSWORD); - - if (!pk_alias.isDefined() && !pk_password.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.PRIVATE_KEY); - for (SimpleAttributeDefinition attr : KeyStorePrivateKeyDefinition.ATTRIBUTES) { - attr.getAttributeMarshaller().marshallAsAttribute(attr, model, false, writer); - } - writer.writeEndElement(); - } - - void writeRoleIdentifiers(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - ModelNode value = model.get(Constants.Model.ROLE_ATTRIBUTES); - if (!value.isDefined()) { - return; - } - - List items = value.asList(); - if (items.size() == 0) { - return; - } - - writer.writeStartElement(Constants.XML.ROLE_IDENTIFIERS); - for (ModelNode item : items) { - writer.writeStartElement(Constants.XML.ATTRIBUTE); - writer.writeAttribute("name", item.asString()); - writer.writeEndElement(); - } - writer.writeEndElement(); - } - - void writeRoleMappingsProvider(final XMLExtendedStreamWriter writer, final ModelNode model) throws XMLStreamException { - ModelNode providerId = model.get(Constants.Model.ROLE_MAPPINGS_PROVIDER_ID); - if (!providerId.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.ROLE_MAPPINGS_PROVIDER); - writer.writeAttribute(Constants.XML.ID, providerId.asString()); - ServiceProviderDefinition.ROLE_MAPPINGS_PROVIDER_CONFIG.marshallAsElement(model, false, writer); - writer.writeEndElement(); - } - - void writePrincipalNameMapping(XMLExtendedStreamWriter writer, ModelNode model) throws XMLStreamException { - - ModelNode policy = model.get(Constants.Model.PRINCIPAL_NAME_MAPPING_POLICY); - ModelNode mappingAttribute = model.get(Constants.Model.PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME); - if (!policy.isDefined() && !mappingAttribute.isDefined()) { - return; - } - writer.writeStartElement(Constants.XML.PRINCIPAL_NAME_MAPPING); - if (policy.isDefined()) { - writer.writeAttribute(Constants.XML.PRINCIPAL_NAME_MAPPING_POLICY, policy.asString()); - } - if (mappingAttribute.isDefined()) { - writer.writeAttribute(Constants.XML.PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME, mappingAttribute.asString()); - } - writer.writeEndElement(); - } - - - private static Set asSet(String ... values) { - HashSet ret = new HashSet(); - for (String value: values) { - ret.add(value); - } - return ret; - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SecureDeploymentAddHandler.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SecureDeploymentAddHandler.java deleted file mode 100644 index 98447d548a..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SecureDeploymentAddHandler.java +++ /dev/null @@ -1,46 +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.saml.as7; - -import org.jboss.as.controller.AbstractAddStepHandler; -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; - -/** - * @author Marko Strukelj - */ -class SecureDeploymentAddHandler extends AbstractAddStepHandler { - - static SecureDeploymentAddHandler INSTANCE = new SecureDeploymentAddHandler(); - - private SecureDeploymentAddHandler() { - } - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) throws OperationFailedException { - Configuration.INSTANCE.updateModel(operation, model); - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SecureDeploymentDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SecureDeploymentDefinition.java deleted file mode 100644 index 0f36db3d4e..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SecureDeploymentDefinition.java +++ /dev/null @@ -1,44 +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.saml.as7; - -import org.jboss.as.controller.PathElement; -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; - -/** - * Defines attributes and operations for a secure-deployment. - */ -public class SecureDeploymentDefinition extends SimpleResourceDefinition { - - static final SecureDeploymentDefinition INSTANCE = new SecureDeploymentDefinition(); - - private SecureDeploymentDefinition() { - super(PathElement.pathElement(Constants.Model.SECURE_DEPLOYMENT), - KeycloakSamlExtension.getResourceDescriptionResolver(Constants.Model.SECURE_DEPLOYMENT), - SecureDeploymentAddHandler.INSTANCE, - ReloadRequiredRemoveStepHandler.INSTANCE); - } - - @Override - public void registerOperations(ManagementResourceRegistration resourceRegistration) { - super.registerOperations(resourceRegistration); - resourceRegistration.registerOperationHandler(GenericSubsystemDescribeHandler.DEFINITION, GenericSubsystemDescribeHandler.INSTANCE); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/ServiceProviderAddHandler.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/ServiceProviderAddHandler.java deleted file mode 100644 index 52e4f5ba6d..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/ServiceProviderAddHandler.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.saml.as7; - -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; - -/** - * @author Marko Strukelj - */ -class ServiceProviderAddHandler extends AbstractAddStepHandler { - - static final ServiceProviderAddHandler INSTANCE = new ServiceProviderAddHandler(); - - ServiceProviderAddHandler() { - } - - @Override - protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List> newControllers) throws OperationFailedException { - Configuration.INSTANCE.updateModel(operation, model, true); - } - - @Override - protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException { - for (AttributeDefinition attr : ServiceProviderDefinition.ALL_ATTRIBUTES) { - attr.validateAndSet(operation, model); - } - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/ServiceProviderDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/ServiceProviderDefinition.java deleted file mode 100755 index 46242ac96c..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/ServiceProviderDefinition.java +++ /dev/null @@ -1,160 +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.saml.as7; - -import org.jboss.as.controller.AttributeDefinition; -import org.jboss.as.controller.ListAttributeDefinition; -import org.jboss.as.controller.OperationStepHandler; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.PropertiesAttributeDefinition; -import org.jboss.as.controller.ReloadRequiredRemoveStepHandler; -import org.jboss.as.controller.ReloadRequiredWriteAttributeHandler; -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.as.controller.SimpleResourceDefinition; -import org.jboss.as.controller.StringListAttributeDefinition; -import org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler; -import org.jboss.as.controller.registry.ManagementResourceRegistration; -import org.jboss.dmr.ModelType; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; - -/** - * @author Marko Strukelj - */ -public class ServiceProviderDefinition extends SimpleResourceDefinition { - - private static final SimpleAttributeDefinition SSL_POLICY = - new SimpleAttributeDefinitionBuilder(Constants.Model.SSL_POLICY, ModelType.STRING, true) - .setXmlName(Constants.XML.SSL_POLICY) - .build(); - - private static final SimpleAttributeDefinition NAME_ID_POLICY_FORMAT = - new SimpleAttributeDefinitionBuilder(Constants.Model.NAME_ID_POLICY_FORMAT, ModelType.STRING, true) - .setXmlName(Constants.XML.NAME_ID_POLICY_FORMAT) - .build(); - - private static final SimpleAttributeDefinition LOGOUT_PAGE = - new SimpleAttributeDefinitionBuilder(Constants.Model.LOGOUT_PAGE, ModelType.STRING, true) - .setXmlName(Constants.XML.LOGOUT_PAGE) - .build(); - - private static final SimpleAttributeDefinition FORCE_AUTHENTICATION = - new SimpleAttributeDefinitionBuilder(Constants.Model.FORCE_AUTHENTICATION, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.FORCE_AUTHENTICATION) - .build(); - - private static final SimpleAttributeDefinition KEEP_DOM_ASSERTION = - new SimpleAttributeDefinitionBuilder(Constants.Model.KEEP_DOM_ASSERTION, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.KEEP_DOM_ASSERTION) - .build(); - - private static final SimpleAttributeDefinition IS_PASSIVE = - new SimpleAttributeDefinitionBuilder(Constants.Model.IS_PASSIVE, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.IS_PASSIVE) - .build(); - - private static final SimpleAttributeDefinition TURN_OFF_CHANGE_SESSSION_ID_ON_LOGIN = - new SimpleAttributeDefinitionBuilder(Constants.Model.TURN_OFF_CHANGE_SESSSION_ID_ON_LOGIN, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.TURN_OFF_CHANGE_SESSSION_ID_ON_LOGIN) - .build(); - - private static final SimpleAttributeDefinition AUTODETECT_BEARER_ONLY = - new SimpleAttributeDefinitionBuilder(Constants.Model.AUTODETECT_BEARER_ONLY, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.AUTODETECT_BEARER_ONLY) - .setAllowExpression(true) - .build(); - - static final SimpleAttributeDefinition PRINCIPAL_NAME_MAPPING_POLICY = - new SimpleAttributeDefinitionBuilder(Constants.Model.PRINCIPAL_NAME_MAPPING_POLICY, ModelType.STRING, true) - .setXmlName(Constants.XML.PRINCIPAL_NAME_MAPPING_POLICY) - .build(); - - static final SimpleAttributeDefinition PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME = - new SimpleAttributeDefinitionBuilder(Constants.Model.PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME, ModelType.STRING, true) - .setXmlName(Constants.XML.PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME) - .build(); - - static final ListAttributeDefinition ROLE_ATTRIBUTES = - new StringListAttributeDefinition.Builder(Constants.Model.ROLE_ATTRIBUTES) - .setAllowNull(true) - .build(); - - static final SimpleAttributeDefinition ROLE_MAPPINGS_PROVIDER_ID = - new SimpleAttributeDefinitionBuilder(Constants.Model.ROLE_MAPPINGS_PROVIDER_ID, ModelType.STRING, true) - .setXmlName(Constants.XML.ID) - .build(); - - static final PropertiesAttributeDefinition ROLE_MAPPINGS_PROVIDER_CONFIG = - new PropertiesAttributeDefinition.Builder(Constants.Model.ROLE_MAPPINGS_PROVIDER_CONFIG, true) - .setXmlName(Constants.XML.PROPERTY) - .setWrapXmlElement(false) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {SSL_POLICY, NAME_ID_POLICY_FORMAT, LOGOUT_PAGE, FORCE_AUTHENTICATION, - IS_PASSIVE, TURN_OFF_CHANGE_SESSSION_ID_ON_LOGIN, KEEP_DOM_ASSERTION, AUTODETECT_BEARER_ONLY}; - static final AttributeDefinition[] ELEMENTS = {PRINCIPAL_NAME_MAPPING_POLICY, PRINCIPAL_NAME_MAPPING_ATTRIBUTE_NAME, ROLE_ATTRIBUTES, - ROLE_MAPPINGS_PROVIDER_ID, ROLE_MAPPINGS_PROVIDER_CONFIG}; - - - private static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - private static final HashMap ALL_MAP = new HashMap<>(); - static final Collection ALL_ATTRIBUTES; - - static { - for (SimpleAttributeDefinition def : ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - - ALL_MAP.putAll(ATTRIBUTE_MAP); - for (AttributeDefinition def : ELEMENTS) { - ALL_MAP.put(def.getXmlName(), def); - } - ALL_ATTRIBUTES = Collections.unmodifiableCollection(ALL_MAP.values()); - } - - static final ServiceProviderDefinition INSTANCE = new ServiceProviderDefinition(); - - private ServiceProviderDefinition() { - super(PathElement.pathElement(Constants.Model.SERVICE_PROVIDER), - KeycloakSamlExtension.getResourceDescriptionResolver(Constants.Model.SERVICE_PROVIDER), - ServiceProviderAddHandler.INSTANCE, - ReloadRequiredRemoveStepHandler.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); - - final OperationStepHandler writeHandler = new ReloadRequiredWriteAttributeHandler(ALL_ATTRIBUTES); - for (AttributeDefinition attribute : ALL_ATTRIBUTES) { - resourceRegistration.registerReadWriteAttribute(attribute, null, writeHandler); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleLogoutDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleLogoutDefinition.java deleted file mode 100644 index 1a43dcdb09..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleLogoutDefinition.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.saml.as7; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.dmr.ModelType; - -import java.util.HashMap; - -/** - * @author Marko Strukelj - */ -abstract class SingleLogoutDefinition { - - static final SimpleAttributeDefinition VALIDATE_REQUEST_SIGNATURE = - new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_REQUEST_SIGNATURE, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.VALIDATE_REQUEST_SIGNATURE) - .build(); - - static final SimpleAttributeDefinition VALIDATE_RESPONSE_SIGNATURE = - new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_RESPONSE_SIGNATURE, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE) - .build(); - - static final SimpleAttributeDefinition SIGN_REQUEST = - new SimpleAttributeDefinitionBuilder(Constants.Model.SIGN_REQUEST, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.SIGN_REQUEST) - .build(); - - static final SimpleAttributeDefinition SIGN_RESPONSE = - new SimpleAttributeDefinitionBuilder(Constants.Model.SIGN_RESPONSE, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.SIGN_RESPONSE) - .build(); - - static final SimpleAttributeDefinition REQUEST_BINDING = - new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true) - .setXmlName(Constants.XML.REQUEST_BINDING) - .build(); - - static final SimpleAttributeDefinition RESPONSE_BINDING = - new SimpleAttributeDefinitionBuilder(Constants.Model.RESPONSE_BINDING, ModelType.STRING, true) - .setXmlName(Constants.XML.RESPONSE_BINDING) - .build(); - - static final SimpleAttributeDefinition POST_BINDING_URL = - new SimpleAttributeDefinitionBuilder(Constants.Model.POST_BINDING_URL, ModelType.STRING, true) - .setXmlName(Constants.XML.POST_BINDING_URL) - .build(); - - static final SimpleAttributeDefinition REDIRECT_BINDING_URL = - new SimpleAttributeDefinitionBuilder(Constants.Model.REDIRECT_BINDING_URL, ModelType.STRING, true) - .setXmlName(Constants.XML.REDIRECT_BINDING_URL) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {VALIDATE_REQUEST_SIGNATURE, VALIDATE_RESPONSE_SIGNATURE, - SIGN_REQUEST, SIGN_RESPONSE, REQUEST_BINDING, RESPONSE_BINDING, POST_BINDING_URL, REDIRECT_BINDING_URL}; - - static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleSignOnDefinition.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleSignOnDefinition.java deleted file mode 100644 index be7896fc8b..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/SingleSignOnDefinition.java +++ /dev/null @@ -1,78 +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.saml.as7; - -import org.jboss.as.controller.SimpleAttributeDefinition; -import org.jboss.as.controller.SimpleAttributeDefinitionBuilder; -import org.jboss.dmr.ModelType; - -import java.util.HashMap; - -/** - * @author Marko Strukelj - */ -abstract class SingleSignOnDefinition { - - static final SimpleAttributeDefinition SIGN_REQUEST = - new SimpleAttributeDefinitionBuilder(Constants.Model.SIGN_REQUEST, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.SIGN_REQUEST) - .build(); - - static final SimpleAttributeDefinition VALIDATE_RESPONSE_SIGNATURE = - new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_RESPONSE_SIGNATURE, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.VALIDATE_RESPONSE_SIGNATURE) - .build(); - - static final SimpleAttributeDefinition VALIDATE_ASSERTION_SIGNATURE = - new SimpleAttributeDefinitionBuilder(Constants.Model.VALIDATE_ASSERTION_SIGNATURE, ModelType.BOOLEAN, true) - .setXmlName(Constants.XML.VALIDATE_ASSERTION_SIGNATURE) - .build(); - - static final SimpleAttributeDefinition REQUEST_BINDING = - new SimpleAttributeDefinitionBuilder(Constants.Model.REQUEST_BINDING, ModelType.STRING, true) - .setXmlName(Constants.XML.REQUEST_BINDING) - .build(); - - static final SimpleAttributeDefinition RESPONSE_BINDING = - new SimpleAttributeDefinitionBuilder(Constants.Model.RESPONSE_BINDING, ModelType.STRING, true) - .setXmlName(Constants.XML.RESPONSE_BINDING) - .build(); - - static final SimpleAttributeDefinition BINDING_URL = - new SimpleAttributeDefinitionBuilder(Constants.Model.BINDING_URL, ModelType.STRING, true) - .setXmlName(Constants.XML.BINDING_URL) - .build(); - - static final SimpleAttributeDefinition ASSERTION_CONSUMER_SERVICE_URL = - new SimpleAttributeDefinitionBuilder(Constants.Model.ASSERTION_CONSUMER_SERVICE_URL, ModelType.STRING, true) - .setXmlName(Constants.XML.ASSERTION_CONSUMER_SERVICE_URL) - .build(); - - static final SimpleAttributeDefinition[] ATTRIBUTES = {SIGN_REQUEST, VALIDATE_RESPONSE_SIGNATURE, VALIDATE_ASSERTION_SIGNATURE, REQUEST_BINDING, RESPONSE_BINDING, BINDING_URL, ASSERTION_CONSUMER_SERVICE_URL}; - - static final HashMap ATTRIBUTE_MAP = new HashMap<>(); - - static { - for (SimpleAttributeDefinition def : ATTRIBUTES) { - ATTRIBUTE_MAP.put(def.getXmlName(), def); - } - } - - static SimpleAttributeDefinition lookup(String xmlName) { - return ATTRIBUTE_MAP.get(xmlName); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Util.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Util.java deleted file mode 100755 index b8af8e461b..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/Util.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.saml.as7; - -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -import org.jboss.dmr.ModelNode; - -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP; -import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR; - -/** - * @author Bill Burke - * @version $Revision: 1 $ - */ -public class Util { - public static ModelNode createAddOperation(final PathAddress address) { - return createOperation(ModelDescriptionConstants.ADD, address); - } - - public static ModelNode createAddOperation() { - return createEmptyOperation(ModelDescriptionConstants.ADD, null); - } - - public static ModelNode createRemoveOperation(final PathAddress address) { - return createOperation(ModelDescriptionConstants.REMOVE, address); - } - - public static ModelNode createOperation(final String operationName, final PathAddress address) { - return createEmptyOperation(operationName, address); - } - - public static ModelNode createEmptyOperation(String operationName, final PathAddress address) { - ModelNode op = new ModelNode(); - op.get(OP).set(operationName); - if (address != null) { - op.get(OP_ADDR).set(address.toModelNode()); - } else { - // Just establish the standard structure; caller can fill in address later - op.get(OP_ADDR); - } - return op; - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/logging/KeycloakLogger.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/logging/KeycloakLogger.java deleted file mode 100755 index b7e235493e..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/logging/KeycloakLogger.java +++ /dev/null @@ -1,49 +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.saml.as7.logging; - -import org.jboss.logging.BasicLogger; -import org.jboss.logging.LogMessage; -import org.jboss.logging.Logger; -import org.jboss.logging.Message; -import org.jboss.logging.MessageLogger; - -import static org.jboss.logging.Logger.Level.DEBUG; -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 SAML subsystem override for deployment %s") - void deploymentSecured(String deployment); - - @LogMessage(level = DEBUG) - @Message(value = "Keycloak SAML has overriden and secured deployment %s") - void warSecured(String deployment); - -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/logging/KeycloakMessages.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/logging/KeycloakMessages.java deleted file mode 100755 index 58501b157f..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/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.saml.as7.logging; - -import org.jboss.logging.MessageBundle; -import org.jboss.logging.Messages; - -/** - * 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 = "TLIP") -public interface KeycloakMessages { - - /** - * The messages - */ - KeycloakMessages MESSAGES = Messages.getBundle(KeycloakMessages.class); -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/FormattingXMLStreamWriter.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/FormattingXMLStreamWriter.java deleted file mode 100644 index 2334a63ad7..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/FormattingXMLStreamWriter.java +++ /dev/null @@ -1,528 +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.saml.as7.xml; - -import org.jboss.staxmapper.XMLExtendedStreamWriter; - -import javax.xml.namespace.NamespaceContext; -import javax.xml.stream.XMLStreamConstants; -import javax.xml.stream.XMLStreamException; -import javax.xml.stream.XMLStreamWriter; -import java.lang.reflect.UndeclaredThrowableException; -import java.util.ArrayDeque; -import java.util.Iterator; - -/** - * An XML stream writer which nicely formats the XML for configuration files. - * - * @author David M. Lloyd - */ -public final class FormattingXMLStreamWriter implements XMLExtendedStreamWriter, XMLStreamConstants { - private static final String NO_NAMESPACE = new String(); - private final XMLStreamWriter delegate; - private final ArrayDeque attrQueue = new ArrayDeque(); - private int level; - private int state = START_DOCUMENT; - private boolean indentEndElement = false; - private ArrayDeque unspecifiedNamespaces = new ArrayDeque(); - - - public FormattingXMLStreamWriter(final XMLStreamWriter delegate) { - this.delegate = delegate; - unspecifiedNamespaces.push(NO_NAMESPACE); - } - - private void nl() throws XMLStreamException { - delegate.writeCharacters("\n"); - } - - private void indent() throws XMLStreamException { - int level = this.level; - final XMLStreamWriter delegate = this.delegate; - for (int i = 0; i < level; i ++) { - delegate.writeCharacters(" "); - } - } - - private interface ArgRunnable { - public void run(int arg) throws XMLStreamException; - } - - @Override - public void setUnspecifiedElementNamespace(final String namespace) { - ArrayDeque namespaces = this.unspecifiedNamespaces; - namespaces.pop(); - namespaces.push(namespace == null ? NO_NAMESPACE : namespace); - } - - private String nestUnspecifiedNamespace() { - ArrayDeque namespaces = unspecifiedNamespaces; - String clone = namespaces.getFirst(); - namespaces.push(clone); - return clone; - } - - @Override - public void writeStartElement(final String localName) throws XMLStreamException { - ArrayDeque namespaces = unspecifiedNamespaces; - String namespace = namespaces.getFirst(); - if (namespace == null ? NO_NAMESPACE != null : ! namespace.equals(NO_NAMESPACE)) { - writeStartElement(namespace, localName); - return; - } - - unspecifiedNamespaces.push(namespace); - - // If this is a nested element flush the outer - runAttrQueue(); - nl(); - indent(); - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - if (arg == 0) { - delegate.writeStartElement(localName); - } else { - delegate.writeEmptyElement(localName); - } - } - }); - - level++; - state = START_ELEMENT; - indentEndElement = false; - } - - @Override - public void writeStartElement(final String namespaceURI, final String localName) throws XMLStreamException { - nestUnspecifiedNamespace(); - - // If this is a nested element flush the outer - runAttrQueue(); - nl(); - indent(); - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - if (arg == 0) { - delegate.writeStartElement(namespaceURI, localName); - } else { - delegate.writeEmptyElement(namespaceURI, localName); - } - } - }); - level++; - state = START_ELEMENT; - indentEndElement = false; - } - - @Override - public void writeStartElement(final String prefix, final String localName, final String namespaceURI) throws XMLStreamException { - nestUnspecifiedNamespace(); - - // If this is a nested element flush the outer - runAttrQueue(); - nl(); - indent(); - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - if (arg == 0) { - delegate.writeStartElement(prefix, localName, namespaceURI); - } else { - delegate.writeEmptyElement(prefix, localName, namespaceURI); - } - } - }); - level++; - state = START_ELEMENT; - indentEndElement = false; - } - - @Override - public void writeEmptyElement(final String namespaceURI, final String localName) throws XMLStreamException { - runAttrQueue(); - nl(); - indent(); - delegate.writeEmptyElement(namespaceURI, localName); - state = END_ELEMENT; - } - - @Override - public void writeEmptyElement(final String prefix, final String localName, final String namespaceURI) throws XMLStreamException { - runAttrQueue(); - nl(); - indent(); - delegate.writeEmptyElement(prefix, localName, namespaceURI); - state = END_ELEMENT; - } - - @Override - public void writeEmptyElement(final String localName) throws XMLStreamException { - String namespace = unspecifiedNamespaces.getFirst(); - if (namespace == null ? NO_NAMESPACE != null : ! namespace.equals(NO_NAMESPACE)) { - writeEmptyElement(namespace, localName); - return; - } - - runAttrQueue(); - nl(); - indent(); - delegate.writeEmptyElement(localName); - state = END_ELEMENT; - } - - @Override - public void writeEndElement() throws XMLStreamException { - level--; - if (state != START_ELEMENT) { - runAttrQueue(); - if (state != CHARACTERS || indentEndElement) { - nl(); - indent(); - indentEndElement = false; - } - delegate.writeEndElement(); - } else { - // Change the start element to an empty element - ArgRunnable start = attrQueue.poll(); - if (start == null) { - delegate.writeEndElement(); - } else { - start.run(1); - // Write everything else - runAttrQueue(); - } - } - - unspecifiedNamespaces.pop(); - state = END_ELEMENT; - } - - private void runAttrQueue() throws XMLStreamException { - ArgRunnable attr; - while ((attr = attrQueue.poll()) != null) { - attr.run(0); - } - } - - @Override - public void writeEndDocument() throws XMLStreamException { - delegate.writeEndDocument(); - state = END_DOCUMENT; - } - - @Override - public void close() throws XMLStreamException { - delegate.close(); - state = END_DOCUMENT; - } - - @Override - public void flush() throws XMLStreamException { - delegate.flush(); - } - - @Override - public void writeAttribute(final String localName, final String value) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - try { - delegate.writeAttribute(localName, value); - } catch (XMLStreamException e) { - throw new UndeclaredThrowableException(e); - } - } - }); - } - - @Override - public void writeAttribute(final String prefix, final String namespaceURI, final String localName, final String value) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(prefix, namespaceURI, localName, value); - } - }); - } - - @Override - public void writeAttribute(final String namespaceURI, final String localName, final String value) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(namespaceURI, localName, value); - } - }); - } - - @Override - public void writeAttribute(final String localName, final String[] values) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(localName, join(values)); - } - }); - } - - @Override - public void writeAttribute(final String prefix, final String namespaceURI, final String localName, final String[] values) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(prefix, namespaceURI, localName, join(values)); - } - }); - } - - @Override - public void writeAttribute(final String namespaceURI, final String localName, final String[] values) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(namespaceURI, localName, join(values)); - } - }); - } - - @Override - public void writeAttribute(final String localName, final Iterable values) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(localName, join(values)); - } - }); - } - - @Override - public void writeAttribute(final String prefix, final String namespaceURI, final String localName, final Iterable values) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(prefix, namespaceURI, localName, join(values)); - } - }); - } - - @Override - public void writeAttribute(final String namespaceURI, final String localName, final Iterable values) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeAttribute(namespaceURI, localName, join(values)); - } - }); - } - - @Override - public void writeNamespace(final String prefix, final String namespaceURI) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeNamespace(prefix, namespaceURI); - } - }); - } - - @Override - public void writeDefaultNamespace(final String namespaceURI) throws XMLStreamException { - attrQueue.add(new ArgRunnable() { - public void run(int arg) throws XMLStreamException { - delegate.writeDefaultNamespace(namespaceURI); - } - }); - } - - @Override - public void writeComment(final String data) throws XMLStreamException { - runAttrQueue(); - nl(); - nl(); - indent(); - final StringBuilder b = new StringBuilder(data.length()); - final Iterator i = Spliterator.over(data, '\n'); - if (! i.hasNext()) { - return; - } else { - final String first = i.next(); - if (! i.hasNext()) { - delegate.writeComment(" " + first + " "); - state = COMMENT; - return; - } else { - b.append('\n'); - for (int q = 0; q < level; q++) { - b.append(" "); - } - b.append(" ~ "); - b.append(first); - do { - b.append('\n'); - for (int q = 0; q < level; q++) { - b.append(" "); - } - b.append(" ~ "); - b.append(i.next()); - } while (i.hasNext()); - } - b.append('\n'); - for (int q = 0; q < level; q ++) { - b.append(" "); - } - b.append(" "); - delegate.writeComment(b.toString()); - state = COMMENT; - } - } - - @Override - public void writeProcessingInstruction(final String target) throws XMLStreamException { - runAttrQueue(); - nl(); - indent(); - delegate.writeProcessingInstruction(target); - state = PROCESSING_INSTRUCTION; - } - - @Override - public void writeProcessingInstruction(final String target, final String data) throws XMLStreamException { - runAttrQueue(); - nl(); - indent(); - delegate.writeProcessingInstruction(target, data); - state = PROCESSING_INSTRUCTION; - } - - @Override - public void writeCData(final String data) throws XMLStreamException { - runAttrQueue(); - delegate.writeCData(data); - state = CDATA; - } - - @Override - public void writeDTD(final String dtd) throws XMLStreamException { - nl(); - indent(); - delegate.writeDTD(dtd); - state = DTD; - } - - @Override - public void writeEntityRef(final String name) throws XMLStreamException { - runAttrQueue(); - delegate.writeEntityRef(name); - state = ENTITY_REFERENCE; - } - - @Override - public void writeStartDocument() throws XMLStreamException { - delegate.writeStartDocument(); - nl(); - state = START_DOCUMENT; - } - - @Override - public void writeStartDocument(final String version) throws XMLStreamException { - delegate.writeStartDocument(version); - nl(); - state = START_DOCUMENT; - } - - @Override - public void writeStartDocument(final String encoding, final String version) throws XMLStreamException { - delegate.writeStartDocument(encoding, version); - nl(); - state = START_DOCUMENT; - } - - @Override - public void writeCharacters(final String text) throws XMLStreamException { - runAttrQueue(); - if (state != CHARACTERS) { - nl(); - indent(); - } - final Iterator iterator = Spliterator.over(text, '\n'); - while (iterator.hasNext()) { - final String t = iterator.next(); - delegate.writeCharacters(t); - if (iterator.hasNext()) { - nl(); - indent(); - } - } - state = CHARACTERS; - indentEndElement = true; - } - - @Override - public void writeCharacters(final char[] text, final int start, final int len) throws XMLStreamException { - runAttrQueue(); - delegate.writeCharacters(text, start, len); - state = CHARACTERS; - } - - @Override - public String getPrefix(final String uri) throws XMLStreamException { - return delegate.getPrefix(uri); - } - - @Override - public void setPrefix(final String prefix, final String uri) throws XMLStreamException { - delegate.setPrefix(prefix, uri); - } - - @Override - public void setDefaultNamespace(final String uri) throws XMLStreamException { - runAttrQueue(); - delegate.setDefaultNamespace(uri); - } - - @Override - public void setNamespaceContext(final NamespaceContext context) throws XMLStreamException { - delegate.setNamespaceContext(context); - } - - @Override - public NamespaceContext getNamespaceContext() { - return delegate.getNamespaceContext(); - } - - @Override - public Object getProperty(final String name) throws IllegalArgumentException { - return delegate.getProperty(name); - } - - private static String join(final String[] values) { - final StringBuilder b = new StringBuilder(); - for (int i = 0, valuesLength = values.length; i < valuesLength; i++) { - final String s = values[i]; - if (s != null) { - if (i > 0) { - b.append(' '); - } - b.append(s); - } - } - return b.toString(); - } - - private static String join(final Iterable values) { - final StringBuilder b = new StringBuilder(); - Iterator iterator = values.iterator(); - while (iterator.hasNext()) { - final String s = iterator.next(); - if (s != null) { - b.append(s); - if (iterator.hasNext()) b.append(' '); - } - } - return b.toString(); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/Spliterator.java b/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/Spliterator.java deleted file mode 100644 index 684a9aa513..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/java/org/keycloak/subsystem/saml/as7/xml/Spliterator.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.saml.as7.xml; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * @author David M. Lloyd - */ -final class Spliterator implements Iterator { - private final String subject; - private final char delimiter; - private int i; - - Spliterator(final String subject, final char delimiter) { - this.subject = subject; - this.delimiter = delimiter; - i = 0; - } - - static Spliterator over(String subject, char delimiter) { - return new Spliterator(subject, delimiter); - } - - public boolean hasNext() { - return i != -1; - } - - public String next() { - final int i = this.i; - if (i == -1) { - throw new NoSuchElementException(); - } - int n = subject.indexOf(delimiter, i); - try { - return n == -1 ? subject.substring(i) : subject.substring(i, n); - } finally { - this.i = n == -1 ? -1 : n + 1; - } - } - - public void remove() { - throw new UnsupportedOperationException(); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension b/adapters/saml/as7-eap6/subsystem/src/main/resources/META-INF/services/org.jboss.as.controller.Extension deleted file mode 100755 index 5fd02fb2ba..0000000000 --- a/adapters/saml/as7-eap6/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.saml.as7.KeycloakSamlExtension diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/org/keycloak/subsystem/saml/as7/LocalDescriptions.properties b/adapters/saml/as7-eap6/subsystem/src/main/resources/org/keycloak/subsystem/saml/as7/LocalDescriptions.properties deleted file mode 100755 index 89e89aa973..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/resources/org/keycloak/subsystem/saml/as7/LocalDescriptions.properties +++ /dev/null @@ -1,105 +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-saml.subsystem=Keycloak adapter subsystem -keycloak-saml.subsystem.add=Operation Adds Keycloak adapter subsystem -keycloak-saml.subsystem.remove=Operation removes Keycloak adapter subsystem -keycloak-saml.subsystem.secure-deployment=A deployment secured by Keycloak. - -keycloak-saml.secure-deployment=A deployment secured by Keycloak -keycloak-saml.secure-deployment.add=Add a deployment to be secured by Keycloak -keycloak-saml.secure-deployment.remove=Remove a deployment to be secured by Keycloak -keycloak-saml.secure-deployment.SP=A security provider configuration for secure deployment - -keycloak-saml.SP=A security provider configuration for secure deployment -keycloak-saml.SP.add=Add a security provider configuration to deployment secured by Keycloak SAML -keycloak-saml.SP.remove=Remove a security provider definition from deployment secured by Keycloak SAML -keycloak-saml.SP.sslPolicy=SSL Policy to use -keycloak-saml.SP.nameIDPolicyFormat=Name ID policy format URN -keycloak-saml.SP.logoutPage=URI to a logout page -keycloak-saml.SP.forceAuthentication=Redirected unauthenticated request to a login page -keycloak-saml.SP.keepDOMAssertion=Attribute to inject the DOM representation of the assertion into the SamlPrincipal (respecting the original syntax) -keycloak-saml.SP.isPassive=If user isn't logged in just return with an error. Used to check if a user is already logged in or not -keycloak-saml.SP.turnOffChangeSessionIdOnLogin=The session id is changed by default on a successful login. Change this to true if you want to turn this off -keycloak-saml.SP.autodetectBearerOnly=Set to true if the application serves both a web application and web services (e.g. SOAP or REST). It allows redirection of unauthenticated users of the web application to the Keycloak login page, but send an HTTP 401 status code to unauthenticated SOAP or REST clients instead -keycloak-saml.SP.RoleIdentifiers=Role identifiers -keycloak-saml.SP.PrincipalNameMapping-policy=Principal name mapping policy -keycloak-saml.SP.PrincipalNameMapping-attribute-name=Principal name mapping attribute name -keycloak-saml.SP.Key=A key definition -keycloak-saml.SP.IDP=Identity provider definition -keycloak-saml.SP.roleMappingsProviderId=The string that identifies the role mappings provider to be used within the SP -keycloak-saml.SP.roleMappingsProviderConfig=The configuration properties of the role mappings provider - - -keycloak-saml.Key=A key configuration for service provider or identity provider -keycloak-saml.Key.add=Add a key definition -keycloak-saml.Key.remove=Remove a key definition -keycloak-saml.Key.signing=Key can be used for signing -keycloak-saml.Key.encryption=Key can be used for encryption -keycloak-saml.Key.PrivateKeyPem=Private key string in pem format -keycloak-saml.Key.PublicKeyPem=Public key string in pem format -keycloak-saml.Key.CertificatePem=Certificate key string in pem format -keycloak-saml.Key.KeyStore=Key store definition -keycloak-saml.Key.KeyStore.file=Key store filesystem path -keycloak-saml.Key.KeyStore.resource=Key store resource URI -keycloak-saml.Key.KeyStore.password=Key store password -keycloak-saml.Key.KeyStore.type=Key store format -keycloak-saml.Key.KeyStore.alias=Key alias -keycloak-saml.Key.KeyStore.PrivateKey-alias=Private key alias -keycloak-saml.Key.KeyStore.PrivateKey-password=Private key password -keycloak-saml.Key.KeyStore.Certificate-alias=Certificate alias - -keycloak-saml.IDP=An identity provider configuration -keycloak-saml.IDP.add=Add an identity provider -keycloak-saml.IDP.remove=Remove an identity provider -keycloak-saml.IDP.signaturesRequired=Require signatures for SingleSignOnService and SingleLogoutService -keycloak-saml.IDP.signatureAlgorithm=Signature algorithm -keycloak-saml.IDP.signatureCanonicalizationMethod=Signature canonicalization method -keycloak-saml.IDP.metadataUrl=The URL used to retrieve the IDP metadata from -keycloak-saml.IDP.SingleSignOnService=Single sign-on configuration -keycloak-saml.IDP.SingleSignOnService.signRequest=Sign SSO requests -keycloak-saml.IDP.SingleSignOnService.validateResponseSignature=Validate an SSO response signature -keycloak-saml.IDP.SingleSignOnService.validateAssertionSignature=Validate an SSO assertion signature -keycloak-saml.IDP.SingleSignOnService.requestBinding=HTTP method to use for requests -keycloak-saml.IDP.SingleSignOnService.responseBinding=HTTP method to use for responses -keycloak-saml.IDP.SingleSignOnService.bindingUrl=SSO endpoint URL -keycloak-saml.IDP.SingleSignOnService.assertionConsumerServiceUrl=Endpoint of Assertion Consumer Service at SP -keycloak-saml.IDP.SingleLogoutService=Single logout configuration -keycloak-saml.IDP.SingleLogoutService.validateRequestSignature=Validate a SingleLogoutService request signature -keycloak-saml.IDP.SingleLogoutService.validateResponseSignature=Validate a SingleLogoutService response signature -keycloak-saml.IDP.SingleLogoutService.signRequest=Sign SingleLogoutService requests -keycloak-saml.IDP.SingleLogoutService.signResponse=Sign SingleLogoutService responses -keycloak-saml.IDP.SingleLogoutService.requestBinding=HTTP method to use for request -keycloak-saml.IDP.SingleLogoutService.responseBinding=HTTP method to use for response -keycloak-saml.IDP.SingleLogoutService.postBindingUrl=Endpoint URL for posting -keycloak-saml.IDP.SingleLogoutService.redirectBindingUrl=Endpoint URL for redirects -keycloak-saml.IDP.Key=Key definition for identity provider -keycloak-saml.IDP.AllowedClockSkew=Allowed clock skew between the IDP and the SP -keycloak-saml.IDP.AllowedClockSkew.value=Allowed clock skew value between the IDP and the SP -keycloak-saml.IDP.AllowedClockSkew.unit=Time unit for the value of the clock skew. Values: MINUTES, SECONDS, MILLISECONDS, MICROSECONDS, NANOSECONDS -keycloak-saml.IDP.HttpClient=Configuration of HTTP client used for automatic retrieval of certificates for signature validation -keycloak-saml.IDP.HttpClient.allowAnyHostname=Define if hostname validation should be disabled (true) or not (false) -keycloak-saml.IDP.HttpClient.clientKeystore=Path to the keystore that contains client certificates for two-way SSL -keycloak-saml.IDP.HttpClient.clientKeystorePassword=The keystore password -keycloak-saml.IDP.HttpClient.connectionPoolSize=The number of pooled connections -keycloak-saml.IDP.HttpClient.disableTrustManager=Define if SSL certificate validation should be disabled (true) or not (false) -keycloak-saml.IDP.HttpClient.proxyUrl=URL to the HTTP proxy, if applicable -keycloak-saml.IDP.HttpClient.truststore=Path to the truststore used to validate the IDP certificates -keycloak-saml.IDP.HttpClient.truststorePassword=The truststore password -keycloak-saml.IDP.HttpClient.socketTimeout=Timeout for socket waiting for data in milliseconds -keycloak-saml.IDP.HttpClient.connectionTimeout=Timeout for establishing the connection with the remote host in milliseconds -keycloak-saml.IDP.HttpClient.connectionTtl=The connection time to live in milliseconds \ No newline at end of file diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd b/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd deleted file mode 100755 index 26ddac7bf4..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_1.xsd +++ /dev/null @@ -1,305 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - - - - The entity ID for SAML service provider - - - - - The ssl policy - - - - - Name ID policy format URN - - - - - URI to a logout page - - - - - Redirected unauthenticated request to a login page - - - - - If user isn't logged in just return with an error. Used to check if a user is already logged in or not - - - - - The session id is changed by default on a successful login. Change this to true if you want to turn this off - - - - - - - - - - - - The entity ID for SAML service provider - - - - - Require signatures for single-sign-on and single-logout - - - - - Algorithm used for signatures - - - - - Canonicalization method used for signatures - - - - - - - Sign the SSO requests - - - - - Validate the SSO response signature - - - - - Validate the SSO assertion signature - - - - - HTTP method to use for requests - - - - - HTTP method to use for response - - - - - SSO endpoint URL - - - - - Endpoint of Assertion Consumer Service at SP - - - - - - - Validate a single-logout request signature - - - - - Validate a single-logout response signature - - - - - Sign single-logout requests - - - - - Sign single-logout responses - - - - - HTTP method to use for request - - - - - HTTP method to use for response - - - - - Endpoint URL for posting - - - - - Endpoint URL for redirects - - - - - - - - - - - - - - - - - - Key can be used for signing - - - - - Key can be used for encryption - - - - - - - - - - - Key store filesystem path - - - - - Key store resource URI - - - - - Key store password - - - - - Key store format - - - - - Key alias - - - - - - - - Private key alias - - - - - Private key password - - - - - - - - Certificate alias - - - - - - - - Principal name mapping policy. Possible values: FROM_NAME_ID - - - - - Name of the attribute to use for principal name mapping - - - - - - - - - - - - - - Role attribute - - - - diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_2.xsd b/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_2.xsd deleted file mode 100755 index 36277b579e..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_2.xsd +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the realm. - - - - - - - - - - - - - - - The entity ID for SAML service provider - - - - - The ssl policy - - - - - Name ID policy format URN - - - - - URI to a logout page - - - - - Redirected unauthenticated request to a login page - - - - - Attribute to inject the DOM representation of the assertion into the SamlPrincipal (respecting the original syntax). Default value is false - - - - - If user isn't logged in just return with an error. Used to check if a user is already logged in or not - - - - - The session id is changed by default on a successful login. Change this to true if you want to turn this off - - - - - - - - - - - This defines the allowed clock skew between IDP and SP in milliseconds. The default value is 0. - - - - - - The entity ID for SAML service provider - - - - - Require signatures for single-sign-on and single-logout - - - - - Algorithm used for signatures - - - - - Canonicalization method used for signatures - - - - - - - Sign the SSO requests - - - - - Validate the SSO response signature - - - - - Validate the SSO assertion signature - - - - - HTTP method to use for requests - - - - - HTTP method to use for response - - - - - SSO endpoint URL - - - - - Endpoint of Assertion Consumer Service at SP - - - - - - - Validate a single-logout request signature - - - - - Validate a single-logout response signature - - - - - Sign single-logout requests - - - - - Sign single-logout responses - - - - - HTTP method to use for request - - - - - HTTP method to use for response - - - - - Endpoint URL for posting - - - - - Endpoint URL for redirects - - - - - - - - - - - - - - - - - - Key can be used for signing - - - - - Key can be used for encryption - - - - - - - - - - - Key store filesystem path - - - - - Key store resource URI - - - - - Key store password - - - - - Key store format - - - - - Key alias - - - - - - - - Private key alias - - - - - Private key password - - - - - - - - Certificate alias - - - - - - - - Principal name mapping policy. Possible values: FROM_NAME_ID - - - - - Name of the attribute to use for principal name mapping - - - - - - - - - - - - - - Role attribute - - - - - - - - - Specifies a configuration property for the provider. - - - - - - The id of the role mappings provider that is to be used. Example: properties-based-provider. - - - - - - - - The name (key) of the configuration property. - - - - - The value of the configuration property. - - - - - - - The value is the allowed clock skew between the IDP and the SP. - - - - - - - - - - Time unit for the value of the clock skew. - - - - - - - - - - - diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_3.xsd b/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_3.xsd deleted file mode 100755 index 48562b66b6..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_3.xsd +++ /dev/null @@ -1,570 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the deployment - - - - - - - - - - List of service provider encryption and validation keys. - - If the IDP requires that the client application (SP) sign all of its requests and/or if the IDP will encrypt assertions, you must define the keys used to do this. For client signed documents you must define both the private and public key or certificate that will be used to sign documents. For encryption, you only have to define the private key that will be used to decrypt. - - - - - When creating a Java Principal object that you obtain from methods like HttpServletRequest.getUserPrincipal(), you can define what name that is returned by the Principal.getName() method. - - - - - Defines what SAML attributes within the assertion received from the user should be used as role identifiers within the Java EE Security Context for the user. - By default Role attribute values are converted to Java EE roles. Some IDPs send roles via a member or memberOf attribute assertion. You can define one or more Attribute elements to specify which SAML attributes must be converted into roles. - - - - - Specifies the role mappings provider implementation that will be used to map the roles extracted from the SAML assertion into the final set of roles - that will be assigned to the principal. A provider is typically used to map roles retrieved from third party IDPs into roles that exist in the JEE application environment. It can also - assign extra roles to the assertion principal (for example, by connecting to an LDAP server to obtain more roles) or remove some of the roles that were set by the IDP. - - - - - Describes configuration of SAML identity provider for this service provider. - - - - - - This is the identifier for this client. The IDP needs this value to determine who the client is that is communicating with it. - - - - - SSL policy the adapter will enforce. - - - - - SAML clients can request a specific NameID Subject format. Fill in this value if you want a specific format. It must be a standard SAML format identifier, i.e. urn:oasis:names:tc:SAML:2.0:nameid-format:transient. By default, no special format is requested. - - - - - URL of the logout page. - - - - - SAML clients can request that a user is re-authenticated even if they are already logged in at the IDP. Default value is false. - - - - - Attribute to inject the DOM representation of the assertion into the SamlPrincipal (respecting the original syntax). Default value is false - - - - - SAML clients can request that a user is never asked to authenticate even if they are not logged in at the IDP. Set this to true if you want this. Do not use together with forceAuthentication as they are opposite. Default value is false. - - - - - The session id is changed by default on a successful login on some platforms to plug a security attack vector. Change this to true to disable this. It is recommended you do not turn it off. Default value is false. - - - - - This should be set to true if your application serves both a web application and web services (e.g. SOAP or REST). It allows you to redirect unauthenticated users of the web application to the Keycloak login page, but send an HTTP 401 status code to unauthenticated SOAP or REST clients instead as they would not understand a redirect to the login page. Keycloak auto-detects SOAP or REST clients based on typical headers like X-Requested-With, SOAPAction or Accept. The default value is false. - - - - - - - - - Describes a single key used for signing or encryption. - - - - - - - - - - Java keystore to load keys and certificates from. - - - - - Private key (PEM format) - - - - - Public key (PEM format) - - - - - Certificate key (PEM format) - - - - - - Flag defining whether the key should be used for signing. - - - - - Flag defining whether the key should be used for encryption - - - - - - - - - Private key declaration - - - - - Certificate declaration - - - - - - File path to the key store. - - - - - WAR resource path to the key store. This is a path used in method call to ServletContext.getResourceAsStream(). - - - - - The password of the key store. - - - - - Key store format - - - - - Key alias - - - - - - - - Alias that points to the key or cert within the keystore. - - - - - Keystores require an additional password to access private keys. In the PrivateKey element you must define this password within a password attribute. - - - - - - - - Alias that points to the key or cert within the keystore. - - - - - - - - Policy used to populate value of Java Principal object obtained from methods like HttpServletRequest.getUserPrincipal(). - - - - - Name of the SAML assertion attribute to use within. - - - - - - - - - This policy just uses whatever the SAML subject value is. This is the default setting - - - - - This will pull the value from one of the attributes declared in the SAML assertion received from the server. You'll need to specify the name of the SAML assertion attribute to use within the attribute XML attribute. - - - - - - - - - - All requests must come in via HTTPS. - - - - - Only non-private IP addresses must come over the wire via HTTPS. - - - - - no requests are required to come over via HTTPS. - - - - - - - - - - - - - - - - - - - - - - - - - - Specifies SAML attribute to be converted into roles. - - - - - - - - - Specifies name of the SAML attribute to be converted into roles. - - - - - - - - - Specifies a configuration property for the provider. - - - - - - The id of the role mappings provider that is to be used. Example: properties-based-provider. - - - - - - - - The name (key) of the configuration property. - - - - - The value of the configuration property. - - - - - - - - - Configuration of the login SAML endpoint of the IDP. - - - - - Configuration of the logout SAML endpoint of the IDP - - - - - The Keys sub element of IDP is only used to define the certificate or public key to use to verify documents signed by the IDP. - - - - - Configuration of HTTP client used for automatic obtaining of certificates containing public keys for IDP signature verification via SAML descriptor of the IDP. - - - - - This defines the allowed clock skew between IDP and SP in milliseconds. The default value is 0. - - - - - - issuer ID of the IDP. - - - - - If set to true, the client adapter will sign every document it sends to the IDP. Also, the client will expect that the IDP will be signing any documents sent to it. This switch sets the default for all request and response types. - - - - - Signature algorithm that the IDP expects signed documents to use. Defaults to RSA_SHA256 - - - - - This is the signature canonicalization method that the IDP expects signed documents to use. The default value is https://www.w3.org/2001/10/xml-exc-c14n# and should be good for most IDPs. - - - - - - - - - - The URL used to retrieve the IDP metadata, currently this is only used to pick up signing and encryption keys periodically which allow cycling of these keys on the IDP without manual changes on the SP side. - - - - - - - - Should the client sign authn requests? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect the IDP to sign the assertion response document sent back from an auhtn request? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect the IDP to sign the individual assertions sent back from an auhtn request? Defaults to whatever the IDP signaturesRequired element value is. - - - - - SAML binding type used for communicating with the IDP. The default value is POST, but you can set it to REDIRECT as well. - - - - - SAML allows the client to request what binding type it wants authn responses to use. This value maps to ProtocolBinding attribute in SAML AuthnRequest. The default is that the client will not request a specific binding type for responses. - - - - - This is the URL for the IDP login service that the client will send requests to. - - - - - URL of the assertion consumer service (ACS) where the IDP login service should send responses to. By default it is unset, relying on the IdP settings. When set, it must end in "/saml". This property is typically accompanied by the responseBinding attribute. - - - - - - - - Should the client sign authn requests? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client sign logout responses it sends to the IDP requests? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect signed logout request documents from the IDP? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect signed logout response documents from the IDP? Defaults to whatever the IDP signaturesRequired element value is. - - - - - This is the SAML binding type used for communicating SAML requests to the IDP. The default value is POST. - - - - - This is the SAML binding type used for communicating SAML responses to the IDP. The default value is POST. - - - - - This is the URL for the IDP's logout service when using the POST binding. This setting is REQUIRED if using the POST binding. - - - - - This is the URL for the IDP's logout service when using the REDIRECT binding. This setting is REQUIRED if using the REDIRECT binding. - - - - - - - - If the the IDP server requires HTTPS and this config option is set to true the IDP's certificate - is validated via the truststore, but host name validation is not done. This setting should only be used during - development and never in production as it will partly disable verification of SSL certificates. - This seting may be useful in test environments. The default value is false. - - - - - This is the file path to a keystore file. This keystore contains client certificate - for two-way SSL when the adapter makes HTTPS requests to the IDP server. - - - - - Password for the client keystore and for the client's key. - - - - - Defines number of pooled connections. - - - - - If the the IDP server requires HTTPS and this config option is set to true you do not have to specify a truststore. - This setting should only be used during development and never in production as it will disable verification of SSL certificates. - The default value is false. - - - - - URL to HTTP proxy to use for HTTP connections. - - - - - The value is the file path to a keystore file. If you prefix the path with classpath:, - then the truststore will be obtained from the deployment's classpath instead. Used for outgoing - HTTPS communications to the IDP server. Client making HTTPS requests need - a way to verify the host of the server they are talking to. This is what the trustore does. - The keystore contains one or more trusted host certificates or certificate authorities. - You can create this truststore by extracting the public certificate of the IDP's SSL keystore. - - - - - - Password for the truststore keystore. - - - - - - - The value is the allowed clock skew between the IDP and the SP. - - - - - - - - - - Time unit for the value of the clock skew. - - - - - - - - - - - diff --git a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_4.xsd b/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_4.xsd deleted file mode 100644 index 9150f7a62f..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/main/resources/schema/wildfly-keycloak-saml_1_4.xsd +++ /dev/null @@ -1,585 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - The name of the deployment - - - - - - - - - - List of service provider encryption and validation keys. - - If the IDP requires that the client application (SP) sign all of its requests and/or if the IDP will encrypt assertions, you must define the keys used to do this. For client signed documents you must define both the private and public key or certificate that will be used to sign documents. For encryption, you only have to define the private key that will be used to decrypt. - - - - - When creating a Java Principal object that you obtain from methods like HttpServletRequest.getUserPrincipal(), you can define what name that is returned by the Principal.getName() method. - - - - - Defines what SAML attributes within the assertion received from the user should be used as role identifiers within the Java EE Security Context for the user. - By default Role attribute values are converted to Java EE roles. Some IDPs send roles via a member or memberOf attribute assertion. You can define one or more Attribute elements to specify which SAML attributes must be converted into roles. - - - - - Specifies the role mappings provider implementation that will be used to map the roles extracted from the SAML assertion into the final set of roles - that will be assigned to the principal. A provider is typically used to map roles retrieved from third party IDPs into roles that exist in the JEE application environment. It can also - assign extra roles to the assertion principal (for example, by connecting to an LDAP server to obtain more roles) or remove some of the roles that were set by the IDP. - - - - - Describes configuration of SAML identity provider for this service provider. - - - - - - This is the identifier for this client. The IDP needs this value to determine who the client is that is communicating with it. - - - - - SSL policy the adapter will enforce. - - - - - SAML clients can request a specific NameID Subject format. Fill in this value if you want a specific format. It must be a standard SAML format identifier, i.e. urn:oasis:names:tc:SAML:2.0:nameid-format:transient. By default, no special format is requested. - - - - - URL of the logout page. - - - - - SAML clients can request that a user is re-authenticated even if they are already logged in at the IDP. Default value is false. - - - - - Attribute to inject the DOM representation of the assertion into the SamlPrincipal (respecting the original syntax). Default value is false - - - - - SAML clients can request that a user is never asked to authenticate even if they are not logged in at the IDP. Set this to true if you want this. Do not use together with forceAuthentication as they are opposite. Default value is false. - - - - - The session id is changed by default on a successful login on some platforms to plug a security attack vector. Change this to true to disable this. It is recommended you do not turn it off. Default value is false. - - - - - This should be set to true if your application serves both a web application and web services (e.g. SOAP or REST). It allows you to redirect unauthenticated users of the web application to the Keycloak login page, but send an HTTP 401 status code to unauthenticated SOAP or REST clients instead as they would not understand a redirect to the login page. Keycloak auto-detects SOAP or REST clients based on typical headers like X-Requested-With, SOAPAction or Accept. The default value is false. - - - - - - - - - Describes a single key used for signing or encryption. - - - - - - - - - - Java keystore to load keys and certificates from. - - - - - Private key (PEM format) - - - - - Public key (PEM format) - - - - - Certificate key (PEM format) - - - - - - Flag defining whether the key should be used for signing. - - - - - Flag defining whether the key should be used for encryption - - - - - - - - - Private key declaration - - - - - Certificate declaration - - - - - - File path to the key store. - - - - - WAR resource path to the key store. This is a path used in method call to ServletContext.getResourceAsStream(). - - - - - The password of the key store. - - - - - Key store format - - - - - Key alias - - - - - - - - Alias that points to the key or cert within the keystore. - - - - - Keystores require an additional password to access private keys. In the PrivateKey element you must define this password within a password attribute. - - - - - - - - Alias that points to the key or cert within the keystore. - - - - - - - - Policy used to populate value of Java Principal object obtained from methods like HttpServletRequest.getUserPrincipal(). - - - - - Name of the SAML assertion attribute to use within. - - - - - - - - - This policy just uses whatever the SAML subject value is. This is the default setting - - - - - This will pull the value from one of the attributes declared in the SAML assertion received from the server. You'll need to specify the name of the SAML assertion attribute to use within the attribute XML attribute. - - - - - - - - - - All requests must come in via HTTPS. - - - - - Only non-private IP addresses must come over the wire via HTTPS. - - - - - no requests are required to come over via HTTPS. - - - - - - - - - - - - - - - - - - - - - - - - - - Specifies SAML attribute to be converted into roles. - - - - - - - - - Specifies name of the SAML attribute to be converted into roles. - - - - - - - - - Specifies a configuration property for the provider. - - - - - - The id of the role mappings provider that is to be used. Example: properties-based-provider. - - - - - - - - The name (key) of the configuration property. - - - - - The value of the configuration property. - - - - - - - - - Configuration of the login SAML endpoint of the IDP. - - - - - Configuration of the logout SAML endpoint of the IDP - - - - - The Keys sub element of IDP is only used to define the certificate or public key to use to verify documents signed by the IDP. - - - - - Configuration of HTTP client used for automatic obtaining of certificates containing public keys for IDP signature verification via SAML descriptor of the IDP. - - - - - This defines the allowed clock skew between IDP and SP in milliseconds. The default value is 0. - - - - - - issuer ID of the IDP. - - - - - If set to true, the client adapter will sign every document it sends to the IDP. Also, the client will expect that the IDP will be signing any documents sent to it. This switch sets the default for all request and response types. - - - - - Signature algorithm that the IDP expects signed documents to use. Defaults to RSA_SHA256 - - - - - This is the signature canonicalization method that the IDP expects signed documents to use. The default value is https://www.w3.org/2001/10/xml-exc-c14n# and should be good for most IDPs. - - - - - - - - - - The URL used to retrieve the IDP metadata, currently this is only used to pick up signing and encryption keys periodically which allow cycling of these keys on the IDP without manual changes on the SP side. - - - - - - - - Should the client sign authn requests? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect the IDP to sign the assertion response document sent back from an auhtn request? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect the IDP to sign the individual assertions sent back from an auhtn request? Defaults to whatever the IDP signaturesRequired element value is. - - - - - SAML binding type used for communicating with the IDP. The default value is POST, but you can set it to REDIRECT as well. - - - - - SAML allows the client to request what binding type it wants authn responses to use. This value maps to ProtocolBinding attribute in SAML AuthnRequest. The default is that the client will not request a specific binding type for responses. - - - - - This is the URL for the IDP login service that the client will send requests to. - - - - - URL of the assertion consumer service (ACS) where the IDP login service should send responses to. By default it is unset, relying on the IdP settings. When set, it must end in "/saml". This property is typically accompanied by the responseBinding attribute. - - - - - - - - Should the client sign authn requests? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client sign logout responses it sends to the IDP requests? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect signed logout request documents from the IDP? Defaults to whatever the IDP signaturesRequired element value is. - - - - - Should the client expect signed logout response documents from the IDP? Defaults to whatever the IDP signaturesRequired element value is. - - - - - This is the SAML binding type used for communicating SAML requests to the IDP. The default value is POST. - - - - - This is the SAML binding type used for communicating SAML responses to the IDP. The default value is POST. - - - - - This is the URL for the IDP's logout service when using the POST binding. This setting is REQUIRED if using the POST binding. - - - - - This is the URL for the IDP's logout service when using the REDIRECT binding. This setting is REQUIRED if using the REDIRECT binding. - - - - - - - - If the the IDP server requires HTTPS and this config option is set to true the IDP's certificate - is validated via the truststore, but host name validation is not done. This setting should only be used during - development and never in production as it will partly disable verification of SSL certificates. - This seting may be useful in test environments. The default value is false. - - - - - This is the file path to a keystore file. This keystore contains client certificate - for two-way SSL when the adapter makes HTTPS requests to the IDP server. - - - - - Password for the client keystore and for the client's key. - - - - - Defines number of pooled connections. - - - - - If the the IDP server requires HTTPS and this config option is set to true you do not have to specify a truststore. - This setting should only be used during development and never in production as it will disable verification of SSL certificates. - The default value is false. - - - - - URL to HTTP proxy to use for HTTP connections. - - - - - The value is the file path to a keystore file. If you prefix the path with classpath:, - then the truststore will be obtained from the deployment's classpath instead. Used for outgoing - HTTPS communications to the IDP server. Client making HTTPS requests need - a way to verify the host of the server they are talking to. This is what the trustore does. - The keystore contains one or more trusted host certificates or certificate authorities. - You can create this truststore by extracting the public certificate of the IDP's SSL keystore. - - - - - - Password for the truststore keystore. - - - - - Defines timeout for socket waiting for data in milliseconds. - - - - - Defines timeout for establishing the connection with the remote host in milliseconds. - - - - - Defines the connection time to live in milliseconds. - - - - - - - The value is the allowed clock skew between the IDP and the SP. - - - - - - - - - - Time unit for the value of the clock skew. - - - - - - - - - - - diff --git a/adapters/saml/as7-eap6/subsystem/src/test/java/org/keycloak/subsystem/saml/as7/SubsystemParsingAllowedClockSkewTestCase.java b/adapters/saml/as7-eap6/subsystem/src/test/java/org/keycloak/subsystem/saml/as7/SubsystemParsingAllowedClockSkewTestCase.java deleted file mode 100755 index 4718b53567..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/test/java/org/keycloak/subsystem/saml/as7/SubsystemParsingAllowedClockSkewTestCase.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright 2019 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.saml.as7; - -import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; - -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.stream.XMLStreamException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; -import org.jboss.as.controller.ExpressionResolver; -import org.jboss.as.controller.PathAddress; -import org.jboss.as.controller.PathElement; -import org.jboss.as.controller.descriptions.ModelDescriptionConstants; -import org.jboss.as.model.test.ModelTestUtils; -import org.jboss.as.subsystem.test.KernelServices; -import org.jboss.dmr.ModelNode; -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.w3c.dom.DOMException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Test case for AllowedClockSkew subsystem configuration. - * - * @author rmartinc - */ -public class SubsystemParsingAllowedClockSkewTestCase extends AbstractSubsystemBaseTest { - - private String subsystemXml = null; - - @Rule - public final ExpectedException exception = ExpectedException.none(); - - public SubsystemParsingAllowedClockSkewTestCase() { - super(KeycloakSamlExtension.SUBSYSTEM_NAME, new KeycloakSamlExtension()); - } - - @Override - protected String getSubsystemXml() throws IOException { - return subsystemXml; - } - - private void setSubsystemXml(String value, String unit) throws IOException { - try { - String template = readResource("keycloak-saml-1.4.xml"); - if (value != null) { - // assign the AllowedClockSkew element using DOM - DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - Document doc = db.parse(new InputSource(new StringReader(template))); - // create the skew element - Element allowedClockSkew = doc.createElement(Constants.XML.ALLOWED_CLOCK_SKEW); - if (unit != null) { - allowedClockSkew.setAttribute(Constants.XML.ALLOWED_CLOCK_SKEW_UNIT, unit); - } - allowedClockSkew.setTextContent(value); - // locate the IDP and insert the node - XPath xPath = XPathFactory.newInstance().newXPath(); - NodeList nodeList = (NodeList) xPath.compile("/subsystem/secure-deployment[1]/SP/IDP").evaluate(doc, XPathConstants.NODESET); - nodeList.item(0).appendChild(allowedClockSkew); - // transform again to XML - TransformerFactory tf = TransformerFactory.newInstance(); - Transformer transformer = tf.newTransformer(); - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); - StringWriter writer = new StringWriter(); - transformer.transform(new DOMSource(doc), new StreamResult(writer)); - subsystemXml = writer.getBuffer().toString(); - } else { - subsystemXml = template; - } - } catch (DOMException | ParserConfigurationException | SAXException | TransformerException | XPathExpressionException e) { - throw new IOException(e); - } - } - - private PathAddress getIdpPath() { - return PathAddress.EMPTY_ADDRESS - .append(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, KeycloakSamlExtension.SUBSYSTEM_NAME)) - .append(PathElement.pathElement(Constants.Model.SECURE_DEPLOYMENT, "my-app.war")) - .append(PathElement.pathElement(Constants.Model.SERVICE_PROVIDER, "http://localhost:8080/sales-post-enc/")) - .append(PathElement.pathElement(Constants.Model.IDENTITY_PROVIDER, "idp")); - } - - private void testSubsystem(String value, String unit, int realValue, String realUnit) throws Exception { - setSubsystemXml(value, unit); - // perform the common test - KernelServices s = super.standardSubsystemTest(null, true); - // get the values for the AllowedClockSkew parameters - ModelNode idp = ModelTestUtils.getSubModel(s.readWholeModel(), getIdpPath()); - ModelNode allowedClockSkew = idp.get(Constants.Model.ALLOWED_CLOCK_SKEW); - if (value != null) { - Assert.assertTrue(allowedClockSkew.isDefined()); - ModelNode allowedClockSkewValue = allowedClockSkew.get(Constants.Model.ALLOWED_CLOCK_SKEW_VALUE); - ModelNode allowedClockSkewUnit = allowedClockSkew.get(Constants.Model.ALLOWED_CLOCK_SKEW_UNIT); - allowedClockSkewValue = ExpressionResolver.TEST_RESOLVER.resolveExpressions(allowedClockSkewValue); - allowedClockSkewUnit = ExpressionResolver.TEST_RESOLVER.resolveExpressions(allowedClockSkewUnit); - Assert.assertEquals(realValue, allowedClockSkewValue.asInt()); - if (unit != null) { - Assert.assertEquals(realUnit, allowedClockSkewUnit.asString()); - } else { - Assert.assertFalse(allowedClockSkewUnit.isDefined()); - } - } else { - Assert.assertFalse(allowedClockSkew.isDefined()); - } - } - - private void testSubsystem(String value, String unit) throws Exception { - testSubsystem(value, unit, value == null? -1 : Integer.parseInt(value.trim()), unit); - } - - @Test - @Override - public void testSubsystem() throws Exception { - testSubsystem(null, null); - } - - @Test - public void testSubsystemAllowedClockSkewWithUnit() throws Exception { - testSubsystem("3500", "MILLISECONDS"); - } - - @Test - public void testSubsystemAllowedClockSkewWithoutUnit() throws Exception { - testSubsystem("1", null); - } - - @Test - public void testSubsystemAllowedClockSkewWithSpaces() throws Exception { - testSubsystem("\n 20 \n ", null); - } - - @Test - public void testErrorOnNonInteger() throws Exception { - exception.expect(NumberFormatException.class); - //exception.expectMessage("WFLYCTL0097"); - testSubsystem("invalid-value", null, -1, null); - } - - @Test - public void testErrorOnNonPositiveInteger() throws Exception { - exception.expect(XMLStreamException.class); - exception.expectMessage("JBAS014708"); - testSubsystem("0", null); - } - - @Test - public void testErrorNoValidUnit() throws Exception { - exception.expect(XMLStreamException.class); - exception.expectMessage("JBAS014839"); - testSubsystem("30", "invalid-unit"); - } - - @Test - public void testExpression() throws Exception { - System.setProperty("test.prop.SKEW_TIME", "30"); - System.setProperty("test.prop.SKEW_UNIT", "MILLISECONDS"); - try { - testSubsystem("${test.prop.SKEW_TIME}", "${test.prop.SKEW_UNIT}", 30, "MILLISECONDS"); - } finally { - System.clearProperty("test.prop.SKEW_TIME"); - System.clearProperty("test.prop.SKEW_UNIT"); - } - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/test/java/org/keycloak/subsystem/saml/as7/SubsystemParsingTestCase.java b/adapters/saml/as7-eap6/subsystem/src/test/java/org/keycloak/subsystem/saml/as7/SubsystemParsingTestCase.java deleted file mode 100755 index 37172c553a..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/test/java/org/keycloak/subsystem/saml/as7/SubsystemParsingTestCase.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2019 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.saml.as7; - -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.stream.XMLStreamException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; -import javax.xml.xpath.XPath; -import javax.xml.xpath.XPathConstants; -import javax.xml.xpath.XPathExpressionException; -import javax.xml.xpath.XPathFactory; - -import org.jboss.as.subsystem.test.AbstractSubsystemBaseTest; -import org.junit.Before; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - - -/** - * 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. - * - */ -public class SubsystemParsingTestCase extends AbstractSubsystemBaseTest { - - private String subsystemXml = null; - - private String subsystemTemplate = null; - - private Document document = null; - - @Rule - public final ExpectedException exception = ExpectedException.none(); - - public SubsystemParsingTestCase() { - super(KeycloakSamlExtension.SUBSYSTEM_NAME, new KeycloakSamlExtension()); - } - - @Override - protected String getSubsystemXml() throws IOException { - return this.subsystemXml; - } - - @Before - public void initialize() throws IOException { - this.subsystemTemplate = readResource("keycloak-saml-1.4.xml"); - try { - DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - this.document = builder.parse(new InputSource(new StringReader(this.subsystemTemplate))); - } catch (ParserConfigurationException | SAXException e) { - throw new IOException(e); - } - } - - private void buildSubsystemXml(final Element element, final String expression) throws IOException { - if (element != null) { - try { - // locate the element and insert the node - XPath xPath = XPathFactory.newInstance().newXPath(); - NodeList nodeList = (NodeList) xPath.compile(expression).evaluate(this.document, XPathConstants.NODESET); - nodeList.item(0).appendChild(element); - // transform again to XML - TransformerFactory tf = TransformerFactory.newInstance(); - Transformer transformer = tf.newTransformer(); - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); - StringWriter writer = new StringWriter(); - transformer.transform(new DOMSource(this.document), new StreamResult(writer)); - this.subsystemXml = writer.getBuffer().toString(); - } catch(TransformerException | XPathExpressionException e) { - throw new IOException(e); - } - } else { - this.subsystemXml = this.subsystemTemplate; - } - } - - @Override - public void testSubsystem() throws Exception { - this.buildSubsystemXml(null, null); - super.testSubsystem(); - } - - @Test - public void testDuplicateServiceProviders() throws Exception { - // create a simple service provider element. - Element spElement = this.document.createElement(Constants.XML.SERVICE_PROVIDER); - spElement.setAttribute(Constants.XML.ENTITY_ID, "duplicate-sp"); - this.buildSubsystemXml(spElement, "/subsystem/secure-deployment[1]"); - - this.exception.expect(XMLStreamException.class); - this.exception.expectMessage("JBAS014789: Unexpected element"); - super.testSubsystem(); - } - - @Test - public void testDuplicateIdentityProviders() throws Exception { - // create a duplicate identity provider element. - Element idpElement = this.document.createElement(Constants.XML.IDENTITY_PROVIDER); - idpElement.setAttribute(Constants.XML.ENTITY_ID, "test-idp"); - Element singleSignOn = this.document.createElement(Constants.XML.SINGLE_SIGN_ON); - singleSignOn.setAttribute(Constants.XML.BINDING_URL, "https://localhost:7887"); - Element singleLogout = this.document.createElement(Constants.XML.SINGLE_LOGOUT); - singleLogout.setAttribute(Constants.XML.POST_BINDING_URL, "httpsL//localhost:8998"); - idpElement.appendChild(singleSignOn); - idpElement.appendChild(singleLogout); - this.buildSubsystemXml(idpElement, "/subsystem/secure-deployment[1]/SP"); - - this.exception.expect(XMLStreamException.class); - this.exception.expectMessage("JBAS014789: Unexpected element"); - super.testSubsystem(); - } - - @Test - public void testDuplicateKeysInSP() throws Exception { - Element keysElement = this.document.createElement(Constants.XML.KEYS); - Element keyElement = this.document.createElement(Constants.XML.KEY); - keyElement.setAttribute(Constants.XML.ENCRYPTION, "false"); - keyElement.setAttribute(Constants.XML.SIGNING, "false"); - keysElement.appendChild(keyElement); - this.buildSubsystemXml(keysElement, "/subsystem/secure-deployment[1]/SP"); - - this.exception.expect(XMLStreamException.class); - this.exception.expectMessage("JBAS014789: Unexpected element"); - super.testSubsystem(); - } - - @Test - public void testDuplicateKeysInIDP() throws Exception { - Element keysElement = this.document.createElement(Constants.XML.KEYS); - Element keyElement = this.document.createElement(Constants.XML.KEY); - keyElement.setAttribute(Constants.XML.ENCRYPTION, "false"); - keyElement.setAttribute(Constants.XML.SIGNING, "false"); - keysElement.appendChild(keyElement); - this.buildSubsystemXml(keysElement, "/subsystem/secure-deployment[1]/SP/IDP"); - - this.exception.expect(XMLStreamException.class); - this.exception.expectMessage("JBAS014789: Unexpected element"); - super.testSubsystem(); - } -} diff --git a/adapters/saml/as7-eap6/subsystem/src/test/resources/org/keycloak/subsystem/saml/as7/keycloak-saml-1.4.xml b/adapters/saml/as7-eap6/subsystem/src/test/resources/org/keycloak/subsystem/saml/as7/keycloak-saml-1.4.xml deleted file mode 100755 index 65538bef32..0000000000 --- a/adapters/saml/as7-eap6/subsystem/src/test/resources/org/keycloak/subsystem/saml/as7/keycloak-saml-1.4.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - my_key.pem - my_key.pub - cert.cer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/adapters/saml/pom.xml b/adapters/saml/pom.xml index e93bbfffc4..950a0d520c 100755 --- a/adapters/saml/pom.xml +++ b/adapters/saml/pom.xml @@ -52,15 +52,5 @@ jetty - - - AS7 - - [,9) - - - as7-eap6 - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-adapter-zip/assembly.xml b/distribution/adapters/as7-eap6-adapter/as7-adapter-zip/assembly.xml deleted file mode 100755 index 1525d77ea2..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-adapter-zip/assembly.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - war-dist - - - zip - tar.gz - - false - - - - ${project.build.directory}/unpacked/modules - - com/fasterxml/jackson/** - org/bouncycastle/** - org/keycloak/keycloak-*/** - - modules - - - - - ../../shared-cli/adapter-install.cli - bin - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-adapter-zip/pom.xml b/distribution/adapters/as7-eap6-adapter/as7-adapter-zip/pom.xml deleted file mode 100755 index c0e10b4523..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-adapter-zip/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - 4.0.0 - - keycloak-parent - org.keycloak - 999-SNAPSHOT - ../../../../pom.xml - - - keycloak-as7-adapter-dist - pom - Keycloak AS7 Adapter Distro - - - - - org.keycloak - keycloak-as7-adapter - - - org.keycloak - keycloak-as7-modules - zip - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - prepare-package - - unpack - - - - - org.keycloak - keycloak-as7-modules - zip - ${project.build.directory}/unpacked - - - - - - - - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - - target - - - target/assembly/work - - false - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/assembly.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/assembly.xml deleted file mode 100755 index e392cd204f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/assembly.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - dist - - - zip - - false - - - - src/main/resources/licenses/${product.slot} - licenses - - licenses.xml - - - - ${project.build.directory}/licenses - licenses - - - ${project.build.directory}/modules - modules - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/build.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/build.xml deleted file mode 100755 index a9ad264de8..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/build.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/lib.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/lib.xml deleted file mode 100755 index 5794c22ec0..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-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/as7-eap6-adapter/as7-modules/pom.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/pom.xml deleted file mode 100755 index fc44e63849..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/pom.xml +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - 4.0.0 - - - keycloak-as7-eap6-adapter-dist-pom - org.keycloak - 999-SNAPSHOT - ../pom.xml - - - keycloak-as7-modules - - Keycloak AS7 / JBoss EAP 6 Modules - pom - - - org.keycloak - keycloak-common - - - * - * - - - - - org.keycloak - keycloak-core - - - * - * - - - - - org.keycloak - keycloak-adapter-spi - - - * - * - - - - - org.keycloak - keycloak-as7-adapter-spi - - - * - * - - - - - org.keycloak - keycloak-tomcat-adapter-spi - - - * - * - - - - - org.keycloak - keycloak-adapter-core - - - * - * - - - - - org.keycloak - keycloak-jboss-adapter-core - - - * - * - - - - - org.keycloak - keycloak-as7-adapter - - - * - * - - - - - org.keycloak - keycloak-tomcat-core-adapter - - - * - * - - - - - org.keycloak - keycloak-as7-subsystem - - - * - * - - - - - org.bouncycastle - bcprov-jdk15on - - - * - * - - - - - org.bouncycastle - bcpkix-jdk15on - - - * - * - - - - - com.fasterxml.jackson.core - jackson-core - - - * - * - - - - - com.fasterxml.jackson.core - jackson-databind - - - * - * - - - - - com.fasterxml.jackson.core - jackson-annotations - - - * - * - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - - - * - * - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-base - - - * - * - - - - - com.fasterxml.jackson.module - jackson-module-jaxb-annotations - - - * - * - - - - - - 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 - - - - - - - - org.keycloak - keycloak-distribution-licenses-maven-plugin - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-annotations,2.12.1,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-annotations,2.12.1,Apache Software License 2.0.txt deleted file mode 100644 index d645695673..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-annotations,2.12.1,Apache Software License 2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-core,2.12.1,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-core,2.12.1,Apache Software License 2.0.txt deleted file mode 100644 index d645695673..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-core,2.12.1,Apache Software License 2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-databind,2.12.1,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-databind,2.12.1,Apache Software License 2.0.txt deleted file mode 100644 index d645695673..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.core,jackson-databind,2.12.1,Apache Software License 2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.jaxrs,jackson-jaxrs-base,2.12.1,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.jaxrs,jackson-jaxrs-base,2.12.1,Apache Software License 2.0.txt deleted file mode 100644 index 6acf75483f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.jaxrs,jackson-jaxrs-base,2.12.1,Apache Software License 2.0.txt +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor databind module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivate works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.jaxrs,jackson-jaxrs-json-provider,2.12.1,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.jaxrs,jackson-jaxrs-json-provider,2.12.1,Apache Software License 2.0.txt deleted file mode 100644 index 6acf75483f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.jaxrs,jackson-jaxrs-json-provider,2.12.1,Apache Software License 2.0.txt +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor databind module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivate works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.module,jackson-module-jaxb-annotations,2.12.1,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.module,jackson-module-jaxb-annotations,2.12.1,Apache Software License 2.0.txt deleted file mode 100644 index 6acf75483f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/com.fasterxml.jackson.module,jackson-module-jaxb-annotations,2.12.1,Apache Software License 2.0.txt +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor databind module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivate works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/licenses.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/licenses.xml deleted file mode 100644 index ffb6db12c9..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/licenses.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - org.bouncycastle - bcpkix-jdk15on - 1.68 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - org.bouncycastle - bcprov-jdk15on - 1.68 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - com.fasterxml.jackson.core - jackson-annotations - 2.12.1 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-annotations/jackson-annotations-2.12.1/LICENSE - - - - - com.fasterxml.jackson.core - jackson-core - 2.12.1 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-core/jackson-core-2.12.1/LICENSE - - - - - com.fasterxml.jackson.core - jackson-databind - 2.12.1 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-databind/jackson-databind-2.12.1/LICENSE - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-base - 2.12.1 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-jaxrs-providers/jackson-jaxrs-providers-2.12.1/json/src/main/resources/META-INF/LICENSE - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - 2.12.1 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-jaxrs-providers/jackson-jaxrs-providers-2.12.1/json/src/main/resources/META-INF/LICENSE - - - - - com.fasterxml.jackson.module - jackson-module-jaxb-annotations - 2.12.1 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-jaxrs-providers/jackson-jaxrs-providers-2.12.1/json/src/main/resources/META-INF/LICENSE - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcpkix-jdk15on,1.68,MIT License.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcpkix-jdk15on,1.68,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcpkix-jdk15on,1.68,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcprov-jdk15on,1.68,MIT License.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcprov-jdk15on,1.68,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcprov-jdk15on,1.68,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-annotations,2.12.1.redhat-00001,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-annotations,2.12.1.redhat-00001,Apache Software License 2.0.txt deleted file mode 100644 index d645695673..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-annotations,2.12.1.redhat-00001,Apache Software License 2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-core,2.12.1.redhat-00001,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-core,2.12.1.redhat-00001,Apache Software License 2.0.txt deleted file mode 100644 index d645695673..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-core,2.12.1.redhat-00001,Apache Software License 2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-databind,2.12.1.redhat-00001,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-databind,2.12.1.redhat-00001,Apache Software License 2.0.txt deleted file mode 100644 index d645695673..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.core,jackson-databind,2.12.1.redhat-00001,Apache Software License 2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.jaxrs,jackson-jaxrs-base,2.12.1.redhat-00002,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.jaxrs,jackson-jaxrs-base,2.12.1.redhat-00002,Apache Software License 2.0.txt deleted file mode 100644 index 6acf75483f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.jaxrs,jackson-jaxrs-base,2.12.1.redhat-00002,Apache Software License 2.0.txt +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor databind module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivate works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.jaxrs,jackson-jaxrs-json-provider,2.12.1.redhat-00001,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.jaxrs,jackson-jaxrs-json-provider,2.12.1.redhat-00001,Apache Software License 2.0.txt deleted file mode 100644 index 6acf75483f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.jaxrs,jackson-jaxrs-json-provider,2.12.1.redhat-00001,Apache Software License 2.0.txt +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor databind module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivate works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.module,jackson-module-jaxb-annotations,2.12.1.redhat-00001,Apache Software License 2.0.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.module,jackson-module-jaxb-annotations,2.12.1.redhat-00001,Apache Software License 2.0.txt deleted file mode 100644 index 6acf75483f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/com.fasterxml.jackson.module,jackson-module-jaxb-annotations,2.12.1.redhat-00001,Apache Software License 2.0.txt +++ /dev/null @@ -1,8 +0,0 @@ -This copy of Jackson JSON processor databind module is licensed under the -Apache (Software) License, version 2.0 ("the License"). -See the License for details about distribution rights, and the -specific rights regarding derivate works. - -You may obtain a copy of the License at: - -http://www.apache.org/licenses/LICENSE-2.0 diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/licenses.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/licenses.xml deleted file mode 100644 index e831f617e6..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/licenses.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - org.bouncycastle - bcpkix-jdk15on - 1.68.0.redhat-00005 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - org.bouncycastle - bcprov-jdk15on - 1.68.0.redhat-00005 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - com.fasterxml.jackson.core - jackson-annotations - 2.12.1.redhat-00001 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-annotations/jackson-annotations-2.12.1/LICENSE - - - - - com.fasterxml.jackson.core - jackson-core - 2.12.1.redhat-00001 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-core/jackson-core-2.12.1/LICENSE - - - - - com.fasterxml.jackson.core - jackson-databind - 2.12.1.redhat-00001 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-databind/jackson-databind-2.12.1/LICENSE - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-base - 2.12.1.redhat-00002 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-jaxrs-providers/jackson-jaxrs-providers-2.12.1/json/src/main/resources/META-INF/LICENSE - - - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - 2.12.1.redhat-00001 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-jaxrs-providers/jackson-jaxrs-providers-2.12.1/json/src/main/resources/META-INF/LICENSE - - - - - com.fasterxml.jackson.module - jackson-module-jaxb-annotations - 2.12.1.redhat-00001 - - - Apache Software License 2.0 - https://raw.githubusercontent.com/FasterXML/jackson-jaxrs-providers/jackson-jaxrs-providers-2.12.1/json/src/main/resources/META-INF/LICENSE - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcpkix-jdk15on,1.68.0.redhat-00005,MIT License.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcpkix-jdk15on,1.68.0.redhat-00005,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcpkix-jdk15on,1.68.0.redhat-00005,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcprov-jdk15on,1.68.0.redhat-00005,MIT License.txt b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcprov-jdk15on,1.68.0.redhat-00005,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcprov-jdk15on,1.68.0.redhat-00005,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-annotations/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-annotations/main/module.xml deleted file mode 100644 index f6bf5c0f3b..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-annotations/main/module.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-core/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-core/main/module.xml deleted file mode 100644 index f96a3e5d34..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-core/main/module.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-databind/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-databind/main/module.xml deleted file mode 100644 index 4fd0206fed..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/core/jackson-databind/main/module.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/main/module.xml deleted file mode 100644 index 3c357f2e3c..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/com/fasterxml/jackson/jaxrs/jackson-jaxrs-json-provider/main/module.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/bouncycastle/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/bouncycastle/main/module.xml deleted file mode 100644 index ca7698f834..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/bouncycastle/main/module.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml deleted file mode 100755 index 21ea5ed0dd..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-core/main/module.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml deleted file mode 100755 index 08276eba28..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem/main/module.xml deleted file mode 100755 index 47109c0b5f..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-subsystem/main/module.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-as7-adapter/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-as7-adapter/main/module.xml deleted file mode 100755 index 2f0ca52499..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-as7-adapter/main/module.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-as7-subsystem/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-as7-subsystem/main/module.xml deleted file mode 100755 index e034dd199a..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-as7-subsystem/main/module.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-authz-client/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-authz-client/main/module.xml deleted file mode 100644 index 4f1b26f1bf..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-authz-client/main/module.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml deleted file mode 100755 index 695dc1a9ad..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml deleted file mode 100755 index 1d1be60dec..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-core/main/module.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml b/distribution/adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml deleted file mode 100755 index a779604155..0000000000 --- a/distribution/adapters/as7-eap6-adapter/as7-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/as7-eap6-adapter/eap6-adapter-zip/assembly.xml b/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml deleted file mode 100755 index 228d498901..0000000000 --- a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - war-dist - - - zip - tar.gz - - false - - - - ${project.build.directory}/unpacked/modules - - com/fasterxml/jackson/** - org/bouncycastle/** - org/keycloak/keycloak-*/** - - modules/system/add-ons/keycloak - - - ${project.build.directory}/unpacked/licenses - docs/licenses-${product.slot} - - - - - ../../shared-cli/adapter-install.cli - bin - - - diff --git a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml b/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml deleted file mode 100755 index 948d059f7e..0000000000 --- a/distribution/adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - 4.0.0 - - keycloak-as7-eap6-adapter-dist-pom - org.keycloak - 999-SNAPSHOT - ../pom.xml - - - keycloak-eap6-adapter-dist - pom - Keycloak JBoss EAP 6 Adapter Distro - - - - - org.keycloak - keycloak-as7-adapter - - - org.keycloak - keycloak-as7-modules - zip - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - prepare-package - - unpack - - - - - org.keycloak - keycloak-as7-modules - zip - ${project.build.directory}/unpacked - - - - - - - - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - - target - - - target/assembly/work - - false - - - - - - - - - - product - - - product - - - - ${product.name}-${product.filename.version}-eap6-adapter - - - - - diff --git a/distribution/adapters/as7-eap6-adapter/pom.xml b/distribution/adapters/as7-eap6-adapter/pom.xml deleted file mode 100644 index 8a1c4df2b1..0000000000 --- a/distribution/adapters/as7-eap6-adapter/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - keycloak-parent - org.keycloak - 999-SNAPSHOT - ../../../pom.xml - - Keycloak AS7 / JBoss EAP 6 Adapter Distros - - 4.0.0 - - keycloak-as7-eap6-adapter-dist-pom - pom - - - as7-modules - eap6-adapter-zip - - - - - community - - - !product - - - - as7-adapter-zip - - - - diff --git a/distribution/adapters/pom.xml b/distribution/adapters/pom.xml index ffc9be7bb1..7e9ce3e5f4 100755 --- a/distribution/adapters/pom.xml +++ b/distribution/adapters/pom.xml @@ -53,14 +53,5 @@ js-adapter-npm-zip - - AS7 - - (,9] - - - as7-eap6-adapter - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-adapter-zip/assembly.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-adapter-zip/assembly.xml deleted file mode 100755 index 4756c8ffb8..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-adapter-zip/assembly.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - war-dist - - - zip - tar.gz - - false - - - - ${project.build.directory}/unpacked/modules - - org/bouncycastle/** - org/keycloak/keycloak-*/** - - modules - - - - - ../../shared-cli/adapter-install-saml.cli - bin - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-adapter-zip/pom.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-adapter-zip/pom.xml deleted file mode 100755 index 34aea630cf..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-adapter-zip/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - 4.0.0 - - keycloak-parent - org.keycloak - 999-SNAPSHOT - ../../../../pom.xml - - - keycloak-saml-as7-adapter-dist - pom - Keycloak SAML AS7 Adapter Distro - - - - - org.keycloak - keycloak-saml-as7-adapter - - - org.keycloak - keycloak-saml-as7-modules - zip - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - prepare-package - - unpack - - - - - org.keycloak - keycloak-saml-as7-modules - zip - ${project.build.directory}/unpacked - - - - - - - - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - - target - - - target/assembly/work - - false - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/assembly.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/assembly.xml deleted file mode 100755 index e392cd204f..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/assembly.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - dist - - - zip - - false - - - - src/main/resources/licenses/${product.slot} - licenses - - licenses.xml - - - - ${project.build.directory}/licenses - licenses - - - ${project.build.directory}/modules - modules - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/build.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/build.xml deleted file mode 100755 index 50306e25c0..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/build.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/lib.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/lib.xml deleted file mode 100755 index 5794c22ec0..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-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/saml-adapters/as7-eap6-adapter/as7-modules/pom.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/pom.xml deleted file mode 100755 index cbbd2756db..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/pom.xml +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - 4.0.0 - - - keycloak-saml-as7-eap6-adapter-dist-pom - org.keycloak - 999-SNAPSHOT - ../pom.xml - - - keycloak-saml-as7-modules - - Keycloak SAML AS7 / JBoss EAP 6 Modules - pom - - - org.keycloak - keycloak-common - - - * - * - - - - - org.keycloak - keycloak-saml-core-public - - - * - * - - - - - org.keycloak - keycloak-adapter-spi - - - * - * - - - - - org.keycloak - keycloak-as7-adapter-spi - - - * - * - - - - - org.keycloak - keycloak-saml-core - - - * - * - - - - - org.keycloak - keycloak-saml-adapter-core - - - * - * - - - - - org.keycloak - keycloak-saml-tomcat-adapter-core - - - * - * - - - - - org.keycloak - keycloak-saml-adapter-api-public - - - * - * - - - - - org.keycloak - keycloak-jboss-adapter-core - - - * - * - - - - - org.keycloak - keycloak-saml-as7-adapter - - - * - * - - - - - org.keycloak - keycloak-saml-as7-subsystem - - - * - * - - - - - org.keycloak - keycloak-tomcat-adapter-spi - - - * - * - - - - - org.bouncycastle - bcprov-jdk15on - - - * - * - - - - - org.bouncycastle - bcpkix-jdk15on - - - * - * - - - - - - - - - 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-saml-adapter-subsystem - - - src/main/resources/modules/org/keycloak/keycloak-saml-adapter-subsystem - true - - - - - - - - org.keycloak - keycloak-distribution-licenses-maven-plugin - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/licenses.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/licenses.xml deleted file mode 100644 index 1bf0b45a65..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/licenses.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - org.bouncycastle - bcpkix-jdk15on - 1.68 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - org.bouncycastle - bcprov-jdk15on - 1.68 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcpkix-jdk15on,1.68,MIT License.txt b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcpkix-jdk15on,1.68,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcpkix-jdk15on,1.68,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcprov-jdk15on,1.68,MIT License.txt b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcprov-jdk15on,1.68,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/keycloak/org.bouncycastle,bcprov-jdk15on,1.68,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/licenses.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/licenses.xml deleted file mode 100644 index b3d39b6891..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/licenses.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - org.bouncycastle - bcpkix-jdk15on - 1.68.0.redhat-00005 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - org.bouncycastle - bcprov-jdk15on - 1.68.0.redhat-00005 - - - MIT License - https://raw.githubusercontent.com/bcgit/bc-java/r1rv68/LICENSE.html - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcpkix-jdk15on,1.68.0.redhat-00005,MIT License.txt b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcpkix-jdk15on,1.68.0.redhat-00005,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcpkix-jdk15on,1.68.0.redhat-00005,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcprov-jdk15on,1.68.0.redhat-00005,MIT License.txt b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcprov-jdk15on,1.68.0.redhat-00005,MIT License.txt deleted file mode 100644 index f536bb1f0a..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/licenses/rh-sso/org.bouncycastle,bcprov-jdk15on,1.68.0.redhat-00005,MIT License.txt +++ /dev/null @@ -1,22 +0,0 @@ - - - -Copyright (c) 2000-2021 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org) -

-Permission is hereby granted, free of charge, to any person obtaining a copy of this software -and associated documentation files (the "Software"), to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: -

-The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. -

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/bouncycastle/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/bouncycastle/main/module.xml deleted file mode 100755 index ca7698f834..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/bouncycastle/main/module.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml deleted file mode 100755 index 08276eba28..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-adapter-spi/main/module.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml deleted file mode 100755 index 695dc1a9ad..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-common/main/module.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml deleted file mode 100755 index f04205bf01..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-jboss-adapter-core/main/module.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-api-public/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-api-public/main/module.xml deleted file mode 100755 index 1438ed9869..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-api-public/main/module.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-core/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-core/main/module.xml deleted file mode 100755 index ba66c82775..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-core/main/module.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-subsystem/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-subsystem/main/module.xml deleted file mode 100755 index fa4feb2a70..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-adapter-subsystem/main/module.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-as7-adapter/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-as7-adapter/main/module.xml deleted file mode 100755 index 885470fb2e..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-as7-adapter/main/module.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-as7-subsystem/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-as7-subsystem/main/module.xml deleted file mode 100755 index 9d1a63ea47..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-as7-subsystem/main/module.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core-public/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core-public/main/module.xml deleted file mode 100755 index 35977c71b7..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core-public/main/module.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core/main/module.xml b/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core/main/module.xml deleted file mode 100755 index 01eacdceb0..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/as7-modules/src/main/resources/modules/org/keycloak/keycloak-saml-core/main/module.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml b/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml deleted file mode 100755 index b3d48610ec..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/assembly.xml +++ /dev/null @@ -1,47 +0,0 @@ - - - - war-dist - - - zip - tar.gz - - false - - - - ${project.build.directory}/unpacked/modules - - org/bouncycastle/** - org/keycloak/keycloak-*/** - - modules/system/add-ons/keycloak - - - ${project.build.directory}/unpacked/licenses - docs/licenses-${product.slot} - - - - - ../../shared-cli/adapter-install-saml.cli - bin - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml b/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml deleted file mode 100755 index ff9c9f02ba..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/eap6-adapter-zip/pom.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - 4.0.0 - - keycloak-saml-as7-eap6-adapter-dist-pom - org.keycloak - 999-SNAPSHOT - ../pom.xml - - - keycloak-saml-eap6-adapter-dist - pom - Keycloak SAML JBoss EAP 6 Adapter Distro - - - - - org.keycloak - keycloak-as7-adapter - - - org.keycloak - keycloak-as7-modules - zip - - - org.keycloak - keycloak-saml-as7-modules - ${project.version} - zip - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack - prepare-package - - unpack - - - - - org.keycloak - keycloak-saml-as7-modules - zip - ${project.build.directory}/unpacked - - - - - - - - maven-assembly-plugin - - - assemble - package - - single - - - - assembly.xml - - - target - - - target/assembly/work - - false - - - - - - - - - - product - - - product - - - - ${product.name}-${product.filename.version}-saml-eap6-adapter - - - - - diff --git a/distribution/saml-adapters/as7-eap6-adapter/pom.xml b/distribution/saml-adapters/as7-eap6-adapter/pom.xml deleted file mode 100755 index 0df36029ec..0000000000 --- a/distribution/saml-adapters/as7-eap6-adapter/pom.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - keycloak-parent - org.keycloak - 999-SNAPSHOT - ../../../pom.xml - - Keycloak SAML AS7 / JBoss EAP 6 Adapter Distros - - 4.0.0 - - keycloak-saml-as7-eap6-adapter-dist-pom - pom - - - as7-modules - eap6-adapter-zip - - - - - community - - - !product - - - - as7-adapter-zip - - - - diff --git a/distribution/saml-adapters/pom.xml b/distribution/saml-adapters/pom.xml index c1229b1fc8..6eaef173a1 100755 --- a/distribution/saml-adapters/pom.xml +++ b/distribution/saml-adapters/pom.xml @@ -49,15 +49,6 @@ tomcat-adapter-zip - - AS7 - - (,9] - - - as7-eap6-adapter - - diff --git a/pom.xml b/pom.xml index cfb8063ede..8381c287e1 100644 --- a/pom.xml +++ b/pom.xml @@ -1529,12 +1529,6 @@ ${project.version} zip - - org.keycloak - keycloak-eap6-adapter-dist - ${project.version} - zip - org.keycloak keycloak-server-feature-pack @@ -1577,12 +1571,6 @@ ${project.version} zip - - org.keycloak - keycloak-saml-eap6-adapter-dist - ${project.version} - zip - org.keycloak keycloak-testsuite-utils diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/pom.xml deleted file mode 100644 index 00b3e56996..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/pom.xml +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-jboss - 999-SNAPSHOT - - 4.0.0 - - integration-arquillian-servers-app-server-eap6 - jar - App Server - EAP 6 - - - eap6 - - org.jboss.as - jboss-as-dist - ${eap6.version} - jboss-eap-6.4 - - com.redhat.fuse.eap - fuse-eap-installer - ${fuse63.version} - - keycloak-eap6-adapter-dist - keycloak-saml-eap6-adapter-dist - - true - true - - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-spi - ${project.version} - - - org.wildfly.arquillian - wildfly-arquillian-container-managed - - - org.keycloak.testsuite - integration-arquillian-util - ${project.version} - - - org.keycloak - keycloak-eap6-adapter-dist - ${project.version} - zip - - - org.keycloak - keycloak-saml-eap6-adapter-dist - ${project.version} - zip - - - - - - - org.codehaus.mojo - exec-maven-plugin - - - install-adapters-online-standalone - process-resources - - exec - - - ${basedir}/src/main/resources/config/install-adapters-online.${script.suffix} - ${app.server.jboss.home}/bin - - ${app.server.java.home} - ${app.server.jboss.home} - ${app.server.saml.adapter.supported} - ${basedir}/src/main/resources/config/cli/ - - - - - install-adapters-online-standalone-ha - process-resources - - exec - - - ${basedir}/src/main/resources/config/install-adapters-online-ha.${script.suffix} - ${app.server.jboss.home}/bin - - ${app.server.java.home} - ${app.server.jboss.home} - ${basedir}/src/main/resources/config/cli/ - - - - - add-secured-deployments-eap6 - generate-test-sources - - exec - - - ${basedir}/src/main/resources/config/add-secured-deployments.${script.suffix} - ${app.server.jboss.home}/bin - - ${app.server.java.home} - ${app.server.jboss.home} - ${basedir}/src/main/resources/config/cli/ - - - - - - - - - - - fuse-installer - - - unix - - - - - - maven-enforcer-plugin - - - enforce-fuse63-version - - enforce - - - - - fuse63.version - - - - - - - - maven-resources-plugin - - - backup-configs-fuse - generate-test-sources - - copy-resources - - - ${app.server.jboss.home}/standalone-default - - - ${app.server.jboss.home}/standalone - - - - - - copy-hawtio-jsons - generate-test-resources - - copy-resources - - - ${app.server.jboss.home}/standalone-fuse/configuration - - - ${basedir}/src/main/resources/config/fuse - - keycloak-hawtio.json - keycloak-hawtio-client.json - - true - - - - - - - - maven-dependency-plugin - - - unpack-fuse-installer - process-resources - - copy - - - - - ${fuse.installer.groupId} - ${fuse.installer.artifactId} - ${fuse.installer.version} - jar - ${app.server.jboss.home} - - - - - - - - org.codehaus.mojo - exec-maven-plugin - - - install-fuse - generate-test-sources - - exec - - - ${basedir}/src/main/resources/config/fuse/install-fuse.${script.suffix} - ${app.server.jboss.home}/standalone-fuse - - ${app.server.java.home} - ${app.server.jboss.home} - ${fuse.installer.artifactId}-${fuse.installer.version}.jar - - - - - - - org.codehaus.mojo - xml-maven-plugin - - - add-hawtio-to-standalone-fuse - process-test-resources - - transform - - - - -

${app.server.jboss.home}/standalone-fuse/configuration - - standalone.xml - - ${basedir}/src/main/resources/config/fuse/add-hawtio.xsl - ${app.server.jboss.home}/standalone-fuse/configuration - - - - - - - - maven-antrun-plugin - - - move-configs-fuse - process-test-sources - - run - - - - - - - - - - restore-configs-after-fuse-installation - process-test-sources - - run - - - - - - - - - - - - - - - diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/EAP6AppServerArquillianExtension.java b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/EAP6AppServerArquillianExtension.java deleted file mode 100644 index 659d998c2f..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/EAP6AppServerArquillianExtension.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2018 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.testsuite.arquillian.eap; - -import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; -import org.jboss.arquillian.core.spi.LoadableExtension; -import org.keycloak.testsuite.arquillian.eap.container.EAP6DeploymentArchiveProcessor; - -/** - * - * @author Vlasta Ramik - */ -public class EAP6AppServerArquillianExtension implements LoadableExtension { - - @Override - public void register(ExtensionBuilder builder) { - builder.service(ApplicationArchiveProcessor.class, EAP6DeploymentArchiveProcessor.class); - } - -} diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAP6AppServerProvider.java b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAP6AppServerProvider.java deleted file mode 100644 index b90722c51e..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAP6AppServerProvider.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright 2018 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.testsuite.arquillian.eap.container; - -import java.util.ArrayList; -import java.util.List; -import org.jboss.arquillian.core.spi.Validate; -import org.jboss.as.arquillian.container.managed.ManagedDeployableContainer; -import org.jboss.shrinkwrap.descriptor.spi.node.Node; -import org.keycloak.testsuite.arquillian.container.AppServerContainerProvider; - -/** - * @author Vlasta Ramik - */ -public class EAP6AppServerProvider implements AppServerContainerProvider { - - private Node configuration; - private static final String containerName = "eap6"; - - private final String appServerHome; - private final String appServerJavaHome; - private final String appServerPortOffset; - private final String managementProtocol; - private final String managementPort; - private final String startupTimeoutInSeconds; - - public EAP6AppServerProvider() { - appServerHome = System.getProperty("app.server.home"); - appServerJavaHome = System.getProperty("app.server.java.home"); - appServerPortOffset = System.getProperty("app.server.port.offset"); - managementProtocol = System.getProperty("app.server.management.protocol"); - managementPort = System.getProperty("app.server.management.port"); - startupTimeoutInSeconds = System.getProperty("app.server.startup.timeout"); - - Validate.notNullOrEmpty(appServerHome, "app.server.home is not set."); - Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set."); - Validate.notNullOrEmpty(appServerPortOffset, "app.server.port.offset is not set."); - Validate.notNullOrEmpty(managementProtocol, "app.server.management.protocol is not set."); - Validate.notNullOrEmpty(managementPort, "app.server.management.port is not set."); - Validate.notNullOrEmpty(startupTimeoutInSeconds, "app.server.startup.timeout is not set."); - } - - @Override - public String getName() { - return containerName; - } - - @Override - public List getContainers() { - List containers = new ArrayList<>(); - - containers.add(standaloneContainer()); - containers.add(clusterGroup()); - - return containers; - } - - private void createChild(String name, String text) { - configuration.createChild("property").attribute("name", name).text(text); - } - - private Node standaloneContainer() { - Node container = new Node("container"); - container.attribute("mode", "manual"); - container.attribute("qualifier", AppServerContainerProvider.APP_SERVER + "-" + containerName); - - configuration = container.createChild("configuration"); - createChild("enabled", "true"); - createChild("adapterImplClass", ManagedDeployableContainer.class.getName()); - createChild("jbossHome", appServerHome); - createChild("javaHome", appServerJavaHome); - createChild("jbossArguments", - "-Djboss.server.base.dir=" + appServerHome + "/standalone-test " + - "-Djboss.server.config.dir=" + appServerHome + "/standalone-test/configuration " + - "-Djboss.server.log.dir=" + appServerHome + "/standalone-test/log " + - "-Djboss.socket.binding.port-offset=" + appServerPortOffset + " " + - System.getProperty("adapter.test.props", " ") + - System.getProperty("kie.maven.settings", " ") - ); - createChild("javaVmArguments", - System.getProperty("app.server.jboss.jvm.debug.args", "") + " " + - System.getProperty("app.server.memory.settings", "") + " " + - "-Djava.net.preferIPv4Stack=true" - ); - createChild("managementProtocol", managementProtocol); - createChild("managementPort", managementPort); - createChild("startupTimeoutInSeconds", startupTimeoutInSeconds); - - return container; - } - - private Node clusterGroup() { - Node group = new Node("group"); - group.attribute("qualifier", "app-server-eap-clustered"); - addHaNodeContainer(group, 1); - addHaNodeContainer(group, 2); - return group; - } - - private void addHaNodeContainer(Node group, int number) { - String portOffset = System.getProperty("app.server." + number + ".port.offset"); - String managementPort = System.getProperty("app.server." + number + ".management.port"); - - Validate.notNullOrEmpty(portOffset, "app.server." + number + ".port.offset is not set."); - Validate.notNullOrEmpty(managementPort, "app.server." + number + ".management.port is not set."); - - Node container = group.createChild("container"); - container.attribute("mode", "manual"); - container.attribute("qualifier", AppServerContainerProvider.APP_SERVER + "-" + containerName + "-ha-node-" + number); - - configuration = container.createChild("configuration"); - createChild("enabled", "true"); - createChild("adapterImplClass", ManagedDeployableContainer.class.getName()); - createChild("jbossHome", appServerHome); - createChild("javaHome", appServerJavaHome); - //cleanServerBaseDir cannot be used until WFARQ-44 is fixed -// createChild("cleanServerBaseDir", appServerHome + "/standalone-ha-node-" + number); - createChild("serverConfig", "standalone-ha.xml"); - createChild("jbossArguments", - "-Djboss.server.base.dir=" + appServerHome + "/standalone-ha-node-" + number + " " + - "-Djboss.server.config.dir=" + appServerHome + "/standalone-ha-node-" + number + "/configuration " + - "-Djboss.socket.binding.port-offset=" + portOffset + " " + - "-Djboss.node.name=ha-node-" + number + " " + - System.getProperty("adapter.test.props", " ") + " " + - System.getProperty("kie.maven.settings", " ") - ); - createChild("javaVmArguments", - System.getProperty("app.server." + number + ".jboss.jvm.debug.args") + " " + - System.getProperty("app.server.memory.settings", "") + " " + - "-Djava.net.preferIPv4Stack=true" - ); - createChild("managementProtocol", managementProtocol); - createChild("managementPort", managementPort); - createChild("startupTimeoutInSeconds", startupTimeoutInSeconds); - } -} diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAP6DeploymentArchiveProcessor.java b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAP6DeploymentArchiveProcessor.java deleted file mode 100644 index 68fd86bbe9..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/java/org/keycloak/testsuite/arquillian/eap/container/EAP6DeploymentArchiveProcessor.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2018 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.testsuite.arquillian.eap.container; - -import org.jboss.arquillian.container.test.spi.client.deployment.ApplicationArchiveProcessor; -import org.jboss.arquillian.test.spi.TestClass; -import org.jboss.logging.Logger; -import org.jboss.shrinkwrap.api.Archive; -import org.jboss.shrinkwrap.api.asset.StringAsset; -import org.keycloak.testsuite.utils.annotation.UseServletFilter; -import org.keycloak.testsuite.utils.arquillian.DeploymentArchiveProcessorUtils; -import static org.keycloak.testsuite.utils.arquillian.DeploymentArchiveProcessorUtils.WEBXML_PATH; -import org.keycloak.testsuite.utils.io.IOUtil; -import org.w3c.dom.Document; - -/** - * - * @author Vlasta Ramik - */ -public class EAP6DeploymentArchiveProcessor implements ApplicationArchiveProcessor { - - private final Logger log = Logger.getLogger(EAP6DeploymentArchiveProcessor.class); - - @Override - public void process(Archive archive, TestClass testClass) { - if (DeploymentArchiveProcessorUtils.checkRunOnServerDeployment(archive)) return; - - modifyWebXML(archive, testClass); - - modifyOIDCAdapterConfig(archive, DeploymentArchiveProcessorUtils.ADAPTER_CONFIG_PATH); - modifyOIDCAdapterConfig(archive, DeploymentArchiveProcessorUtils.ADAPTER_CONFIG_PATH_JS); - - modifySAMLAdapterConfig(archive, DeploymentArchiveProcessorUtils.SAML_ADAPTER_CONFIG_PATH); - modifySAMLAdapterConfig(archive, DeploymentArchiveProcessorUtils.SAML_ADAPTER_CONFIG_PATH_TENANT1); - modifySAMLAdapterConfig(archive, DeploymentArchiveProcessorUtils.SAML_ADAPTER_CONFIG_PATH_TENANT2); - } - - private void modifyWebXML(Archive archive, TestClass testClass) { - if (!archive.contains(DeploymentArchiveProcessorUtils.WEBXML_PATH)) return; - if (testClass.getJavaClass().isAnnotationPresent(UseServletFilter.class) && - archive.contains(DeploymentArchiveProcessorUtils.JBOSS_DEPLOYMENT_XML_PATH)) { - log.debug("Modifying WEB.XML in " + archive.getName() + " for Servlet Filter."); - DeploymentArchiveProcessorUtils.modifyWebXMLForServletFilter(archive, testClass); - DeploymentArchiveProcessorUtils.addFilterDependencies(archive, testClass); - } - - try { - Document webXmlDoc = IOUtil.loadXML(archive.get(DeploymentArchiveProcessorUtils.WEBXML_PATH).getAsset().openStream()); - - IOUtil.modifyDocElementValue(webXmlDoc, "param-value", ".*infinispan\\.InfinispanSessionCacheIdMapperUpdater", - "org.keycloak.adapters.saml.jbossweb.infinispan.InfinispanSessionCacheIdMapperUpdater"); - - archive.add(new StringAsset((IOUtil.documentToString(webXmlDoc))), WEBXML_PATH); - } catch (IllegalArgumentException ex) { - throw new RuntimeException("Error when processing " + archive.getName(), ex); - } - } - - private void modifyOIDCAdapterConfig(Archive archive, String adapterConfigPath) { - if (!archive.contains(adapterConfigPath)) return; - - log.debug("Modifying adapter config " + adapterConfigPath + " in " + archive.getName()); - - DeploymentArchiveProcessorUtils.modifyOIDCAdapterConfig(archive, adapterConfigPath); - } - - private void modifySAMLAdapterConfig(Archive archive, String adapterConfigPath) { - if (!archive.contains(adapterConfigPath)) return; - - log.debug("Modifying adapter config " + adapterConfigPath + " in " + archive.getName()); - DeploymentArchiveProcessorUtils.modifySAMLAdapterConfig(archive, adapterConfigPath); - } -} diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension deleted file mode 100644 index 15abe93bf1..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/META-INF/services/org.jboss.arquillian.core.spi.LoadableExtension +++ /dev/null @@ -1 +0,0 @@ -org.keycloak.testsuite.arquillian.eap.EAP6AppServerArquillianExtension diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider deleted file mode 100644 index 06a8f0f31f..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/META-INF/services/org.keycloak.testsuite.arquillian.container.AppServerContainerProvider +++ /dev/null @@ -1 +0,0 @@ -org.keycloak.testsuite.arquillian.eap.container.EAP6AppServerProvider diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/add-secured-deployments.bat b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/add-secured-deployments.bat deleted file mode 100644 index 025e017ca1..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/add-secured-deployments.bat +++ /dev/null @@ -1,35 +0,0 @@ -set NOPAUSE=true - -start "JBoss Server" /b cmd /c %JBOSS_HOME%\bin\standalone.bat -Djboss.server.config.dir=%JBOSS_HOME%\standalone-secured-deployments\configuration - -set ERROR=0 -set TIMEOUT=10 -set I=0 - -ping 127.0.0.1 -n 3 > nul - - -:wait_for_jboss -call %JBOSS_HOME%\bin\jboss-cli.bat -c --command=":read-attribute(name=server-state)" | findstr "running" -if %ERRORLEVEL% equ 0 goto add_secured_deployments -ping 127.0.0.1 -n 1 > nul -set /a I=%I%+1 -if %I% gtr %TIMEOUT% ( - set ERROR=1 - goto shutdown_jboss -) -goto wait_for_jboss - - -:add_secured_deployments -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%CLI_PATH%\add-secured-deployments.cli" -set ERROR=%ERRORLEVEL% -echo Error code: "%ERROR%" -if %ERROR% neq 0 ( - goto shutdown_jboss -) - -:shutdown_jboss -echo Shutting down with error code: "%ERROR%" -call %JBOSS_HOME%\bin\jboss-cli.bat -c --command=":shutdown" -exit /b %ERROR% diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/add-secured-deployments.sh b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/add-secured-deployments.sh deleted file mode 100755 index a2a3abb582..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/add-secured-deployments.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -echo "JBOSS_HOME=$JBOSS_HOME" - -if [ ! -d "$JBOSS_HOME/bin" ] ; then - >&2 echo "JBOSS_HOME/bin doesn't exist" - exit 1 -fi - -cd $JBOSS_HOME/bin - -./standalone.sh -Djboss.server.config.dir=$JBOSS_HOME/standalone-secured-deployments/configuration & -sleep 3 - -TIMEOUT=10 -DELAY=1 -T=0 - -RESULT=0 - -until [ $T -gt $TIMEOUT ] -do - if ./jboss-cli.sh -c --command=":read-attribute(name=server-state)" | grep -q "running" ; then - echo "Server is running. Adding secured deployments" - - ./jboss-cli.sh -c --file="$CLI_PATH/add-secured-deployments.cli" - RESULT=$? - echo "Return code:"${RESULT} - - ./jboss-cli.sh -c --command=":shutdown" - rm -rf $JBOSS_HOME/standalone/data - rm -rf $JBOSS_HOME/standalone/log - - echo "Exiting with return code: "$RESULT - exit $RESULT - fi - echo "Server is not running." - sleep $DELAY - let T=$T+$DELAY -done - -exit 1 diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/add-adapter-log-level.cli b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/add-adapter-log-level.cli deleted file mode 100644 index 2e8b0d729a..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/add-adapter-log-level.cli +++ /dev/null @@ -1,2 +0,0 @@ -/subsystem=logging/logger=org.keycloak.adapters:add(level=DEBUG) -/subsystem=logging/console-handler=CONSOLE:change-log-level(level=DEBUG) diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/add-secured-deployments.cli b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/add-secured-deployments.cli deleted file mode 100644 index 167afedd4c..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/add-secured-deployments.cli +++ /dev/null @@ -1,19 +0,0 @@ -/subsystem=keycloak/secure-deployment=customer-portal-subsystem.war/:add( \ - realm=demo, \ - resource=customer-portal-subsystem, \ - auth-server-url=${auth.server.actual.protocol:https}://${auth.server.host:localhost}:${auth.server.actual.http.port:8543}/auth, \ - ssl-required=EXTERNAL, \ - disable-trust-manager=true, \ - realm-public-key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB \ -) -/subsystem=keycloak/secure-deployment=customer-portal-subsystem.war/credential=secret/:add(value=password) - -/subsystem=keycloak/secure-deployment=product-portal-subsystem.war/:add( \ - realm=demo, \ - resource=product-portal-subsystem, \ - auth-server-url=${auth.server.actual.protocol:https}://${auth.server.host:localhost}:${auth.server.actual.https.port:8543}/auth, \ - ssl-required=EXTERNAL, \ - disable-trust-manager=true, \ - realm-public-key=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCrVrCuTtArbgaZzL1hvh0xtL5mc7o0NqPVnYXkLvgcwiC3BjLGw1tGEGoJaXDuSaRllobm53JBhjx33UNv+5z/UMG4kytBWxheNVKnL6GgqlNabMaFfPLPCF8kAgKnsi79NMo+n6KnSY8YeUmec/p2vjO2NjsSAVcWEQMVhJ31LwIDAQAB \ -) -/subsystem=keycloak/secure-deployment=product-portal-subsystem.war/credential=secret/:add(value=password) diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/configure-cluster-config.cli b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/configure-cluster-config.cli deleted file mode 100644 index 61b75f0b64..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/cli/configure-cluster-config.cli +++ /dev/null @@ -1,21 +0,0 @@ -batch -/subsystem=jgroups/stack=tcpping:add -/subsystem=jgroups/stack=tcpping/transport=TRANSPORT:add(type=TCP,socket-binding=jgroups-tcp) -/subsystem=jgroups/stack=tcpping:add-protocol(type=TCPPING) -/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=initial_hosts/:add(value=${initial.hosts:localhost[7900],localhost[8000]}) -/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=port_range:add(value=0) -/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=num_initial_members:add(value=2) -/subsystem=jgroups/stack=tcpping/protocol=TCPPING/property=timeout:add(value=3000) -/subsystem=jgroups/stack=tcpping:add-protocol(type=MERGE2) -/subsystem=jgroups/stack=tcpping:add-protocol(type=FD_SOCK,socket-binding=jgroups-udp-fd) -/subsystem=jgroups/stack=tcpping:add-protocol(type=FD) -/subsystem=jgroups/stack=tcpping:add-protocol(type=VERIFY_SUSPECT) -/subsystem=jgroups/stack=tcpping:add-protocol(type=pbcast.NAKACK) -/subsystem=jgroups/stack=tcpping:add-protocol(type=UNICAST2) -/subsystem=jgroups/stack=tcpping:add-protocol(type=pbcast.STABLE) -/subsystem=jgroups/stack=tcpping:add-protocol(type=pbcast.GMS) -/subsystem=jgroups/stack=tcpping:add-protocol(type=UFC) -/subsystem=jgroups/stack=tcpping:add-protocol(type=MFC) -/subsystem=jgroups/stack=tcpping:add-protocol(type=FRAG2) -/subsystem=jgroups/stack=tcpping:add-protocol(type=RSVP) -run-batch \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/add-hawtio.xsl b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/add-hawtio.xsl deleted file mode 100644 index 756aebe242..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/add-hawtio.xsl +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/install-fuse.sh b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/install-fuse.sh deleted file mode 100755 index 7c728396e2..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/install-fuse.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -echo "FUSE_INSTALLER=$JBOSS_HOME/$FUSE_INSTALLER_NAME" -if [ ! -f "$JBOSS_HOME/$FUSE_INSTALLER_NAME" ] ; then - >&2 echo "JBOSS_HOME/$FUSE_INSTALLER_NAME doesn't exist" - exit 1 -fi - -cd $JBOSS_HOME -java -jar $FUSE_INSTALLER_NAME -rm $FUSE_INSTALLER_NAME - -mv standalone/deployments/hawtio*.war standalone/deployments/hawtio.war - -exit 0 \ No newline at end of file diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/keycloak-hawtio-client.json b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/keycloak-hawtio-client.json deleted file mode 100644 index ca2cdbeba5..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/keycloak-hawtio-client.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "realm" : "demo", - "resource" : "hawtio-client", - "auth-server-url" : "https://localhost:8543/auth", - "ssl-required" : "external", - "public-client" : true, - "truststore" : "${jboss.home.dir}/standalone/configuration/keycloak.truststore", - "truststore-password" : "secret" -} diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/keycloak-hawtio.json b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/keycloak-hawtio.json deleted file mode 100644 index 0b3d0e3ba8..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/fuse/keycloak-hawtio.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "realm" : "demo", - "resource" : "jaas", - "bearer-only" : true, - "auth-server-url" : "https://localhost:8543/auth", - "ssl-required" : "external", - "use-resource-role-mappings": false, - "principal-attribute": "preferred_username", - "truststore" : "${jboss.home.dir}/standalone/configuration/keycloak.truststore", - "truststore-password" : "secret" -} diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online-ha.bat b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online-ha.bat deleted file mode 100644 index a2bd4b4bb8..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online-ha.bat +++ /dev/null @@ -1,57 +0,0 @@ -set NOPAUSE=true - -start "JBoss Server" /b cmd /c %JBOSS_HOME%\bin\standalone.bat --server-config=standalone-ha.xml - -set ERROR=0 -set TIMEOUT=10 -set I=0 - -ping 127.0.0.1 -n 3 > nul - - -:wait_for_jboss -call %JBOSS_HOME%\bin\jboss-cli.bat -c --command=":read-attribute(name=server-state)" | findstr "running" -if %ERRORLEVEL% equ 0 goto install_adapters -ping 127.0.0.1 -n 1 > nul -set /a I=%I%+1 -if %I% gtr %TIMEOUT% ( - set ERROR=1 - goto shutdown_jboss -) -goto wait_for_jboss - - -:install_adapters -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%JBOSS_HOME%\bin\adapter-install.cli" -set ERROR=%ERRORLEVEL% -echo Installation of OIDC adapter ended with error code: "%ERROR%" -if %ERROR% neq 0 ( - goto shutdown_jboss -) - -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%JBOSS_HOME%\bin\adapter-install-saml.cli" -set ERROR=%ERRORLEVEL% -echo Installation of SAML adapter ended with error code: "%ERROR%" -if %ERROR% neq 0 ( - goto shutdown_jboss -) - - -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%CLI_PATH%\add-adapter-log-level.cli" -set ERROR=%ERRORLEVEL% -echo Adding log level for adapters ended with error code: "%ERROR%" -if %ERROR% neq 0 ( - goto shutdown_jboss -) - -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%CLI_PATH%\configure-cluster-config.cli" -set ERROR=%ERRORLEVEL% -echo Configuring cluster config ended with error code: "%ERROR%" -if %ERROR% neq 0 ( - goto shutdown_jboss -) - -:shutdown_jboss -echo Shutting down with error code: "%ERROR%" -call %JBOSS_HOME%\bin\jboss-cli.bat -c --command=":shutdown" -exit /b %ERROR% diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online-ha.sh b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online-ha.sh deleted file mode 100755 index 05570d1c67..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online-ha.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -echo "JBOSS_HOME=$JBOSS_HOME" - -if [ ! -d "$JBOSS_HOME/bin" ] ; then - >&2 echo "JBOSS_HOME/bin doesn't exist" - exit 1 -fi - -cd $JBOSS_HOME/bin - -./standalone.sh --server-config=standalone-ha.xml & -sleep 3 - -TIMEOUT=10 -DELAY=1 -T=0 - -RESULT=0 - -until [ $T -gt $TIMEOUT ] -do - if ./jboss-cli.sh -c --command=":read-attribute(name=server-state)" | grep -q "running" ; then - echo "Server is running. Installing adapter." - - ./jboss-cli.sh -c --file="adapter-install.cli" - RESULT=$? - echo "Return code of adapter-install:"${RESULT} - - ./jboss-cli.sh -c --file="adapter-install-saml.cli" - RESULT=$? - echo "Return code of saml adapter-install:"$RESULT - - ./jboss-cli.sh -c --file="$CLI_PATH/add-adapter-log-level.cli" - ./jboss-cli.sh -c --file="$CLI_PATH/configure-cluster-config.cli" - RESULT=$? - echo "Return code:"${RESULT} - - ./jboss-cli.sh -c --command=":shutdown" - rm -rf $JBOSS_HOME/standalone/data - rm -rf $JBOSS_HOME/standalone/log - - echo "Exiting with return code: "$RESULT - exit $RESULT - fi - echo "Server is not running." - sleep $DELAY - let T=$T+$DELAY -done - -exit 1 diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online.bat b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online.bat deleted file mode 100644 index f692b9dc6e..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online.bat +++ /dev/null @@ -1,46 +0,0 @@ -set NOPAUSE=true - -start "JBoss Server" /b cmd /c %JBOSS_HOME%\bin\standalone.bat - -set ERROR=0 -set TIMEOUT=10 -set I=0 - -ping 127.0.0.1 -n 3 > nul - - -:wait_for_jboss -call %JBOSS_HOME%\bin\jboss-cli.bat -c --command=":read-attribute(name=server-state)" | findstr "running" -if %ERRORLEVEL% equ 0 goto install_adapters -ping 127.0.0.1 -n 1 > nul -set /a I=%I%+1 -if %I% gtr %TIMEOUT% ( - set ERROR=1 - goto shutdown_jboss -) -goto wait_for_jboss - - -:install_adapters -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%JBOSS_HOME%\bin\adapter-install.cli" -set ERROR=%ERRORLEVEL% -echo Installation of OIDC adapter ended with error code: "%ERROR%" -if %ERROR% neq 0 ( - goto shutdown_jboss -) - -if "%SAML_SUPPORTED%" == "true" ( - call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%JBOSS_HOME%\bin\adapter-install-saml.cli" - set ERROR=%ERRORLEVEL% - echo Installation of SAML adapter ended with error code: "%ERROR%" - if %ERROR% neq 0 ( - goto shutdown_jboss - ) -) - -call %JBOSS_HOME%\bin\jboss-cli.bat -c --file="%CLI_PATH%\add-adapter-log-level.cli" - -:shutdown_jboss -echo Shutting down with error code: "%ERROR%" -call %JBOSS_HOME%\bin\jboss-cli.bat -c --command=":shutdown" -exit /b %ERROR% diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online.sh b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online.sh deleted file mode 100755 index 64627395f2..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/main/resources/config/install-adapters-online.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -echo "JBOSS_HOME=$JBOSS_HOME" - -if [ ! -d "$JBOSS_HOME/bin" ] ; then - >&2 echo "JBOSS_HOME/bin doesn't exist" - exit 1 -fi - -cd $JBOSS_HOME/bin - -./standalone.sh & -sleep 3 - -TIMEOUT=10 -DELAY=1 -T=0 - -RESULT=0 - -until [ $T -gt $TIMEOUT ] -do - if ./jboss-cli.sh -c --command=":read-attribute(name=server-state)" | grep -q "running" ; then - echo "Server is running. Installing adapter." - - ./jboss-cli.sh -c --file="adapter-install.cli" - RESULT=$? - echo "Return code of adapter-install:"${RESULT} - - if [ "$SAML_SUPPORTED" = true ] && [ ${RESULT} -eq 0 ]; then - ./jboss-cli.sh -c --file="adapter-install-saml.cli" - RESULT=$? - echo "Return code of saml adapter-install:"$RESULT - fi - - ./jboss-cli.sh -c --file="$CLI_PATH/add-adapter-log-level.cli" - - ./jboss-cli.sh -c --command=":shutdown" - rm -rf $JBOSS_HOME/standalone/data - rm -rf $JBOSS_HOME/standalone/log - - echo "Exiting with return code: "$RESULT - exit $RESULT - fi - echo "Server is not running." - sleep $DELAY - let T=$T+$DELAY -done - -exit 1 diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/saml-adapter-supported b/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/saml-adapter-supported deleted file mode 100644 index 8b13789179..0000000000 --- a/testsuite/integration-arquillian/servers/app-server/jboss/eap6/src/saml-adapter-supported +++ /dev/null @@ -1 +0,0 @@ - diff --git a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml index b990ff2962..b97ba4f854 100644 --- a/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml +++ b/testsuite/integration-arquillian/servers/app-server/jboss/pom.xml @@ -747,18 +747,6 @@ eap - - app-server-eap6 - - - app.server - eap6 - - - - eap6 - - app-server-wildfly diff --git a/testsuite/integration-arquillian/servers/pom.xml b/testsuite/integration-arquillian/servers/pom.xml index 82498e134a..1db1a7323e 100644 --- a/testsuite/integration-arquillian/servers/pom.xml +++ b/testsuite/integration-arquillian/servers/pom.xml @@ -33,7 +33,6 @@ sh - 7.5.21.Final-redhat-1 7.1.5.GA-redhat-00002 7.1.1.Final diff --git a/testsuite/integration-arquillian/tests/base/pom.xml b/testsuite/integration-arquillian/tests/base/pom.xml index 87c30136e3..4f5a52d053 100644 --- a/testsuite/integration-arquillian/tests/base/pom.xml +++ b/testsuite/integration-arquillian/tests/base/pom.xml @@ -693,57 +693,6 @@ - - app-server-eap6 - - - app.server - eap6 - - - - eap6 - false - - 2.0.0.Final - - - - remote - 10199 - 10299 - 10399 - - - - org.keycloak.testsuite - integration-arquillian-servers-app-server-eap6 - ${project.version} - runtime - - - - org.wildfly.core - wildfly-cli - test - 2.0.10.Final - - - org.jboss.modules - jboss-modules - - - - - - - - org.commonjava.maven.plugins - directory-maven-plugin - - - - app-server-fuse63 diff --git a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/pom.xml b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/pom.xml index 1b39161c72..3bbbd708f2 100644 --- a/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/pom.xml +++ b/testsuite/integration-arquillian/tests/other/adapters/jboss/remote/pom.xml @@ -174,14 +174,6 @@ - - app-server-remote-as7-eap6 - - - remote - ${app.server.management.port.jmx} - - no-offset