[jboss-jira] [JBoss JIRA] (WFCORE-4029) PrincipalResourceDefinition.Type should override toString with lower-case value
Brian Stansberry (JIRA)
issues at jboss.org
Tue Aug 14 10:01:00 EDT 2018
[ https://issues.jboss.org/browse/WFCORE-4029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brian Stansberry resolved WFCORE-4029.
--------------------------------------
Resolution: Won't Do
I've decided not to pursue this. Doing it resulted in failures in core-model-test transformers tests, which are probably no big deal and resolvable via the test fixture. But that just pushed this over the edge in terms of risk vs reward, effort vs benefit.
In case we decide later to take this up this was the functional change:
{code}
diff --git a/domain-management/src/main/java/org/jboss/as/domain/management/access/PrincipalResourceDefinition.java b/domain-management/src/main/java/org/jboss/as/domain/management/access/PrincipalResourceDefinition.java
index c81a8388b3..0f925a02f2 100644
--- a/domain-management/src/main/java/org/jboss/as/domain/management/access/PrincipalResourceDefinition.java
+++ b/domain-management/src/main/java/org/jboss/as/domain/management/access/PrincipalResourceDefinition.java
@@ -25,6 +25,8 @@ package org.jboss.as.domain.management.access;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.EXCLUDE;
import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.INCLUDE;
+import java.util.Locale;
+
import org.jboss.as.controller.ModelVersion;
import org.jboss.as.controller.OperationContext;
import org.jboss.as.controller.OperationFailedException;
@@ -43,14 +45,20 @@ import org.jboss.dmr.ModelNode;
import org.jboss.dmr.ModelType;
/**
- * A {@link ResourceDefinition} representing a Principal either specified in the include or exclude list of a role mapping.
+ * A {@link org.jboss.as.controller.ResourceDefinition} representing a Principal either specified in the include or exclude list of a role mapping.
*
* @author <a href="mailto:darran.lofthouse at jboss.com">Darran Lofthouse</a>
*/
public class PrincipalResourceDefinition extends SimpleResourceDefinition {
public enum Type {
- GROUP, USER
+ GROUP, USER;
+
+ @Override
+ public String toString() {
+ // Use lower case form
+ return super.toString().toLowerCase(Locale.ENGLISH);
+ }
}
public static final SimpleAttributeDefinition TYPE = new SimpleAttributeDefinitionBuilder(ModelDescriptionConstants.TYPE,
@@ -86,7 +94,7 @@ public class PrincipalResourceDefinition extends SimpleResourceDefinition {
static AuthorizerConfiguration.PrincipalType getPrincipalType(final OperationContext context, final ModelNode model)
throws OperationFailedException {
- return AuthorizerConfiguration.PrincipalType.valueOf(TYPE.resolveValue(context, model.get(TYPE.getName())).asString());
+ return AuthorizerConfiguration.PrincipalType.valueOf(TYPE.resolveValue(context, model.get(TYPE.getName())).asString().toUpperCase(Locale.ENGLISH));
}
static String getRealm(final OperationContext context, final ModelNode model) throws OperationFailedException {
{code}
> PrincipalResourceDefinition.Type should override toString with lower-case value
> -------------------------------------------------------------------------------
>
> Key: WFCORE-4029
> URL: https://issues.jboss.org/browse/WFCORE-4029
> Project: WildFly Core
> Issue Type: Enhancement
> Reporter: Brian Stansberry
> Assignee: Brian Stansberry
> Priority: Minor
>
> Eliminate the need for this:
> https://github.com/wildfly/wildfly-core/pull/3431/files#diff-a3d05632a7de0f85c3c3352218668870
> Using the lower case values in the config docs is nicer, but because the lower case gets thrown away Galleon has to put upper case in our standard configs or think the user made a config change when read-config-as-feature reports upper case.
> [~aloubyansky] FYI.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list