Remove unused revoke_by_user_and_project

This patch removes a method that wasn't being
used anymore anywhere except for a single unit
test. Since keystone now validates Fernet
tokens the same way - by rebuilding the token
context at validation time, we no longer need
to persist certain types of revocation events.

Change-Id: Ic9dcc6a5fd40e504ec04dcefab995d03927362bc
partial-bug: #1671887
This commit is contained in:
Vishakha Agarwal 2018-09-13 08:30:39 +05:30
parent 294ca38554
commit 4b2c456697
2 changed files with 0 additions and 35 deletions

View File

@ -122,10 +122,6 @@ class Manager(manager.Manager):
domain_id=domain_id,
project_id=project_id))
def revoke_by_user_and_project(self, user_id, project_id):
self.revoke(
revoke_model.RevokeEvent(project_id=project_id, user_id=user_id))
def check_token(self, token):
"""Check the values from a token against the revocation list.

View File

@ -331,37 +331,6 @@ class RevokeTests(object):
self.assertEqual(
1, len(revocation_backend.list_events(token=token_data)))
def test_by_project_and_user_and_role(self):
revocation_backend = sql.Revoke()
first_token = _sample_blank_token()
first_token['user_id'] = uuid.uuid4().hex
first_token['project_id'] = uuid.uuid4().hex
second_token = _sample_blank_token()
second_token['user_id'] = uuid.uuid4().hex
second_token['project_id'] = first_token['project_id']
# Check that both tokens have not been revoked.
self._assertTokenNotRevoked(first_token)
self._assertTokenNotRevoked(second_token)
self.assertEqual(
0, len(revocation_backend.list_events(token=first_token)))
self.assertEqual(
0, len(revocation_backend.list_events(token=second_token)))
# Revoke first_token using user_id and project_id
PROVIDERS.revoke_api.revoke_by_user_and_project(
first_token['user_id'], first_token['project_id'])
# Check that only first_token has been revoked.
self._assertTokenRevoked(first_token)
self._assertTokenNotRevoked(second_token)
self.assertEqual(
1, len(revocation_backend.list_events(token=first_token)))
self.assertEqual(
0, len(revocation_backend.list_events(token=second_token)))
def test_revoke_by_audit_id(self):
token = _sample_blank_token()
# Audit ID and Audit Chain ID are populated with the same value