Bug 832075 - RESTAPI: API does not validate enums validity when they supplied by user
RESTAPI: API does not validate enums validity when they supplied by user
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.1.0
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Ori Liel
Elena
infra
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-14 08:57 EDT by Michael Pasternak
Modified: 2016-02-10 14:42 EST (History)
9 users (show)

See Also:
Fixed In Version: si18
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 15:00:50 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Pasternak 2012-06-14 08:57:42 EDT
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 04:39:05 EDT
QE should add to negative tests /verify/ that non-enum values are not permitted.
Comment 3 Ori Liel 2012-08-15 10:50:57 EDT
patch posted: 

  http://gerrit.ovirt.org/#/c/7218/
Comment 4 Elena 2012-09-02 07:30:08 EDT
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 07:08:55 EDT
patch posted upstream: http://gerrit.ovirt.org/#/c/7703/

merged upstream, commit e876beb2deeaa0b27170976a48380e05c57e43af
Comment 6 Ori Liel 2012-09-06 07:09:43 EDT
patch posted downstream: 

  https://gerrit.eng.lab.tlv.redhat.com/#/c/1895/
Comment 7 Ori Liel 2012-09-06 07:22:05 EDT
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 02:22:48 EDT
Verified in si18

Note You need to log in before you can comment on or make changes to this bug.