Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-26 Thread Kekane, Abhishek
sounds reasonable to me. Please let me know your opinion about this approach. Thank you, Abhishek Kekane -Original Message- From: Doug Hellmann [mailto:d...@doughellmann.com] Sent: Wednesday, April 26, 2017 9:01 PM To: openstack-dev Subject: Re: [openstack-dev] [nova][oslo.utils] Bug

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-26 Thread Doug Hellmann
Excerpts from Sean Dague's message of 2017-04-26 10:55:14 -0400: > On 04/26/2017 10:47 AM, Doug Hellmann wrote: > > Excerpts from Sean Dague's message of 2017-04-26 09:01:32 -0400: > >> On 04/26/2017 08:36 AM, Doug Hellmann wrote: > >>> Excerpts from Kekane, Abhishek's message of 2017-04-26

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-26 Thread Sean Dague
On 04/26/2017 10:47 AM, Doug Hellmann wrote: > Excerpts from Sean Dague's message of 2017-04-26 09:01:32 -0400: >> On 04/26/2017 08:36 AM, Doug Hellmann wrote: >>> Excerpts from Kekane, Abhishek's message of 2017-04-26 07:00:22 +: Hi All, As per suggested by @jay_pipes's if

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-26 Thread Doug Hellmann
Excerpts from Sean Dague's message of 2017-04-26 09:01:32 -0400: > On 04/26/2017 08:36 AM, Doug Hellmann wrote: > > Excerpts from Kekane, Abhishek's message of 2017-04-26 07:00:22 +: > >> Hi All, > >> > >> As per suggested by @jay_pipes's > >> if val.count('-') not in (0, 4): > >> raise

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-26 Thread Sean Dague
On 04/26/2017 08:36 AM, Doug Hellmann wrote: > Excerpts from Kekane, Abhishek's message of 2017-04-26 07:00:22 +: >> Hi All, >> >> As per suggested by @jay_pipes's >> if val.count('-') not in (0, 4): >> raise TypeError >> >> It is not sufficient solution because "is_uuid_like" returns only

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-26 Thread Doug Hellmann
but not all projects supports > schema validation. > > Thank you, > > Abhishek > > > From: Lance Bragstad [mailto:lbrags...@gmail.com] > Sent: Monday, April 24, 2017 11:50 PM > To: OpenStack Development Mailing List (not for usage questions) > Subject: Re:

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-26 Thread Kekane, Abhishek
orts schema validation. Thank you, Abhishek From: Lance Bragstad [mailto:lbrags...@gmail.com] Sent: Monday, April 24, 2017 11:50 PM To: OpenStack Development Mailing List (not for usage questions) Subject: Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length We ha

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Lance Bragstad
We had to do similar things in keystone in order to validate uuid-ish types (just not as fancy) [0] [1]. If we didn't have to worry about being backwards compatible with non-uuid formats, it would be awesome to have one implementation for checking that. [0]

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Sean Dague
On 04/24/2017 01:58 PM, Sean Dague wrote: > On 04/24/2017 12:23 PM, Matt Riedemann wrote: > >> >> Is "-----" actually getting past the >> jsonschema validation check when attaching a volume to a server? Because >> that's looking for a uuid: >> >>

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Matt Riedemann
On 4/24/2017 12:58 PM, Sean Dague wrote: Which uses is_uuid_like to do the validation - https://github.com/openstack/nova/blob/1106477b78c80743e6443abc30911b24a9ab7b15/nova/api/validation/validators.py#L85-L87 We assumed (as did many others) that is_uuid_like was strict enough for param

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Sean Dague
On 04/24/2017 12:23 PM, Matt Riedemann wrote: > > Is "-----" actually getting past the > jsonschema validation check when attaching a volume to a server? Because > that's looking for a uuid: > >

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Matt Riedemann
On 4/24/2017 8:45 AM, Jadhav, Pooja wrote: Hi Devs, I want your opinion about bug: https://bugs.launchpad.net/nova/+bug/1680130 When user passes incorrect formatted UUID, volume UUID like: -----(please note double hyphen) for attaching a volume to an

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Jay Pipes
On 04/24/2017 11:00 AM, Eric Fried wrote: That's not the only way you can break this, though. For example, '12-3-45-6-78-12-3456-781-234-56-781-234-56-79' still passes the modified is_uuid_like(), but still manifests the bug. Trying to get is_uuid_like() to cover all possible formatting snafus

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Doug Hellmann
Excerpts from Jay Pipes's message of 2017-04-24 10:44:47 -0400: > On 04/24/2017 09:45 AM, Jadhav, Pooja wrote: > > Solution 3: > > > > We can check UUID in central place means in "is_uuid_like" method of > > oslo_utils [4]. > > This gets my vote. It's a bug in the is_uuid_like() function, IMHO,

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Eric Fried
That's not the only way you can break this, though. For example, '12-3-45-6-78-12-3456-781-234-56-781-234-56-79' still passes the modified is_uuid_like(), but still manifests the bug. Trying to get is_uuid_like() to cover all possible formatting snafus while still allowing the same formats as

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Jay Pipes
On 04/24/2017 09:45 AM, Jadhav, Pooja wrote: Solution 3: We can check UUID in central place means in "is_uuid_like" method of oslo_utils [4]. This gets my vote. It's a bug in the is_uuid_like() function, IMHO, that is returns True for badly-formatted UUID values (like having two consecutive

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Eric Fried
+1. Provide a sanitize_uuid() or similar, which may be as simple as: def sanitize_uuid(val): try: return uuid.UUID(val) except ValueError: raise SomePossiblyNewException(...) UUID consumers are encouraged, but not required, to use it - so we retain backward compatibility

Re: [openstack-dev] [nova][oslo.utils] Bug-1680130 Check validation of UUID length

2017-04-24 Thread Doug Hellmann
Excerpts from Jadhav, Pooja's message of 2017-04-24 13:45:07 +: > Hi Devs, > > I want your opinion about bug: https://bugs.launchpad.net/nova/+bug/1680130 > > When user passes incorrect formatted UUID, volume UUID like: > -----(please note double hyphen) for