From 684041fd19ad8d7fcdf6131e90451c02bfeffd6a Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Tue, 24 Nov 2015 18:32:31 -0500 Subject: [PATCH] Remove `extras` from token data In the Kilo release we opted to remove the `extras` field from the token body in favor of well defined APIs. We can now remove it as it has been 2 cycles. implements bp: removed-as-of-mitaka Change-Id: I612d3d0dbe35b858928f6f44f26af26cf690a897 --- .../tests/unit/token/test_fernet_provider.py | 1 - keystone/token/providers/common.py | 21 +++++-------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/keystone/tests/unit/token/test_fernet_provider.py b/keystone/tests/unit/token/test_fernet_provider.py index 0b3ec65880..c96251aed5 100644 --- a/keystone/tests/unit/token/test_fernet_provider.py +++ b/keystone/tests/unit/token/test_fernet_provider.py @@ -91,7 +91,6 @@ class TestValidate(unit.TestCase): token = token_data['token'] self.assertIsInstance(token['audit_ids'], list) self.assertIsInstance(token['expires_at'], str) - self.assertEqual({}, token['extras']) self.assertIsInstance(token['issued_at'], str) self.assertEqual(method_names, token['methods']) exp_user_info = { diff --git a/keystone/token/providers/common.py b/keystone/token/providers/common.py index cf82d52148..fd87b3de4e 100644 --- a/keystone/token/providers/common.py +++ b/keystone/token/providers/common.py @@ -14,7 +14,6 @@ from oslo_config import cfg from oslo_log import log -from oslo_log import versionutils from oslo_serialization import jsonutils import six from six.moves.urllib import parse @@ -459,20 +458,11 @@ class V3TokenDataHelper(object): LOG.error(msg) raise exception.UnexpectedError(msg) - def get_token_data(self, user_id, method_names, extras=None, - domain_id=None, project_id=None, expires=None, - trust=None, token=None, include_catalog=True, - bind=None, access_token=None, issued_at=None, - audit_info=None): - if extras is None: - extras = {} - if extras: - versionutils.deprecated( - what='passing token data with "extras"', - as_of=versionutils.deprecated.KILO, - in_favor_of='well-defined APIs')(lambda: None)() - token_data = {'methods': method_names, - 'extras': extras} + def get_token_data(self, user_id, method_names, domain_id=None, + project_id=None, expires=None, trust=None, token=None, + include_catalog=True, bind=None, access_token=None, + issued_at=None, audit_info=None): + token_data = {'methods': method_names} # We've probably already written these to the token if token: @@ -573,7 +563,6 @@ class BaseProvider(provider.Provider): token_data = self.v3_token_data_helper.get_token_data( user_id, method_names, - auth_context.get('extras') if auth_context else None, domain_id=domain_id, project_id=project_id, expires=expires_at,