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
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Ori Liel
Depends On:
  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:
Last Closed: 2012-12-04 15:00:50 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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
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: 

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

    <reason>Invalid value</reason>
    <detail>aaa is not a member of StorageType</detail>
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: 

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: 

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.