Skip to content

Commit

Permalink
WFCORE-4041: fix attribute definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
michpetrov committed Feb 12, 2024
1 parent 0f80581 commit 1318307
Show file tree
Hide file tree
Showing 25 changed files with 22 additions and 29 deletions.
Expand Up @@ -101,7 +101,6 @@ static class AttributeMappingObjectDefinition {

static final SimpleAttributeDefinition RECURSIVE_SEARCH = new SimpleAttributeDefinitionBuilder(ElytronDescriptionConstants.SEARCH_RECURSIVE, ModelType.BOOLEAN, true)
.setRequires(ElytronDescriptionConstants.FILTER)
.setDefaultValue(ModelNode.TRUE)
.setAllowExpression(true)
.setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES)
.build();
Expand Down Expand Up @@ -312,7 +311,6 @@ static class IdentityMappingObjectDefinition {

static final SimpleAttributeDefinition USE_RECURSIVE_SEARCH = new SimpleAttributeDefinitionBuilder(ElytronDescriptionConstants.USE_RECURSIVE_SEARCH, ModelType.BOOLEAN, true)
.setRequires(ElytronDescriptionConstants.SEARCH_BASE_DN)
.setDefaultValue(ModelNode.FALSE)
.setAllowExpression(true)
.setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES)
.build();
Expand Down Expand Up @@ -497,7 +495,7 @@ private void configureIdentityMapping(OperationContext context, ModelNode model,
}

