Fix input validation for V2 API server group API extension

Bug #1292581 reported by OpenStack Infra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-api-site
Fix Released
Medium
Diane Fleming

Bug Description

https://review.openstack.org/79295
commit d440acf469253c49e705221e350402e4d629d091
Author: Chris Yeoh <email address hidden>
Date: Mon Mar 10 22:20:45 2014 +1030

    Fix input validation for V2 API server group API extension

    The server group extension create method allows the name
    parameter to not be a string. The unittest which tests that an integer
    passed as the name fails, but this is due to the policies parameter
    missing from the test data, not because the name is invalid.

    The internal nova code silently converts floats, integers, etc to strings
    and so also does not pick up the validation issue.

    The patch adds extra input validation to the API layer to pick up this issue
    and also tightens the acceptable values of the string to reject trailing
    or leading whitespace which if used can cause confusion for users. It uses
    the regexp that the other parts of the API are converging towards to use
    as a common acceptable name across the API rather than having different
    criteria for names for different extensions.

    Also ensures input validation is always properly applied to the policies
    parameter and adds test cases. This part is backported from this
    https://review.openstack.org/#/c/79312/5 patch.

    The patch also fixes the broken unittests and adds new ones to test the
    tightened criteria for the name parameter.

    +DocImpact
    Co-authored-by: Gary Kotton <email address hidden>
    Closes-Bug: 1290326

    Change-Id: I9ddaef8a128ac6a1a448e47d6b3c9abcf719eb76

Tags: nova
Tom Fifield (fifieldt)
affects: openstack-manuals → openstack-api-site
Changed in openstack-api-site:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → icehouse
Changed in openstack-api-site:
assignee: nobody → Diane Fleming (diane-fleming)
status: Confirmed → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to api-site (master)

Fix proposed to branch: master
Review: https://review.openstack.org/91884

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to api-site (master)

Reviewed: https://review.openstack.org/91884
Committed: https://git.openstack.org/cgit/openstack/api-site/commit/?id=d1f5879f89ead4613af9d82a0f6bc63205efccc9
Submitter: Jenkins
Branch: master

commit d1f5879f89ead4613af9d82a0f6bc63205efccc9
Author: Diane Fleming <email address hidden>
Date: Fri May 2 15:00:39 2014 -0500

    Update server groups extension to describe parameter restrictions

    name and policy name must be from 1 to 255 characters long, a string,
    with no leading or trailing spaces

    Closes-Bug: #1292581

    Change-Id: I7e1151d3f42a5a4e59a4735879805712bab260b6
    author: diane fleming

Changed in openstack-api-site:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.