[jboss-as7-dev] Case-sensitivity of restricted model values
Jason T. Greene
jason.greene at redhat.com
Mon Nov 28 13:33:11 EST 2011
BTW, in this specific case the intention was that the values be lower
case (that is what is in the schema and in the config examples).
The problem comes from using a Java enum, which has a string value that
is upper case. So the answer appears to be lower casing the enum when
writing the value or presenting defaults.
On 11/28/11 11:21 AM, Brian Stansberry wrote:
> Thanks.
>
> On 11/28/11 6:16 AM, David Bosschaert wrote:
>> OK, this would mean that as a reader of the model what I get always
>> exactly matches of the 'allowed' value enumeration?
>> That would be ideal for the console...
>>
>> I've created AS7-2815 to track.
>>
>> Cheers,
>>
>> David
>>
>> On 28/11/2011 02:54, Brian Stansberry wrote:
>>> IMO we should always store and output values that match the "allowed"
>>> description in the metadata but should always be lenient about accepting
>>> input.
>>>
>>> I had a look at all the uses of ModelDescriptionConstants.ALLOWED and it
>>> would be pretty simple to tweak a few places and have everything on the
>>> server side conform to that rule.
>>>
>>> I'd prefer to have that be a hard rule than introduce a new piece of
>>> descriptive metadata. If someone really really needs to have an
>>> exception to the rule, then we can consider adding descriptive metadata.
>>>
>>> On 11/24/11 10:01 PM, Jason Greene wrote:
>>>> Good question. In this case I made it lenient but we don't necessarily have an established convention. IMO it does make a lot of sense to treat enums as case insensitive. Perhaps we need a description attribute for that
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Nov 24, 2011, at 3:21 AM, David Bosschaert<david at redhat.com> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> Looking at the security domain subsystem I see that that the
>>>>> authorization flag field has an allowed list of:
>>>>> "allowed" => [
>>>>> "REQUIRED",
>>>>> "REQUISITE",
>>>>> "SUFFICIENT",
>>>>> "OPTIONAL"]
>>>>>
>>>>> However, the default model (what you get with a fresh new AS7 install)
>>>>> has the flag value in lowercase:
>>>>> "flag" => "required",
>>>>>
>>>>> I'm wondering are we generally lenient wrt to case or is the
>>>>> pre-populated value outside the range?
>>>>>
>>>>> Cheers,
>>>>>
>>>>> David
>>>>> _______________________________________________
>>>>> jboss-as7-dev mailing list
>>>>> jboss-as7-dev at lists.jboss.org
>>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>> _______________________________________________
>>>> jboss-as7-dev mailing list
>>>> jboss-as7-dev at lists.jboss.org
>>>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>>>
>>
>> _______________________________________________
>> jboss-as7-dev mailing list
>> jboss-as7-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
>
>
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
More information about the jboss-as7-dev
mailing list