Merge "Change is_admin_project to False by default"

This commit is contained in:
Jenkins 2017-03-09 18:19:17 +00:00 committed by Gerrit Code Review
commit eed29f236e
3 changed files with 10 additions and 7 deletions

View File

@ -197,11 +197,7 @@ class KeystoneToken(dict):
if self.domain_scoped:
# Currently, domain scoped tokens cannot act as is_admin_project
return False
# True gets returned by default for compatibility with older versions
# TODO(henry-nash): This seems inherently dangerous, and we should
# investigate how we can default this to False.
return self.get('is_admin_project', True)
return self.get('is_admin_project', False)
@property
def trust_id(self):

View File

@ -87,8 +87,8 @@ class TestKeystoneTokenModel(core.TestCase):
self.assertTrue(token_data.scoped)
self.assertTrue(token_data.trust_scoped)
# by default admin project is True for project scoped tokens
self.assertTrue(token_data.is_admin_project)
# by default admin project is False for project scoped tokens
self.assertFalse(token_data.is_admin_project)
self.assertEqual(
[r['id'] for r in self.v3_sample_token['token']['roles']],

View File

@ -0,0 +1,7 @@
---
fixes:
- |
[`bug 1652012 <https://bugs.launchpad.net/keystone/+bug/1652012>`_]
Changes the token_model to return is_admin_project False if the attribute
is not defined. Returning True for this has the potential to be dangerous
and the given reason for keeping it True is backwards compatability..