create_region_with_id miss the schema validation

Bug #1473848 reported by Dave Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
David Stanek

Bug Description

When I am debugging the code for the fixing of bug #1468597, #1466872 [1], I found some testcases failure, they are `test_create_region_with_duplicate_id`, `test_create_region_with_matching_ids` and `test_create_region_with_id`.

After digging into the code, I found when the region is created with id provided is not given schema validation at all, this is beasue region reference data is not passed as dict, see [2], but validator expect the reference data is in kwargs [3] which is common usage when the resource is request with restful API.

So, the region creation with id given missed the schema validation.

[1] https://review.openstack.org/#/c/195903/
[2] https://github.com/openstack/keystone/blob/master/keystone/catalog/controllers.py#L173
[3] https://github.com/openstack/keystone/blob/master/keystone/common/validation/__init__.py#L34-L35

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Dave Chen (wei-d-chen)
Changed in keystone:
assignee: nobody → Dave Chen (wei-d-chen)
description: updated
description: updated
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Medium
status: New → Triaged
Changed in keystone:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in keystone:
assignee: Dave Chen (wei-d-chen) → David Stanek (dstanek)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by Dave Chen (<email address hidden>) on branch: master
Review: https://review.openstack.org/201007
Reason: @Dolph, Henry, David, thanks for the review.
I am cool with the the alternative (https://review.openstack.org/#/c/209114/), let's do that instead.

Changed in keystone:
assignee: David Stanek (dstanek) → Dave Chen (wei-d-chen)
Changed in keystone:
assignee: Dave Chen (wei-d-chen) → David Stanek (dstanek)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/209114
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=9ea5283f37d48b2df1d36b969e59ec69cb4974f7
Submitter: Jenkins
Branch: master

commit 9ea5283f37d48b2df1d36b969e59ec69cb4974f7
Author: David Stanek <email address hidden>
Date: Tue Aug 4 14:49:27 2015 +0000

    Hardens the validated decorator's implementation

    Previously the validated decorator expected to find the entities it
    validated in the kwargs. Since the method signatures require the
    argument I don't see any reason to force kwarg usage. This change will
    now also be able to find the argument in args.

    If the validated decorator was used with an incorrect resource to
    validate (a misspelling, etc.), then the validated call would never
    actually validate anything. This change will ensure, at import time,
    that the correct resource to validate is specified.

    Change-Id: Iad5f63cd34e4b75e64a1e233a0915d971a40f79a
    Closes-Bug: #1473848

Changed in keystone:
status: In Progress → Fix Committed
Changed in keystone:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in keystone:
milestone: liberty-3 → 8.0.0
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.