Get user/tenant by name returning full list

Bug #1055763 reported by Boden R
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Medium
Justin Shepherd

Bug Description

As recently posted to the email list here: https://lists.launchpad.net/openstack/msg16910.html
...

As per the Keystone v2.0 API docs, I've been trying to use the 'get user
by name' and 'get tenant by name' APIs to retrieve the respective
resource by name. The URI signatures are:

v2.0/users​?name=string
v2.0/tenants​?name=string

respectively.

However, both of these APIs are returning the full list (collection) of
users/tenants rather than the single resource specified in the 'name'
parameter.

EX:
----------------
(request)
GET http://localhost:35357/v2.0/tenants?name=DefaultTenant

(response)
{u'tenants': [{u'id': u'0e98e4ac9590428c997e3aabf18a49d4', u'enabled':
True, u'description': u'Services Tenant', u'name': u'Services'}, {u'id':
u'6f8945f2d47f4abea149b7a0176b12a8', u'enabled': True, u'description':
u'Default Tenant', u'name': u'DefaultTenant'}], u'tenants_links': []}
----------------

These APIs are documented here:

http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_getUserByName_v2.0_users_Admin_API_Service_Developer_Operations-d1e1356.html

http://docs.openstack.org/api/openstack-identity-service/2.0/content/GET_getTenantByName_v2.0_tenants_Admin_API_Service_Developer_Operations-d1e1356.html

If the 'get by name' APIs are not supported, the it might be a good idea to get them out of the docs to remove end user confusion.

Joseph Heck (heckj)
Changed in keystone:
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

Fix proposed to branch: master
Review: https://review.openstack.org/14275

Changed in keystone:
assignee: nobody → Justin Shepherd (jshepher)
status: Triaged → In Progress
Revision history for this message
Ken Thomas (krt) wrote :

I was looking into bug 1031245 and Dolph pointed out that it looks to be a duplicate of this issue. Are you planning on making the client side changes as well? If so, I'll be happy to mark 1031245 as a duplicate. If not, I'll be happy to work on the client side change as part of that bug.

Revision history for this message
Adam Young (ayoung) wrote : Re: [Bug 1055763] Re: Get user/tenant by name returning full list

On 10/23/2012 12:08 PM, Ken Thomas wrote:
> I was looking into bug 1031245 and Dolph pointed out that it looks to
> be a duplicate of this issue. Are you planning on making the client
> side changes as well? If so, I'll be happy to mark 1031245 as a
> duplicate. If not, I'll be happy to work on the client side change as
> part of that bug.
>
Lets keep client and server side changes in separate bugs. You can
always cross reference one to the other, but the changes will go in
against separate Repos.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/14275
Committed: http://github.com/openstack/keystone/commit/00127ab614174f0f2a7f84769e568e14b6083bd6
Submitter: Jenkins
Branch: master

commit 00127ab614174f0f2a7f84769e568e14b6083bd6
Author: galstrom21 <email address hidden>
Date: Tue Oct 9 23:32:20 2012 -0500

    Adding handling for get user/tenant by name

    * /v2.0/tenants?name=<tenant_name>
    * /v2.0/user?name=<user_name>
    * added get_tenant_by_name() to tests/test_content_types.py
    * added get_user_by_name() to tests/test_content_types.py

    bug 1055763

    Change-Id: Id30dc853db12e155238fbb39cef6a081284cb86c

Changed in keystone:
status: In Progress → Fix Committed
Revision history for this message
Ken Thomas (krt) wrote :

re: Comment #3

Separate bugs for client/server makes perfect sense. To restate my question: Is Justin planning on making the client side changes? If so, then I won't bother going further with bug 1031245. If he doesn't have a separate bug for the client side, then he's welcome to take that one. If he does have a bug, then we can mark that as a dup. If he's not planning on doing the client side, then I'll be happy to take a look and use that bug.

Revision history for this message
Justin Shepherd (jshepher) wrote :

Ken: i had not planned on making the client side changes, as i did not realize they were required.

--shep

Joseph Heck (heckj)
Changed in keystone:
milestone: none → grizzly-1
Thierry Carrez (ttx)
Changed in keystone:
status: Fix Committed → Fix Released
Revision history for this message
Olman (olmangarcia) wrote :

Hi, I was looking for this functionality in Folsom so I was reviewing the current solution. It seems to me that the applied fix is not the best way to do it, maybe adding a new route in keystone/identity/routers/Admin router would do the work without hacking the get_users method.

It is just my opinion,

Olman

Thierry Carrez (ttx)
Changed in keystone:
milestone: grizzly-1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.