Skip to content

Commit

Permalink
[WFLY-5753] Update the security subsystem schema and model version to…
Browse files Browse the repository at this point in the history
… 3.0.0.
  • Loading branch information
darranl committed Dec 1, 2015
1 parent dcf554c commit b6e45a7
Show file tree
Hide file tree
Showing 11 changed files with 1,498 additions and 70 deletions.
Expand Up @@ -36,12 +36,13 @@ public enum Namespace {

SECURITY_1_0("urn:jboss:domain:security:1.0"),
SECURITY_1_1("urn:jboss:domain:security:1.1"),
SECURITY_1_2("urn:jboss:domain:security:1.2");
SECURITY_1_2("urn:jboss:domain:security:1.2"),
SECURITY_3_0("urn:jboss:domain:security:3.0");

/**
* The current namespace version.
*/
public static final Namespace CURRENT = SECURITY_1_2;
public static final Namespace CURRENT = SECURITY_3_0;

private final String name;

Expand Down
Expand Up @@ -81,7 +81,7 @@

private static final String RESOURCE_NAME = SecurityExtension.class.getPackage().getName() + ".LocalDescriptions";

private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(1, 3, 0);
private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(3, 0, 0);

private static final SecuritySubsystemParser PARSER = SecuritySubsystemParser.getInstance();
static final PathElement ACL_PATH = PathElement.pathElement(Constants.ACL, Constants.CLASSIC);
Expand Down Expand Up @@ -152,6 +152,7 @@ public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.SECURITY_1_0.getUriString(), PARSER);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.SECURITY_1_1.getUriString(), PARSER);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.SECURITY_1_2.getUriString(), PARSER);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.SECURITY_3_0.getUriString(), PARSER);
}

private void registerTransformers(SubsystemRegistration subsystemRegistration) {
Expand Down
Expand Up @@ -745,15 +745,17 @@ private void parseAuthenticationJaspi(List<ModelNode> list, PathAddress parentAd
private void parseAuthModule(List<ModelNode> list, XMLExtendedStreamReader reader, PathAddress parentAddress) throws XMLStreamException {
Namespace schemaVer = Namespace.forUri(reader.getNamespaceURI());
EnumSet<Attribute> required = EnumSet.of(Attribute.CODE);
EnumSet<Attribute> notAllowed;
final EnumSet<Attribute> notAllowed;
// in version 1.2 of the schema the optional flag attribute has been included.
if (schemaVer == Namespace.SECURITY_1_2) {
notAllowed = EnumSet.of(Attribute.TYPE);
}
// in earlier versions of the schema, the flag attribute was missing (not allowed).
else {
notAllowed = EnumSet.of(Attribute.TYPE, Attribute.FLAG);
switch (schemaVer) {
case SECURITY_1_0:
case SECURITY_1_1:
notAllowed = EnumSet.of(Attribute.TYPE, Attribute.FLAG);
break;
default:
notAllowed = EnumSet.of(Attribute.TYPE);
}

parseCommonModule(reader, parentAddress, AUTH_MODULE, required, notAllowed, list);
}

Expand Down

0 comments on commit b6e45a7

Please sign in to comment.