unable to filter users by default project in V3

Bug #1347974 reported by Charles V Bock
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-keystoneclient
Confirmed
Wishlist
Unassigned

Bug Description

In version 2.0 I used to be able to make this api call:
        /v2.0/tenants/[project id]/users
or in the python client (horizon)simply:
        api.keystone.user_list(request, project=project_id)
to get back a list of the users in a specific project

note the logic here to make this happen:
https://github.com/openstack/python-keystoneclient/blob/0e9ecaa1547306f7af6527126fb88f8151908498/keystoneclient/v2_0/users.py#L124-L128

The same call using python keystone client in V3 returns me all the users in keystone even if I specify a project argument.
and /v3/projects/[project id]/users doesn't seem to even exist.

note the lack of similar logic in the new version:
it seems to treat the project argument as if it was an old property filter, but it wasn't it was a special case for listing a projects users...

https://github.com/openstack/python-keystoneclient/blob/0e9ecaa1547306f7af6527126fb88f8151908498/keystoneclient/v3/users.py#L94-L96

Thoughts?

Revision history for this message
Charles V Bock (charles-v-bock) wrote :

I also couldn't find an equivalent v3 version of this functionality on the keystone side:
https://github.com/openstack/keystone/blob/master/keystone/assignment/controllers.py#L132

description: updated
description: updated
description: updated
Revision history for this message
Dolph Mathews (dolph) wrote :

Several closely related use cases were solved with a single API resource and lots of filtering options:

  GET /v3/role_assignments?project.id={project_id}

Docs: https://github.com/openstack/identity-api/blob/master/v3/src/markdown/identity-api-v3.md#list-effective-role-assignments-get-role_assignments

Changed in python-keystoneclient:
status: New → Invalid
Revision history for this message
Pavel Ikrenyi (ikrenyi1) wrote :

This is still in current documentation.

https://docs.openstack.org/python-keystoneclient/latest/api/keystoneclient.v3.html#module-keystoneclient.v3.users

If it's not planned to be fixed, it should at least be removed from the docs, or the docs should be updated to reflect the new way of calling the API...

Revision history for this message
Lance Bragstad (lbragstad) wrote :

We do publish a note about `project` being deprecated [0] saying that it could be removed in the future after version 2.0.0. Since we're into version 3 of the client, I tested this and default_project doesn't appear to filter, either [1].

I would suggest we fix the default_project filtering and we could retarget this but to fix that instead of using project, since that's been deprecated for some time.

[0] https://docs.openstack.org/python-keystoneclient/latest/api/keystoneclient.v3.html#module-keystoneclient.v3.users
[1] https://pasted.tech/pastes/6f81cbe2422449a92d786e6fa97882e0d79b50fd.raw

summary: - unable to list projects users in V3
+ unable to filter users by default project in V3
Changed in python-keystoneclient:
status: Invalid → Confirmed
importance: Undecided → Wishlist
tags: added: low-hanging-fruit
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.