Description of problem: While editing quota from a project in Horizon , this action is removing users from the project. We are using Keystone v3 with multi domains setup. I create a project in "Default" Keystone domain: keystone]# openstack project create test +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | | | domain_id | default | | enabled | True | | id | ceae5812586c4d7e915199c6dd5f4868 | | is_domain | False | | name | test | | parent_id | None | +-------------+----------------------------------+ I add a user from a *different* domain (TESTDOM, an LDAP domain) like this: keystone]# openstack role add --project test --user-domain TESTDOM --user domuser2 _member_ I verify the user is properly located in the project: keystone]# openstack user list --project test +------------------------------------------------------------------+-----------+ | ID | Name | +------------------------------------------------------------------+-----------+ | 13e3a99ae7410be0e41167d3d6fae7dea1b6d0c99362507c5c3b8c26a7b3bc1f | domuser1 | | e9adb93931a3356afbb817f9c2a17046d1ac9127f1112f9751fdb09efe5046fb | domuser2 | +------------------------------------------------------------------+-----------+ At this point the user can connect to Horizon with the TESTDOM domain and it's LDAP credential and do actions in OpenStack. Then I log in the Horizon dashboard by using my account (which is admin) ldap credential and TESTDOM domain. I go in identity -> Projects -> on test project I do "Edit quota" -> I modify the number of instance from 10 to 15 -> update. At this point Horizon *removed* all the users not belonging to the Default domain and that were assigned to this tenant! keystone]# openstack user list --project test keystone]# Version-Release number of selected component (if applicable): * OSP8 * python-django-horizon-8.0.1-2.el7ost.noarch * openstack-dashboard-8.0.1-2.el7ost.noarch * openstack-dashboard-theme-8.0.1-2.el7ost.noarch How reproducible: always Steps to Reproduce: 1) # openstack project create redhatdebug +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | | | domain_id | default | | enabled | True | | id | 9abb68e68ab8489096005004e38e1001 | | is_domain | False | | name | redhatdebug | | parent_id | None | +-------------+----------------------------------+ 2) # openstack role add --project redhatdebug --user-domain TESTDOM --user user1 _member_ 3) # openstack user list --project redhatdebug +------------------------------------------------------------------+----------+ | ID | Name | +------------------------------------------------------------------+----------+ | e9adb93931a3356afbb817f9c2a17046d1ac9127f1112f9751fdb09efe5046fb | user1 | +------------------------------------------------------------------+----------+ 4) modify quota using horizon 5) # openstack user list --project redhatdebug ---> No more LDAP user in the project Actual results: No more LDAP user in the project Expected results: LDAP users stay in the project Additional info: [1] introduced a change in _update_project_members to not remove roles for users who have roles on the project but aren't in the domain: + # TODO(bpokorny): The following lines are needed to make sure we + # only modify roles for users who are in the current domain. + # Otherwise, we'll end up removing roles for users who have roles + # on the project but aren't in the domain. For now, Horizon won't + # support managing roles across domains. The Keystone CLI + # supports it, so we may want to add that in the future. + all_users = api.keystone.user_list(request, + domain=data['domain_id']) + users_dict = {user.id: user.name for user in all_users} + for user_id in users_roles.keys(): + # Don't remove roles if the user isn't in the domain + if user_id not in users_dict: + users_to_modify -= 1 + continue + [1] https://github.com/openstack/horizon/commit/2b846515f388278e2bf8d0198a4f821309e08e69#diff-58479fd50b8eddb273d41ad9c15dafa4R738
After performing the change mentioned in the description and it is possible to edit the tenant, modify quota, assign / remove users from the default domain to the project without any issue.
Hi Martin. The scenario you describe in the bug is impossible to do when using a "real" policy file which is domain-aware. When using, for example, the policy file from https://raw.githubusercontent.com/openstack/keystone/master/etc/policy.v3cloudsample.json - we were blocked from assigning a role to the user from a foreign domain on a project in the default domain. When using the default policy file, which basically allows you to do almost anything, the scenario is possible but we can't be sure what the right behaviour is supposed to be. Which policy file was used for this bug? If it was the default policy file, may we close this bug?
In addition, I think this scenario https://bugzilla.redhat.com/show_bug.cgi?id=1359509#c0 cannot be tested on RHOS 8 because it requires support domain scoped tokens in horizon https://bugzilla.redhat.com/show_bug.cgi?id=1287586 which it target released to RHOS 10
(In reply to Ido Ovadia from comment #11) > In addition, > > I think this scenario https://bugzilla.redhat.com/show_bug.cgi?id=1359509#c0 > cannot be tested on RHOS 8 because it requires support domain scoped tokens > in horizon https://bugzilla.redhat.com/show_bug.cgi?id=1287586 > which it target released to RHOS 10 Ido, just a small clarification: Actually, the code is there in RHOS 9. Please check out the latest BZ 1287586 comments. But as far as I am aware, it's still a no-go for RHOS 8. JFYI.
(In reply to Udi from comment #10) Hi Udi, Ido > When using the default policy file, which basically allows you to do almost > anything, the scenario is possible but we can't be sure what the right > behaviour is supposed to be. Which policy file was used for this bug? If it > was the default policy file, may we close this bug? Probably the default policy file, as documentation in [1] was used. [1] https://access.redhat.com/documentation/en/red-hat-openstack-platform/version-8/integrate-with-identity-service/#enable_command_line_access_to_keystone_v3
(In reply to Martin Schuppert from comment #14) > Yes, we got confirmation from Matthias and Radomir that domain scoped tokens > are not supported in horizon before Mitaka. I am also not sure if we want to > deliver the backported change as there were concerns that we hit issues in > other parts of horizon. The recommendation was to disable the identity tab > until OSP9 which has scoped domains implemented. > > @ Radomir, do we want to ship the backport you did initially? Verified ======== python-django-horizon-8.0.1-6.el7ost.noarch Verified partially as described on comment #8
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-1795.html