Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
security transformers - non deprecated api
- Loading branch information
Showing
3 changed files
with
88 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
security/subsystem/src/main/java/org/jboss/as/security/SecurityTransformers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,65 @@ | |||
/* | |||
* JBoss, Home of Professional Open Source. | |||
* Copyright 2017, Red Hat, Inc., and individual contributors | |||
* as indicated by the @author tags. See the copyright.txt file in the | |||
* distribution for a full listing of individual contributors. | |||
* | |||
* This is free software; you can redistribute it and/or modify it | |||
* under the terms of the GNU Lesser General Public License as | |||
* published by the Free Software Foundation; either version 2.1 of | |||
* the License, or (at your option) any later version. | |||
* | |||
* This software is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
* Lesser General Public License for more details. | |||
* | |||
* You should have received a copy of the GNU Lesser General Public | |||
* License along with this software; if not, write to the Free | |||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |||
*/ | |||
|
|||
package org.jboss.as.security; | |||
|
|||
import org.jboss.as.controller.ModelVersion; | |||
import org.jboss.as.controller.PathElement; | |||
import org.jboss.as.controller.transform.ExtensionTransformerRegistration; | |||
import org.jboss.as.controller.transform.SubsystemTransformerRegistration; | |||
import org.jboss.as.controller.transform.description.DiscardAttributeChecker; | |||
import org.jboss.as.controller.transform.description.RejectAttributeChecker; | |||
import org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder; | |||
import org.jboss.as.controller.transform.description.TransformationDescription; | |||
|
|||
/** | |||
* @author Tomaz Cerar (c) 2017 Red Hat Inc. | |||
*/ | |||
public class SecurityTransformers implements ExtensionTransformerRegistration { | |||
@Override | |||
public String getSubsystemName() { | |||
return SecurityExtension.SUBSYSTEM_NAME; | |||
} | |||
|
|||
@Override | |||
public void registerTransformers(SubsystemTransformerRegistration subsystemRegistration) { | |||
// only register transformers for model version 1.3.0 (EAP 6.2+). | |||
registerTransformers_1_3_0(subsystemRegistration); | |||
} | |||
|
|||
private void registerTransformers_1_3_0(SubsystemTransformerRegistration subsystemRegistration) { | |||
ResourceTransformationDescriptionBuilder builder = ResourceTransformationDescriptionBuilder.Factory.createSubsystemInstance(); | |||
builder.rejectChildResource(PathElement.pathElement(Constants.ELYTRON_REALM)); | |||
builder.rejectChildResource(PathElement.pathElement(Constants.ELYTRON_KEY_STORE)); | |||
builder.rejectChildResource(PathElement.pathElement(Constants.ELYTRON_TRUST_STORE)); | |||
builder.rejectChildResource(PathElement.pathElement(Constants.ELYTRON_KEY_MANAGER)); | |||
builder.rejectChildResource(PathElement.pathElement(Constants.ELYTRON_TRUST_MANAGER)); | |||
builder.addChildResource(PathElement.pathElement(Constants.SECURITY_MANAGEMENT)) | |||
.getAttributeBuilder() | |||
.addRejectCheck(RejectAttributeChecker.DEFINED, SecuritySubsystemRootResourceDefinition.INITIALIZE_JACC) | |||
.setDiscard(DiscardAttributeChecker.UNDEFINED, SecuritySubsystemRootResourceDefinition.INITIALIZE_JACC); | |||
|
|||
SecurityDomainResourceDefinition.registerTransformers_1_3_0(builder); | |||
|
|||
TransformationDescription.Tools.register(builder.build(), subsystemRegistration, ModelVersion.create(1, 3, 0)); | |||
} | |||
} |
23 changes: 23 additions & 0 deletions
23
...rces/META-INF/services/org.jboss.as.controller.transform.ExtensionTransformerRegistration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
# | |||
# JBoss, Home of Professional Open Source. | |||
# Copyright 2017, Red Hat, Inc., and individual contributors | |||
# as indicated by the @author tags. See the copyright.txt file in the | |||
# distribution for a full listing of individual contributors. | |||
# | |||
# This is free software; you can redistribute it and/or modify it | |||
# under the terms of the GNU Lesser General Public License as | |||
# published by the Free Software Foundation; either version 2.1 of | |||
# the License, or (at your option) any later version. | |||
# | |||
# This software is distributed in the hope that it will be useful, | |||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||
# Lesser General Public License for more details. | |||
# | |||
# You should have received a copy of the GNU Lesser General Public | |||
# License along with this software; if not, write to the Free | |||
# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |||
# 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |||
# | |||
|
|||
org.jboss.as.security.SecurityTransformers |