"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/protection/v3/test_credentials.py" between
keystone-15.0.0.tar.gz and keystone-15.0.1.tar.gz

About: OpenStack Keystone (Core Service: Identity) provides an authentication and authorization service for other OpenStack services. Provides a catalog of endpoints for all OpenStack services.
The "Stein" series (maintained release).

test_credentials.py  (keystone-15.0.0):test_credentials.py  (keystone-15.0.1)
skipping to change at line 1132 skipping to change at line 1132
# broken behavior with better scope checking. # broken behavior with better scope checking.
with open(self.policy_file_name, 'w') as f: with open(self.policy_file_name, 'w') as f:
overridden_policies = { overridden_policies = {
'identity:get_credential': cp.SYSTEM_READER_OR_CRED_OWNER, 'identity:get_credential': cp.SYSTEM_READER_OR_CRED_OWNER,
'identity:list_credentials': cp.SYSTEM_READER_OR_CRED_OWNER, 'identity:list_credentials': cp.SYSTEM_READER_OR_CRED_OWNER,
'identity:create_credential': cp.SYSTEM_ADMIN_OR_CRED_OWNER, 'identity:create_credential': cp.SYSTEM_ADMIN_OR_CRED_OWNER,
'identity:update_credential': cp.SYSTEM_ADMIN_OR_CRED_OWNER, 'identity:update_credential': cp.SYSTEM_ADMIN_OR_CRED_OWNER,
'identity:delete_credential': cp.SYSTEM_ADMIN_OR_CRED_OWNER 'identity:delete_credential': cp.SYSTEM_ADMIN_OR_CRED_OWNER
} }
f.write(jsonutils.dumps(overridden_policies)) f.write(jsonutils.dumps(overridden_policies))
class ProjectReaderTestsEnforceScopeFalse(base_classes.TestCaseWithBootstrap,
common_auth.AuthTestMixin,
_UserCredentialTests,
_ProjectUsersTests):
def setUp(self):
super(ProjectReaderTestsEnforceScopeFalse, self).setUp()
self.loadapp()
self.useFixture(ksfixtures.Policy(self.config_fixture))
self.config_fixture.config(group='oslo_policy', enforce_scope=False)
project_reader = unit.new_user_ref(
domain_id=CONF.identity.default_domain_id
)
self.user_id = PROVIDERS.identity_api.create_user(
project_reader
)['id']
project = unit.new_project_ref(
domain_id=CONF.identity.default_domain_id
)
self.project_id = PROVIDERS.resource_api.create_project(
project['id'], project
)['id']
PROVIDERS.assignment_api.create_grant(
self.bootstrapper.reader_role_id, user_id=self.user_id,
project_id=self.project_id
)
auth = self.build_authentication_request(
user_id=self.user_id,
password=project_reader['password'],
project_id=self.project_id
)
# Grab a token using the persona we're testing and prepare headers
# for requests we'll be making in the tests.
with self.test_client() as c:
r = c.post('/v3/auth/tokens', json=auth)
self.token_id = r.headers['X-Subject-Token']
self.headers = {'X-Auth-Token': self.token_id}
class ProjectMemberTestsEnforceScopeFalse(base_classes.TestCaseWithBootstrap,
common_auth.AuthTestMixin,
_UserCredentialTests,
_ProjectUsersTests):
def setUp(self):
super(ProjectMemberTestsEnforceScopeFalse, self).setUp()
self.loadapp()
self.useFixture(ksfixtures.Policy(self.config_fixture))
self.config_fixture.config(group='oslo_policy', enforce_scope=False)
project_member = unit.new_user_ref(
domain_id=CONF.identity.default_domain_id
)
self.user_id = PROVIDERS.identity_api.create_user(
project_member
)['id']
project = unit.new_project_ref(
domain_id=CONF.identity.default_domain_id
)
self.project_id = PROVIDERS.resource_api.create_project(
project['id'], project
)['id']
PROVIDERS.assignment_api.create_grant(
self.bootstrapper.member_role_id, user_id=self.user_id,
project_id=self.project_id
)
auth = self.build_authentication_request(
user_id=self.user_id,
password=project_member['password'],
project_id=self.project_id
)
# Grab a token using the persona we're testing and prepare headers
# for requests we'll be making in the tests.
with self.test_client() as c:
r = c.post('/v3/auth/tokens', json=auth)
self.token_id = r.headers['X-Subject-Token']
self.headers = {'X-Auth-Token': self.token_id}
class ProjectAdminTestsEnforceScopeFalse(base_classes.TestCaseWithBootstrap,
common_auth.AuthTestMixin,
_UserCredentialTests,
_SystemUserCredentialTests):
def setUp(self):
super(ProjectAdminTestsEnforceScopeFalse, self).setUp()
self.loadapp()
self.useFixture(ksfixtures.Policy(self.config_fixture))
self.config_fixture.config(group='oslo_policy', enforce_scope=False)
# Reuse the system administrator account created during
# ``keystone-manage bootstrap``
self.user_id = self.bootstrapper.admin_user_id
auth = self.build_authentication_request(
user_id=self.user_id,
password=self.bootstrapper.admin_password,
project_id=self.bootstrapper.project_id
)
# Grab a token using the persona we're testing and prepare headers
# for requests we'll be making in the tests.
with self.test_client() as c:
r = c.post('/v3/auth/tokens', json=auth)
self.token_id = r.headers['X-Subject-Token']
self.headers = {'X-Auth-Token': self.token_id}
 End of changes. 1 change blocks. 
0 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)