keystone client cannot get users by id when ldap is used and id is not a hash (id == uid in posixAccount)

Bug #1204214 reported by Adam Tygart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Fix Released
High
Jamie Lennox
python-openstackclient
Invalid
High
Terry Howe

Bug Description

keystone user-get mozes
should return:
+----------+---------------+
| Property | Value |
+----------+---------------+
| email | <email address hidden> |
| enabled | True |
| id | mozes |
| name | Adam Tygart |
+----------+---------------+

instead returns:
No user with a name or ID of 'mozes' exists.

relevant keystone.conf entry:
[ldap]
use_dumb_member = True
user_allow_create = False
user_allow_update = False
user_allow_delete = False
user_mail_attribute = mail
user_id_attribute = uid
user_name_attribute = cn
user_objectclass = posixAccount

Adam Tygart (mozes-7)
affects: keystone → python-keystoneclient
Revision history for this message
alexius ludeman (lexinator) wrote :

assignment/core.py:
    def _get_group_project_roles():
        ...
       metadata_ref = self._get_metadata(
                           group_id=x['id'],
                            domain_id=project_ref['domain_id'])

self._get_metadata() gets called with user_id=None

assignment/backends/ldap.py:
    def _get_metadata():
        ...
        if (not self.get_project(tenant_id) or
                user_id and not self.identity_api.get_user(user_id)):

self.identity_api.get_user(user_id) raises "user not found" since user_id = None

Revision history for this message
alexius ludeman (lexinator) wrote :

sorry I may have jumped the gun on this one. My comment does reveal a bug but I'm not sure it's the same exact code path described.

Revision history for this message
Adam Tygart (mozes-7) wrote :

I believe this is fixed with the code I just uploaded here https://review.openstack.org/#/c/38347/ , but I am not sure if I am familiar enough with the code to know if my "fix" breaks anything else.

Changed in python-keystoneclient:
assignee: nobody → Adam Tygart (mozes-7)
status: New → In Progress
Revision history for this message
Brant Knudson (blk-u) wrote :

Does this work on the unified CLI (openstack user show) already?

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

Adding openstackclient to raise awareness - I'm not sure whether this would be an issue there?

Revision history for this message
Adam Young (ayoung) wrote :

Belived this is fixed, but we need to confirm.

Changed in python-keystoneclient:
importance: Undecided → High
assignee: Adam Tygart (mozes-7) → Jamie Lennox (jamielennox)
Revision history for this message
Adam Young (ayoung) wrote :
Changed in python-keystoneclient:
status: In Progress → Fix Committed
Dolph Mathews (dolph)
Changed in python-keystoneclient:
milestone: none → 0.4.0
Dolph Mathews (dolph)
Changed in python-keystoneclient:
status: Fix Committed → Fix Released
Dean Troyer (dtroyer)
Changed in python-openstackclient:
importance: Undecided → High
status: New → Confirmed
milestone: none → m2
Terry Howe (thowe-g)
Changed in python-openstackclient:
assignee: nobody → Terry Howe (thowe-g)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (master)

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

Revision history for this message
Terry Howe (thowe-g) wrote :

I abandoned my change because it was not necessary. If the UUID parse fails, it still tries to do a manager.get on the name_or_id:

https://github.com/openstack/python-openstackclient/blob/master/openstackclient/common/utils.py#L49

Changed in python-openstackclient:
status: In Progress → Invalid
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.