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

2011-04-27 Thread Endi Sukma Dewata

On 4/27/2011 10:43 AM, 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.



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


Pushed to master.

--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


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

2011-04-27 Thread Adam Young

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

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


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

2011-04-27 Thread Dmitri Pal
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.
>
We will have a conversation about the entitlements next week.
We need to get on the same page with the entitlements team and
straighten the use cases.

-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager IPA project,
Red Hat Inc.


---
Looking to carve out IT costs?
www.redhat.com/carveoutcosts/



___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


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

2011-04-27 Thread Endi Sukma Dewata

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.


--
Endi S. Dewata

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


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

2011-04-26 Thread Adam Young

On 04/26/2011 05:48 PM, Endi Sukma Dewata 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.


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


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];


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel