Return user's roles in response to /tenants/tenantId/users

Registered by Alexej Ababilov

Currently, user's roles in given tenant are not returned in response to /tenants/tenantId/users.
So, for example, if we need to get admins or user of a given tenant, we should:
1) get user list for tenant;
2) for each user get his roles (an HTTP query /users/userId/roleRefs _for each user_) and parse the responses.

A better solution is to return roles in a single query:
{
    "users": {
        "links": [
            {
                "href": "http://127.0.0.1:5001/v2.0/tenants/ANOTHER:TENANT/users?'marker=34&limit=10'",
                "rel": "next"
            }
        ],
        "values": [
            {
                "email": "abc9",
                "enabled": true,
                "id": "admin",
                "tenantId": "ANOTHER:TENANT",
                "tenantRoles": [
                    "Admin",
                    "user"
                ]
            },
            {
                "email": "aa",
                "enabled": true,
                "id": "joeadmin",
                "tenantId": "ANOTHER:TENANT",
                "tenantRoles": [
                    "user"
                ]
            }
        ]
    }
}

Here is a proposed patch:
https://github.com/aababilov/keystone/commit/7f37fdac4a71ceecb8ce8fae6b56b8321a0f2f72

Blueprint information

Status:
Complete
Approver:
Ziad Sawalha
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Obsolete
Series goal:
None
Implementation:
Beta Available
Milestone target:
None
Started by
Ziad Sawalha
Completed by
Joseph Heck

Related branches

Sprints

Whiteboard

ZNS 2011-10-21: I'm concerned that if this is core that it will be difficult to implement on all backends in a scalable way. It could potentially take a lot of calls to get the list of roles for each user as they are listed. It would therefore be preferable to propose this as an extension. CLients can query for the extension and if it is not there, rever to using what is available in core (i.e. /users/:id for each user)

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.