/
ElytronSubsystemParser13_0.java
77 lines (66 loc) · 3.32 KB
/
ElytronSubsystemParser13_0.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Copyright The WildFly Authors
* SPDX-License-Identifier: Apache-2.0
*/
package org.wildfly.extension.elytron;
import static org.wildfly.extension.elytron.ElytronDescriptionConstants.ENCRYPTION;
import static org.wildfly.extension.elytron.ElytronDescriptionConstants.EXPRESSION;
import static org.wildfly.extension.elytron.ElytronDescriptionConstants.EXPRESSION_RESOLVER;
import static org.wildfly.extension.elytron.ElytronDescriptionConstants.SECURITY_PROPERTY;
import org.jboss.as.controller.AttributeMarshallers;
import org.jboss.as.controller.AttributeParsers;
import org.jboss.as.controller.PathElement;
import org.jboss.as.controller.PersistentResourceXMLDescription;
/**
* The subsystem parser, which uses stax to read and write to and from xml.
*
* @author <a href="mailto:darran.lofthouse@jboss.com">Darran Lofthouse</a>
* @since 15.0
*/
public class ElytronSubsystemParser13_0 extends ElytronSubsystemParser12_0 {
@Override
String getNameSpace() {
return ElytronExtension.NAMESPACE_13_0;
}
@Override
PersistentResourceXMLDescription getCredentialStoresParser() {
return new CredentialStoreParser().getCredentialStoresParser_13().build();
}
// New
PersistentResourceXMLDescription getExpressionResolverParser() {
return PersistentResourceXMLDescription.builder(
PathElement.pathElement(EXPRESSION, ENCRYPTION))
.setXmlElementName(EXPRESSION_RESOLVER)
.addAttribute(ExpressionResolverResourceDefinition.RESOLVERS)
.addAttribute(ExpressionResolverResourceDefinition.DEFAULT_RESOLVER)
.addAttribute(ExpressionResolverResourceDefinition.PREFIX)
.build();
}
public PersistentResourceXMLDescription getParserDescription() {
return PersistentResourceXMLDescription.builder(ElytronExtension.SUBSYSTEM_PATH, getNameSpace())
.addAttribute(ElytronDefinition.DEFAULT_AUTHENTICATION_CONTEXT)
.addAttribute(ElytronDefinition.INITIAL_PROVIDERS)
.addAttribute(ElytronDefinition.FINAL_PROVIDERS)
.addAttribute(ElytronDefinition.DISALLOWED_PROVIDERS)
.addAttribute(ElytronDefinition.SECURITY_PROPERTIES, new AttributeParsers.PropertiesParser(null, SECURITY_PROPERTY, true), new AttributeMarshallers.PropertiesAttributeMarshaller(null, SECURITY_PROPERTY, true))
.addAttribute(ElytronDefinition.REGISTER_JASPI_FACTORY)
.addAttribute(ElytronDefinition.DEFAULT_SSL_CONTEXT)
.addChild(getAuthenticationClientParser())
.addChild(getProviderParser())
.addChild(getAuditLoggingParser())
.addChild(getDomainParser())
.addChild(getRealmParser())
.addChild(getCredentialSecurityFactoryParser())
.addChild(getMapperParser())
.addChild(getPermissionSetParser())
.addChild(getHttpParser())
.addChild(getSaslParser())
.addChild(getTlsParser())
.addChild(getCredentialStoresParser())
.addChild(getExpressionResolverParser()) // New
.addChild(getDirContextParser())
.addChild(getPolicyParser())
.addChild(jaspiConfigurationParser)
.build();
}
}