← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1579014] Re: "name" field is not validated properly for endpoint creation

 

Reviewed:  https://review.openstack.org/420085
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=49632aee6d0eb92f3d6a2ce88646772cde14543e
Submitter: Jenkins
Branch:    master

commit 49632aee6d0eb92f3d6a2ce88646772cde14543e
Author: Samuel Pilla <sp516w@xxxxxxx>
Date:   Tue Jan 31 09:21:18 2017 -0600

    Update endpoint api for optional region_id
    
    As per the bug, 'name' and 'nme' are not part of the 'endpoint'
    table and were being assigned to the 'extras' column. This is
    why they are not being validated.
    
    The endpoint docs also show that `region_id` is not optional, even
    though it is. This updates the docs to reflect optional `region_id`.
    
    Closes-Bug: #1579014
    Change-Id: I085b75c59767eb96b3bdfe3b887e5e2639122a34


** Changed in: keystone
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Identity (keystone).
https://bugs.launchpad.net/bugs/1579014

Title:
  "name" field is not validated properly for endpoint creation

Status in OpenStack Identity (keystone):
  Fix Released

Bug description:
  In open-stack doc, for endpoint creation it is mentioned only
  "region_id" and "enabled" fields are optional. If we don't mention
  "region_id" field also,it will show it as "null" in response body.

  http://developer.openstack.org/api-ref-identity-v3.html

  But in creation of endpoint, "name" field is not validated. The
  endpoint is created even without "name" field. If this is the expected
  behavior, it should have mentioned as "optional" in open-stack doc.

  Case 1: The "name" field is missing and returns response body without name field.
  ------
  curl -i -k -X POST -H "Content-Type: application/json" -H "X-AUTH-TOKEN:$token" <url>/v3/endpoints -d '
      {
      "endpoint": {
      "interface": "public",
      "region":"regionOne",
      "url": "<url>",
      "service_id": "a64f07375af641bc9dfc925d2dae55d6"
      }
      }'
  HTTP/1.1 201 Created

  {"endpoint": {"region_id": "regionOne", "links": {"self":
  "<url>/v3/endpoints/e0b29542cf5a49f19e6c22a39506c088"}, "url":
  "<url>", "region": "regionOne", "enabled": true, "interface":
  "public", "service_id": "a64f07375af641bc9dfc925d2dae55d6", "id":
  "e0b29542cf5a49f19e6c22a39506c088"}}

  Case 2: The "name" field is misspelt as "nme" but response body is returned with same.
  ------
  curl -i -k -X POST -H "Content-Type: application/json" -H "X-AUTH-TOKEN:$token" <url>/v3/endpoints -d '
      {
      "endpoint": {
      "interface": "public",
      "nme": "endpointOne",
      "region":"regionOne",
      "url": "<url>",
      "service_id": "a64f07375af641bc9dfc925d2dae55d6"
      }
      }'
  HTTP/1.1 201 Created

  {"endpoint": {"region_id": "regionOne", "links": {"self":
  "<url>/v3/endpoints/fe5065ee0cf6450a9a73e8b6e9e09b5e"}, "url":
  "<url>", "region": "regionOne", "enabled": true, "nme": "endpointOne",
  "interface": "public", "service_id":
  "a64f07375af641bc9dfc925d2dae55d6", "id":
  "fe5065ee0cf6450a9a73e8b6e9e09b5e"}}

  Case 3:
  ------
  It is accepting any other extra-fields except the field with name "extra" and not including it in response body.

  curl -i -k -X POST -H "Content-Type: application/json" -H "X-AUTH-TOKEN:$token" <url>/v3/endpoints -d '
      {
      "endpoint": {
      "interface": "public",
      "extra": "endpointOne",
      "region":"regionOne",
      "url": "<url>",
      "service_id": "a64f07375af641bc9dfc925d2dae55d6"
      }
      }'
  HTTP/1.1 201 Created

  {"endpoint": {"region_id": "regionOne", "links": {"self":
  "<url>/v3/endpoints/cf15299f69774d7d822ad706a5ccda78"}, "url":
  "<url>", "region": "regionOne", "enabled": true, "interface":
  "public", "service_id": "a64f07375af641bc9dfc925d2dae55d6", "id":
  "cf15299f69774d7d822ad706a5ccda78"}}

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1579014/+subscriptions


References