able to create unexpected relationships via API

Bug #1666699 reported by Thomas Maddox
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
craton
New
Undecided
Unassigned

Bug Description

The test data generation script sets up two regions and 4 cells. Region #1 has cells #1 & #2, Region #2 has cells #3 & #4. I am able to create a network that is a part of region #2, but also a part of cell #1, which does NOT belong to region #2.

$ curl -X POST -s http://127.0.0.1:8080/v1/networks -H "Content-Type: application/json" -H "X-Auth-Token: demo_root" -H "X-Auth-User: demo_root" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4" -d '{"name": "network_region2_cell_1", "region_id": 2, "cell_id": 1, "cidr": "192.168.0.0/24", "netmask": "255.255.255.0", "gateway": "192.168.0.1"}' | jq
{
  "cell_id": 1,
  "cidr": "192.168.0.0/24",
  "created_at": "2017-02-21T22:01:46.485517",
  "gateway": "192.168.0.1",
  "id": 5,
  "ip_block_type": null,
  "name": "network_region2_cell_1",
  "netmask": "255.255.255.0",
  "nss": null,
  "project_id": "b9f10eca66ac4c279c139d01e65f96b4",
  "region_id": 2,
  "updated_at": null
}

This speaks to a fundamental concern with our API exposing the denormalized relational aspects of our schema where every child resource must reference all of its parents instead of just its immediate parent where further traversal of the hierarchy is inferred from the parent.

description: updated
description: updated
summary: - hosts can be in a region the cell isn't a part of
+ resources can be in a region the cell isn't a part of
summary: - resources can be in a region the cell isn't a part of
+ able to create unexpected relationships via API
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.