Bug 832075

Summary: RESTAPI: API does not validate enums validity when they supplied by user
Product: Red Hat Enterprise Virtualization Manager Reporter: Michael Pasternak <mpastern>
Component: ovirt-engine-restapiAssignee: Ori Liel <oliel>
Status: CLOSED CURRENTRELEASE QA Contact: Elena <edolinin>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: bazulay, dyasny, ecohen, iheim, mkenneth, mpastern, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: si18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-04 20:00:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Pasternak 2012-06-14 12:57:42 UTC
Description of problem:

api expose emums as string (in sake of runtime translation),
but when user provide enum (as action parameter) api does not validate
it and if it does not match expected enumeration, api pass NULL to backend,
so eventually user will receive error complaining on missing parameter.

Steps to Reproduce:

use incorrect enumeration

Expected results:

api error, saying that enum value is not valid & providing possible
enumerations.

Comment 2 Michael Pasternak 2012-06-20 08:39:05 UTC
QE should add to negative tests /verify/ that non-enum values are not permitted.

Comment 3 Ori Liel 2012-08-15 14:50:57 UTC
patch posted: 

  http://gerrit.ovirt.org/#/c/7218/

Comment 4 Elena 2012-09-02 11:30:08 UTC
si 16 - error doesn't contain list of possible values

<fault>
    <reason>Invalid value</reason>
    <detail>aaa is not a member of StorageType</detail>
</fault>

Comment 5 Ori Liel 2012-09-06 11:08:55 UTC
patch posted upstream: http://gerrit.ovirt.org/#/c/7703/

merged upstream, commit e876beb2deeaa0b27170976a48380e05c57e43af

Comment 6 Ori Liel 2012-09-06 11:09:43 UTC
patch posted downstream: 

  https://gerrit.eng.lab.tlv.redhat.com/#/c/1895/

Comment 7 Ori Liel 2012-09-06 11:22:05 UTC
ignore previous patch (mistakenly depended on outdated patch, and consequently abandoned). 

patch posted downstream: 

  https://gerrit.eng.lab.tlv.redhat.com/#/c/1896/

Comment 8 Elena 2012-09-16 06:22:48 UTC
Verified in si18