id can be set in the post body with v2

Bug #1291518 reported by Vinod Mangalpally
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Critical
Vinod Mangalpally
Icehouse
Fix Released
Critical
Vinod Mangalpally

Bug Description

I used MySQL with BIND for these tests.
For a POST at /v2/zones with a body as below
{
  "zone" : {
    "id" : "2a1d1d1d-1324-4a80-aa32-1f69a91bf2c8",
    "pool_id" : "2b1d1d1d-1324-4a80-aa32-1f69a91bf2c8",
    "project_id" : "my_project_id",
    "status" : "ERROR",
    "ttl" : 12,
    "serial" : 100,
    "version" : 5,
    "created_at" : "2014-02-24T16:16:42.000000",
    "updated_at" : "2014-02-24T16:16:42.000000",
    "name" : "example2.com.",
    "email" : "<email address hidden>"
   }
}

the Response is
{
  "zone":{
   "status":"ACTIVE",
   "description":null,
   "links":{
    "self":"http://192.168.33.8:9001/v2/zones/2a1d1d1d-1324-4a80-aa32-1f69a91bf2c8"
   },
   "updated_at":null,
   "ttl":12,
   "serial":1394645291,
   "id":"2a1d1d1d-1324-4a80-aa32-1f69a91bf2c8",
   "name":"example2.com.",
   "created_at":"2014-03-12T17:28:11.958567",
   "pool_id":"572ba08c-d929-4c70-8e42-03824bb24ca2",
   "version":1,
   "project_id":"noauth-project",
   "email":"<email address hidden>"
  }
}
The id field is updated. pool_id, project_id, status, version, serial, created_at, updated_at can be specified in the body but are ignored.

Changed in designate:
assignee: nobody → Vinod Mangalpally (vinod-mang)
summary: - id can be set in the post body with both v1 and v2
+ id can be set in the post body with v2
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

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

Changed in designate:
status: New → In Progress
Changed in designate:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (master)

Reviewed: https://review.openstack.org/80076
Committed: https://git.openstack.org/cgit/stackforge/designate/commit/?id=a19e434cba3bf5da4bb352d7af225bf330cd99ce
Submitter: Jenkins
Branch: master

commit a19e434cba3bf5da4bb352d7af225bf330cd99ce
Author: Vinod Mangalpally <email address hidden>
Date: Wed Mar 12 17:11:35 2014 -0500

    Ensure that request body in v2 contains valid fields

    Currently 'id' and other fields like 'created_at' and 'updated_at' can
    be set in the request body. Some of these fields are ignored and
    some like 'id' can actual set the id.
    With this change - remove 'id' from the list of valid keys and ensure
    that only valid keys are present in the request body.
    Closes-Bug: #1291518

    Change-Id: I99f3f106c0004fa5521869e46da85f1053241eb5

Changed in designate:
status: In Progress → Fix Committed
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.