[Freeipa-devel] [PATCH] 143 Entitlement quantity validation.

Adam Young ayoung at redhat.com
Wed Apr 27 15:43:53 UTC 2011


On 04/27/2011 10:34 AM, Endi Sukma Dewata wrote:
> On 4/26/2011 8:23 PM, Adam Young wrote:
>>> The widget base class has been modified to validate integer value
>>> if the type is specified in the metadata. This is used to validate
>>> entitlement quantity.
>
>> Logic looks good. I'd like to make the validator an external object, and
>> have the builder select the validator based on the metadata.
>>
>> The IPA data types beyond String and int are:
>>
>> bool, float, bytes, and enum. We should at least plan for them, even if
>> we are not implementing them now:
>>
>> something like
>>
>> var validators = {
>> int: function (blah){...}
>> string: function (regex){....}
>> }
>>
>> widget.spec. validator = validators[type];
>
> I had a similar thought, but the validator interface needs further 
> thinking. I'll keep the patch as is for now. This can be refactored 
> into external validator in a follow on patch.
>


Sounds good.   ACK




More information about the Freeipa-devel mailing list