Admin API GET /tokens/<TOKEN_ID> returned result does not match documentation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
High
|
Unassigned |
Bug Description
Page 27 through 28 of the API documentation (most current PDF) shows the correct returned results (in JSON, but the XML returned is similarly incorrect) of:
{
"auth" : {
"token": {
"id": "ab48a9efdfedb2
"expires": "2010-11-
},
"user" : {
"roleRefs": {
"roleRef" : [
{
"id" : 1,
"href" : "https:/
"tenantId" : "one"
}
]},
"username": "jqsmith",
"tenantId": "1234"
}
}
}
The actual returned JSON is the following:
{
"auth" : {
"token": {
"id": "ab48a9efdfedb2
"expires": "2010-11-
},
"user" : {
"roleRefs": [
{
"id" : 1,
"tenantId" : "one"
}
]
"username": "jqsmith",
"tenantId": "1234"
}
}
}
I've cut out the groups attribute of the documented returned result, as it has the same issues as the user's roleRefs attribute. Here are the problems:
1) JSON lists don't have names. Lists are lists. They have no other attributes other than being a list. Therefore, this:
{"auth": {"user": {"roleRefs": [ {"id": 1, "roleId": "admin"}, ... ]}}}
is correct. And this (which is what is documented) is not correct:
{"auth": {"user": {"roleRefs": { "roleRef" [ {"id": 1, "roleId": "admin"}, ... ]}}}}
There should be no "roleRef" attribute at all. This is the result of trying to XML-ify JSON. It simply doesn't work.
2) There is no "href" attribute of the roleRef object returned in the results. The documentation says there should be.
3) The documentation shows a versioned URI as a value for the href attribute. There should be no versioning in an href attribute, according to HTTP standards.
At this time in point, I think the code might be changing faster and moving ahead of the docs. We'll try to stabilize both by the end of the week. Next big shift in the code (and docs) is to make the Rackspace extensions extensions...