summaryrefslogtreecommitdiffstats
path: root/keystone/token/core.py
diff options
context:
space:
mode:
Diffstat (limited to 'keystone/token/core.py')
-rw-r--r--keystone/token/core.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/keystone/token/core.py b/keystone/token/core.py
index e8d04a7e..7eadbe63 100644
--- a/keystone/token/core.py
+++ b/keystone/token/core.py
@@ -174,41 +174,51 @@ class Driver(object):
"""
raise exception.NotImplemented()
- def delete_tokens(self, user_id, tenant_id=None, trust_id=None):
+ def delete_tokens(self, user_id, tenant_id=None, trust_id=None,
+ consumer_id=None):
"""Deletes tokens by user.
If the tenant_id is not None, only delete the tokens by user id under
the specified tenant.
If the trust_id is not None, it will be used to query tokens and the
user_id will be ignored.
+ If the consumer_id is not None, only delete the tokens by consumer id
+ that match the specified consumer id
:param user_id: identity of user
:type user_id: string
:param tenant_id: identity of the tenant
:type tenant_id: string
- :param trust_id: identified of the trust
+ :param trust_id: identity of the trust
:type trust_id: string
+ :param consumer_id: identity of the consumer
+ :type consumer_id: string
:returns: None.
:raises: keystone.exception.TokenNotFound
"""
token_list = self.list_tokens(user_id,
tenant_id=tenant_id,
- trust_id=trust_id)
+ trust_id=trust_id,
+ consumer_id=consumer_id)
+
for token in token_list:
try:
self.delete_token(token)
except exception.NotFound:
pass
- def list_tokens(self, user_id, tenant_id=None, trust_id=None):
+ def list_tokens(self, user_id, tenant_id=None, trust_id=None,
+ consumer_id=None):
"""Returns a list of current token_id's for a user
:param user_id: identity of the user
:type user_id: string
:param tenant_id: identity of the tenant
:type tenant_id: string
- :param trust_id: identified of the trust
+ :param trust_id: identity of the trust
:type trust_id: string
+ :param consumer_id: identity of the consumer
+ :type consumer_id: string
:returns: list of token_id's
"""