"name" field is not validated properly for endpoint creation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Low
|
Samuel Pilla |
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://
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-
{
"endpoint": {
"interface": "public",
"region"
"url": "<url>",
"service_id": "a64f07375af641
}
}'
HTTP/1.1 201 Created
{"endpoint": {"region_id": "regionOne", "links": {"self": "<url>/
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-
{
"endpoint": {
"interface": "public",
"nme": "endpointOne",
"region"
"url": "<url>",
"service_id": "a64f07375af641
}
}'
HTTP/1.1 201 Created
{"endpoint": {"region_id": "regionOne", "links": {"self": "<url>/
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-
{
"endpoint": {
"interface": "public",
"extra": "endpointOne",
"region"
"url": "<url>",
"service_id": "a64f07375af641
}
}'
HTTP/1.1 201 Created
{"endpoint": {"region_id": "regionOne", "links": {"self": "<url>/
Changed in keystone: | |
assignee: | nobody → Deliang Fan (vanderliang) |
Changed in keystone: | |
status: | New → Confirmed |
Changed in keystone: | |
status: | Confirmed → In Progress |
Changed in keystone: | |
importance: | Undecided → Low |
Changed in keystone: | |
milestone: | none → pike-1 |
Here is the parameter validation mechanism.
_endpoint_ properties = { types.boolean,
'enabled': parameter_
'interface': {
'type': 'string',
'enum': ['admin', 'internal', 'public']
},
'region_id': {
'type': 'string'
},
'region': {
'type': 'string'
},
'service_id': {
'type': 'string'
},
'url': parameter_types.url
}
endpoint_create = { properties, Properties' : True
'type': 'object',
'properties': _endpoint_
'required': ['interface', 'service_id', 'url'],
'additional
}
Name is not a required option, so we just need to revise the document.