"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "keystone/tests/unit/test_v3_auth.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_v3_auth.py  (keystone-15.0.0):test_v3_auth.py  (keystone-15.0.1)
skipping to change at line 2611 skipping to change at line 2611
# but if we pass allow_expired it validates # but if we pass allow_expired it validates
self._validate_token(token, allow_expired=True) self._validate_token(token, allow_expired=True)
# and then if we're passed the allow_expired_window it will fail # and then if we're passed the allow_expired_window it will fail
# anyway raises expired when now > expiration + window # anyway raises expired when now > expiration + window
frozen_datetime.tick(delta=datetime.timedelta(seconds=22)) frozen_datetime.tick(delta=datetime.timedelta(seconds=22))
self._validate_token(token, self._validate_token(token,
allow_expired=True, allow_expired=True,
expected_status=http_client.NOT_FOUND) expected_status=http_client.NOT_FOUND)
def test_system_scoped_token_works_with_domain_specific_drivers(self):
self.config_fixture.config(
group='identity', domain_specific_drivers_enabled=True
)
PROVIDERS.assignment_api.create_system_grant_for_user(
self.user['id'], self.role['id']
)
token_id = self.get_system_scoped_token()
headers = {'X-Auth-Token': token_id}
app = self.loadapp()
with app.test_client() as c:
c.get('/v3/users', headers=headers)
class TokenDataTests(object): class TokenDataTests(object):
"""Test the data in specific token types.""" """Test the data in specific token types."""
def test_unscoped_token_format(self): def test_unscoped_token_format(self):
# ensure the unscoped token response contains the appropriate data # ensure the unscoped token response contains the appropriate data
r = self.get('/auth/tokens', headers=self.headers) r = self.get('/auth/tokens', headers=self.headers)
self.assertValidUnscopedTokenResponse(r) self.assertValidUnscopedTokenResponse(r)
def test_domain_scoped_token_format(self): def test_domain_scoped_token_format(self):
# ensure the domain scoped token response contains the appropriate data # ensure the domain scoped token response contains the appropriate data
skipping to change at line 5678 skipping to change at line 5694
app_cred = self._make_app_cred() app_cred = self._make_app_cred()
app_cred_ref = self.app_cred_api.create_application_credential( app_cred_ref = self.app_cred_api.create_application_credential(
app_cred) app_cred)
PROVIDERS.assignment_api.remove_role_from_user_and_project( PROVIDERS.assignment_api.remove_role_from_user_and_project(
self.user['id'], self.project['id'], self.user['id'], self.project['id'],
self.role_id) self.role_id)
auth_data = self.build_authentication_request( auth_data = self.build_authentication_request(
app_cred_id=app_cred_ref['id'], secret=app_cred_ref['secret']) app_cred_id=app_cred_ref['id'], secret=app_cred_ref['secret'])
self.v3_create_token(auth_data, expected_status=http_client.NOT_FOUND) self.v3_create_token(auth_data, expected_status=http_client.NOT_FOUND)
def test_application_credential_through_group_membership(self):
user1 = unit.create_user(
PROVIDERS.identity_api, domain_id=self.domain_id
)
group1 = unit.new_group_ref(domain_id=self.domain_id)
group1 = PROVIDERS.identity_api.create_group(group1)
PROVIDERS.identity_api.add_user_to_group(
user1['id'], group1['id']
)
PROVIDERS.assignment_api.create_grant(
self.role_id, group_id=group1['id'], project_id=self.project_id
)
app_cred = {
'id': uuid.uuid4().hex,
'name': uuid.uuid4().hex,
'secret': uuid.uuid4().hex,
'user_id': user1['id'],
'project_id': self.project_id,
'description': uuid.uuid4().hex,
'roles': [{'id': self.role_id}]
}
app_cred_ref = self.app_cred_api.create_application_credential(
app_cred)
auth_data = self.build_authentication_request(
app_cred_id=app_cred_ref['id'], secret=app_cred_ref['secret'])
self.v3_create_token(auth_data, expected_status=http_client.CREATED)
def test_application_credential_cannot_scope(self): def test_application_credential_cannot_scope(self):
app_cred = self._make_app_cred() app_cred = self._make_app_cred()
app_cred_ref = self.app_cred_api.create_application_credential( app_cred_ref = self.app_cred_api.create_application_credential(
app_cred) app_cred)
new_project_ref = unit.new_project_ref(domain_id=self.domain_id) new_project_ref = unit.new_project_ref(domain_id=self.domain_id)
# Create a new project and assign the user a valid role on it # Create a new project and assign the user a valid role on it
new_project = PROVIDERS.resource_api.create_project( new_project = PROVIDERS.resource_api.create_project(
new_project_ref['id'], new_project_ref) new_project_ref['id'], new_project_ref)
PROVIDERS.assignment_api.add_role_to_user_and_project( PROVIDERS.assignment_api.add_role_to_user_and_project(
self.user['id'], new_project['id'], self.role_id) self.user['id'], new_project['id'], self.role_id)
 End of changes. 2 change blocks. 
0 lines changed or deleted 48 lines changed or added

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