User create throws 500 error on bad uuid string
Bug #1674347 reported by
Sulochan Acharya
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
craton |
New
|
Medium
|
Sulochan Acharya |
Bug Description
When i try to create a user with uuid = "abcd" which is not the right uuid format, i get a 500 back because we dont validate uuid in api and db hates it for not being the correct uuid type.
To post a comment you must log in.
Need to address duplicate user creation in a given project, so returns 409 instead of 500. However same user name in different projects is allowed (but not yet tested).
$ craton-post v1/projects name=baz 127.0.0. 1:7780/ v1/projects/ 289b9377- 8470-43e2- bc45-04f730ddc2 48 request- id: req-535dcb02- 5687-40a2- 98f1-bd6549f915 1a
HTTP/1.0 201 CREATED
Content-Length: 155
Content-Type: application/json
Date: Tue, 21 Mar 2017 15:34:24 GMT
Location: http://
Server: WSGIServer/0.2 CPython/3.5.2
x-openstack-
{ 21T15:34: 24.824411" , 8470-43e2- bc45-04f730ddc2 48",
"created_at": "2017-03-
"id": "289b9377-
"name": "baz",
"updated_at": null,
"variables": {}
}
$ craton-post v1/users username=bar project_ id=289b9377- 8470-43e2- bc45-04f730ddc2 48 127.0.0. 1:7780/ v1/users/ 4 request- id: req-68ebb2db- 6c95-4ed9- 8970-0655cf195d 77
HTTP/1.0 201 CREATED
Content-Length: 248
Content-Type: application/json
Date: Tue, 21 Mar 2017 15:34:45 GMT
Location: http://
Server: WSGIServer/0.2 CPython/3.5.2
x-openstack-
{ 2d81-43e7- 890c-bea823d74b 1b", 21T15:34: 45.392952" , 8470-43e2- bc45-04f730ddc2 48",
"api_key": "fba5c972-
"created_at": "2017-03-
"id": 4,
"is_admin": false,
"project_id": "289b9377-
"roles": [],
"updated_at": null,
"username": "bar"
}
$ craton-post v1/users username=bar project_ id=289b9377- 8470-43e2- bc45-04f730ddc2 48 request- id: req-9884d8e6- 56f5-4a29- 9c3d-258e43e93a 79
HTTP/1.0 500 INTERNAL SERVER ERROR
Content-Length: 50
Content-Type: text/html; charset=utf-8
Date: Tue, 21 Mar 2017 15:34:51 GMT
Server: WSGIServer/0.2 CPython/3.5.2
x-openstack-
{
"message": "Unknown Error",
"status": 500
}