[jboss-jira] [JBoss JIRA] (WFCORE-1590) Default parameter length validating ignores setMinSize(0)
Brian Stansberry (JIRA)
issues at jboss.org
Wed Jul 13 12:48:00 EDT 2016
[ https://issues.jboss.org/browse/WFCORE-1590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13265290#comment-13265290 ]
Brian Stansberry commented on WFCORE-1590:
------------------------------------------
This is a borderline RFE, as it's not clear how this functionality can consistently be provided. In the end the AD needs to call the user provided validator, and if that isn't configured correctly it will reject things regardless of how setMinSize()/setMaxSize() are set on the AD. For allowNull and allowExpressions we can get around that by not calling the provided validator for undefined or expression values but if there's a value we have to call the provided validator.
We can however improve things some by better handling cases where no validator is provided. I think that's your real goal here anyway.
> Default parameter length validating ignores setMinSize(0)
> ---------------------------------------------------------
>
> Key: WFCORE-1590
> URL: https://issues.jboss.org/browse/WFCORE-1590
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Affects Versions: 3.0.0.Alpha1
> Reporter: Darran Lofthouse
> Assignee: Brian Stansberry
> Labels: affects_elytron
> Fix For: 3.0.0.Alpha4
>
>
> With the following attribute definition: -
> {code:java}
> static final SimpleAttributeDefinition REPLACEMENT = new SimpleAttributeDefinitionBuilder(ElytronDescriptionConstants.REPLACEMENT, ModelType.STRING, false)
> .setAllowExpression(true)
> .setMinSize(0)
> .setFlags(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES)
> .build();
> {code}
> The following error is reported if an empty string is used as a parameter: -
> {noformat}
> [standalone at localhost:9990 /] ./subsystem=elytron/regex-name-rewriter=strip-realm:add(pattern="@ELYTRON.ORG", replacement="", replace-all=true)
> {
> "outcome" => "failed",
> "failure-description" => "WFLYCTL0113: '' is an invalid value for parameter replacement. Values must have a minimum length of 1 characters",
> "rolled-back" => true
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list