ModelNode useRecursiveSearchNode = IdentityMappingObjectDefinition.USE_RECURSIVE_SEARCH.resolveModelAttribute(context, identityMappingNode);
if (useRecursiveSearchNode.asBoolean()) {
if (useRecursiveSearchNode.isDefined() && useRecursiveSearchNode.asBoolean()) {
identityMappingBuilder.searchRecursive();
}

Expand Down
Expand Up @@ -131,7 +131,6 @@ class SaslServerDefinitions {
static final SimpleAttributeDefinition VERSION_COMPARISON = new SimpleAttributeDefinitionBuilder(ElytronDescriptionConstants.VERSION_COMPARISON, ModelType.STRING, false)
.setRequired(false)
.setAllowExpression(true)
.setDefaultValue(new ModelNode(ElytronDescriptionConstants.LESS_THAN))
.setRequires(ElytronDescriptionConstants.PROVIDER_VERSION)
.setAllowedValues(ElytronDescriptionConstants.LESS_THAN, ElytronDescriptionConstants.GREATER_THAN)
.setValidator(EnumValidator.create(Comparison.class))
Expand Down
Expand Up @@ -32,7 +32,6 @@
import org.jboss.as.host.controller.discovery.StaticDiscovery;
import org.jboss.as.host.controller.ignored.IgnoredDomainResourceRegistry;
import org.jboss.as.host.controller.model.host.AdminOnlyDomainConfigPolicy;
import org.jboss.as.remoting.Protocol;
import org.jboss.as.repository.ContentRepository;
import org.jboss.as.repository.HostFileRepository;
import org.jboss.dmr.ModelNode;
Expand Down Expand Up @@ -92,8 +91,6 @@ public abstract class DomainControllerWriteAttributeHandler extends ReloadRequir
new SimpleAttributeDefinitionBuilder(ModelDescriptionConstants.PROTOCOL, ModelType.STRING)
.setRequired(false)
.setAllowExpression(true)
.setValidator(EnumValidator.create(Protocol.class))
.setDefaultValue(org.jboss.as.remoting.Protocol.REMOTE.toModelNode())
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.setRequires(ModelDescriptionConstants.HOST, ModelDescriptionConstants.PORT)
.build();
Expand Down
Expand Up @@ -30,7 +30,6 @@
import org.jboss.as.controller.registry.Resource;
import org.jboss.as.host.controller.descriptions.HostResolver;
import org.jboss.as.host.controller.model.host.AdminOnlyDomainConfigPolicy;
import org.jboss.as.remoting.Protocol;
import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
import org.wildfly.security.auth.client.AuthenticationContext;
Expand Down Expand Up @@ -62,8 +61,6 @@ public class RemoteDomainControllerAddHandler implements OperationStepHandler {
public static final SimpleAttributeDefinition PROTOCOL = new SimpleAttributeDefinitionBuilder(ModelDescriptionConstants.PROTOCOL, ModelType.STRING)
.setRequired(false)
.setAllowExpression(true)
.setValidator(EnumValidator.create(Protocol.class))
.setDefaultValue(Protocol.REMOTE.toModelNode())
.setFlags(AttributeAccess.Flag.RESTART_ALL_SERVICES)
.setRequires(ModelDescriptionConstants.HOST, ModelDescriptionConstants.PORT)
.build();
Expand Down
Expand Up @@ -196,6 +196,7 @@ public void testDCFailover() throws Exception {
changePrimaryOp.get(ModelDescriptionConstants.OP).set(RemoteDomainControllerAddHandler.OPERATION_NAME);
changePrimaryOp.get(ModelDescriptionConstants.HOST).set("${jboss.test.host.secondary.address}");
changePrimaryOp.get(ModelDescriptionConstants.PORT).set(MGMT_PORTS[1]);
changePrimaryOp.get(ModelDescriptionConstants.PROTOCOL).set("remote");
changePrimaryOp.get(ModelDescriptionConstants.AUTHENTICATION_CONTEXT).set("secondaryHostAContext");

hostUtils[2].executeForResult(changePrimaryOp);
Expand Down
Expand Up @@ -194,6 +194,7 @@ public void testDCFailover() throws Exception {
changePrimaryOp.get(ModelDescriptionConstants.OP).set(RemoteDomainControllerAddHandler.OPERATION_NAME);
changePrimaryOp.get(ModelDescriptionConstants.HOST).set("${jboss.test.host.secondary.address}");
changePrimaryOp.get(ModelDescriptionConstants.PORT).set(MGMT_PORTS[1]);
changePrimaryOp.get(ModelDescriptionConstants.PROTOCOL).set("remote");
changePrimaryOp.get(ModelDescriptionConstants.SECURITY_REALM).set("ManagementRealm");

hostUtils[2].executeForResult(changePrimaryOp);
Expand Down
Expand Up @@ -27,7 +27,7 @@
<!-- Remote domain controller configuration with a host and port -->
<remote authentication-context="secondaryHostAContext" ignore-unused-configuration="true" admin-only-policy="${jboss.test.admin-only-policy}">
<discovery-options>
<static-discovery name="primary" host="${jboss.test.host.primary.address}" port="9999"/>
<static-discovery name="primary" protocol="remote" host="${jboss.test.host.primary.address}" port="9999"/>
</discovery-options>
</remote>
</domain-controller>
Expand Down
Expand Up @@ -25,7 +25,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote authentication-context="secondaryHostAContext" ignore-unused-configuration="true" admin-only-policy="${jboss.test.admin-only-policy}">
<remote protocol="remote" authentication-context="secondaryHostAContext" ignore-unused-configuration="true" admin-only-policy="${jboss.test.admin-only-policy}">
<!--<discovery-options>
<static-discovery name="primary" host="${jboss.test.host.primary.address}" port="9999"/>
</discovery-options>-->
Expand Down
Expand Up @@ -30,7 +30,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" ignore-unused-configuration="true">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" ignore-unused-configuration="true">
<!--
<ignored-resources type="extension">
<instance name="org.jboss.as.jsr77"/>
Expand Down
Expand Up @@ -29,7 +29,7 @@
</management>

<domain-controller>
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext"/>
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext"/>
</domain-controller>

<!--
Expand Down
Expand Up @@ -29,7 +29,7 @@
</management>

<domain-controller>
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<ignored-resources type="extension">
<instance name="ignored"/>
</ignored-resources>
Expand Down
Expand Up @@ -30,7 +30,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" ignore-unused-configuration="false">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" ignore-unused-configuration="false">
</remote>
</domain-controller>

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

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<ignored-resources type="extension">
<instance name="org.jboss.as.jsr77"/>
</ignored-resources>
Expand Down
Expand Up @@ -30,7 +30,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" ignore-unused-configuration="false">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" ignore-unused-configuration="false">
</remote>
</domain-controller>

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

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<ignored-resources type="extension">
<instance name="org.jboss.as.threads"/>
</ignored-resources>
Expand Down
Expand Up @@ -64,7 +64,7 @@
<!-- Remote domain controller configuration with a host and port -->
<remote security-realm="ManagementRealm">
<discovery-options>
<static-discovery name="start-option" host="${jboss.test.host.primary.address}" port="9999" />
<static-discovery name="start-option" protocol="remote" host="${jboss.test.host.primary.address}" port="9999" />
</discovery-options>
</remote>
</domain-controller>
Expand Down
Expand Up @@ -49,7 +49,7 @@
</management>
<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext"/>
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext"/>
</domain-controller>
<interfaces>
<interface name="management">
Expand Down
Expand Up @@ -39,7 +39,7 @@
</management>
<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext"/>
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext"/>
</domain-controller>
<interfaces>
<interface name="management">
Expand Down
Expand Up @@ -49,7 +49,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" />
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext" />
</domain-controller>

<interfaces>
Expand Down
Expand Up @@ -50,7 +50,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<ignored-resources type="extension">
<instance name="org.jboss.as.threads"/>
</ignored-resources>
Expand Down
Expand Up @@ -49,7 +49,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<ignored-resources type="extension">
<instance name="org.jboss.as.jsr77"/>
</ignored-resources>
Expand Down
Expand Up @@ -49,7 +49,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<ignored-resources type="extension">
<instance name="org.jboss.as.jsr77"/>
</ignored-resources>
Expand Down
Expand Up @@ -51,7 +51,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" authentication-context="secondaryHostAContext">
<ignored-resources type="extension">
<instance name="org.jboss.as.threads"/>
</ignored-resources>
Expand Down
Expand Up @@ -22,7 +22,7 @@

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" username="secondary" authentication-context="secondaryHostAContext" ignore-unused-configuration="true">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" username="secondary" authentication-context="secondaryHostAContext" ignore-unused-configuration="true">
</remote>
</domain-controller>

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

<domain-controller>
<!-- Remote domain controller configuration with a host and port -->
<remote host="${jboss.test.host.primary.address}" port="9999" username="secondary" authentication-context="secondaryHostAContext" ignore-unused-configuration="true">
<remote protocol="remote" host="${jboss.test.host.primary.address}" port="9999" username="secondary" authentication-context="secondaryHostAContext" ignore-unused-configuration="true">
</remote>
</domain-controller>

Expand Down

0 comments on commit 1318307

Please sign in to comment.