Cannot chain a trust with a role specified by name

Bug #1412846 reported by Alexander Makarov
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Fix Released
Wishlist
Morgan Fainberg

Bug Description

From comment in https://review.openstack.org/#/c/126897/

Hi! The new feature is great, but (unless I did a mistake somewhere) I cannot create a chained trust specifying roles with "name" as opposed to "id".

Here's a sample trust POST:
{"trust":{"trustor_user_id":"...","trustee_user_id":"...","project_id":"...","impersonation":true,"roles":[{"name":"admin"}]}}

And an accompanying traceback:

2015-01-19 17:12:36.953 4246 ERROR keystone.common.wsgi [-] 'id'
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi Traceback (most recent call last):
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/common/wsgi.py", line 223, in __call__
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi result = method(context, **params)
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/common/controller.py", line 158, in inner
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi return f(self, context, *args, **kwargs)
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/common/validation/__init__.py", line 36, in wrapper
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi return func(*args, **kwargs)
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/trust/controllers.py", line 163, in create_trust
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi redelegated_trust)
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/notifications.py", line 93, in wrapper
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi result = f(*args, **kwargs)
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/trust/core.py", line 165, in create_trust
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi self._validate_redelegation(t, trust)
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/trust/core.py", line 85, in _validate_redelegation
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi if not all(role['id'] in parent_roles for role in trust['roles']):
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi File "/usr/lib/python2.7/site-packages/keystone/trust/core.py", line 85, in <genexpr>
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi if not all(role['id'] in parent_roles for role in trust['roles']):
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi KeyError: 'id'
2015-01-19 17:12:36.953 4246 TRACE keystone.common.wsgi

Changed in keystone:
assignee: nobody → Alexander Makarov (amakarov)
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/148642

Changed in keystone:
status: New → In Progress
Changed in keystone:
assignee: Alexander Makarov (amakarov) → Morgan Fainberg (mdrnstm)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (master)

Reviewed: https://review.openstack.org/148642
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=be2b89c54dcda9f556f0d59dadc8643bd89ea5dc
Submitter: Jenkins
Branch: master

commit be2b89c54dcda9f556f0d59dadc8643bd89ea5dc
Author: Alexander Makarov <email address hidden>
Date: Tue Jan 20 19:21:14 2015 +0300

    Chain a trust with a role specified by name

    This patch adds an opportunity to specify roles by id or name upon trust
    redelegataion.

    Change-Id: I887d6cb1a1b55ae59f95b74bf69184818d8f6246
    Closes-bug: 1412846

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in keystone:
milestone: none → kilo-3
status: Fix Committed → Fix Released
Dolph Mathews (dolph)
Changed in keystone:
importance: Undecided → Wishlist
Thierry Carrez (ttx)
Changed in keystone:
milestone: kilo-3 → 2015.1.0
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.