Merge "Remove extras
from token data"
This commit is contained in:
commit
8f30e9a078
@ -91,7 +91,6 @@ class TestValidate(unit.TestCase):
|
|||||||
token = token_data['token']
|
token = token_data['token']
|
||||||
self.assertIsInstance(token['audit_ids'], list)
|
self.assertIsInstance(token['audit_ids'], list)
|
||||||
self.assertIsInstance(token['expires_at'], str)
|
self.assertIsInstance(token['expires_at'], str)
|
||||||
self.assertEqual({}, token['extras'])
|
|
||||||
self.assertIsInstance(token['issued_at'], str)
|
self.assertIsInstance(token['issued_at'], str)
|
||||||
self.assertEqual(method_names, token['methods'])
|
self.assertEqual(method_names, token['methods'])
|
||||||
exp_user_info = {
|
exp_user_info = {
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log
|
from oslo_log import log
|
||||||
from oslo_log import versionutils
|
|
||||||
from oslo_serialization import jsonutils
|
from oslo_serialization import jsonutils
|
||||||
import six
|
import six
|
||||||
from six.moves.urllib import parse
|
from six.moves.urllib import parse
|
||||||
@ -459,20 +458,11 @@ class V3TokenDataHelper(object):
|
|||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
raise exception.UnexpectedError(msg)
|
raise exception.UnexpectedError(msg)
|
||||||
|
|
||||||
def get_token_data(self, user_id, method_names, extras=None,
|
def get_token_data(self, user_id, method_names, domain_id=None,
|
||||||
domain_id=None, project_id=None, expires=None,
|
project_id=None, expires=None, trust=None, token=None,
|
||||||
trust=None, token=None, include_catalog=True,
|
include_catalog=True, bind=None, access_token=None,
|
||||||
bind=None, access_token=None, issued_at=None,
|
issued_at=None, audit_info=None):
|
||||||
audit_info=None):
|
token_data = {'methods': method_names}
|
||||||
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}
|
|
||||||
|
|
||||||
# We've probably already written these to the token
|
# We've probably already written these to the token
|
||||||
if token:
|
if token:
|
||||||
@ -573,7 +563,6 @@ class BaseProvider(provider.Provider):
|
|||||||
token_data = self.v3_token_data_helper.get_token_data(
|
token_data = self.v3_token_data_helper.get_token_data(
|
||||||
user_id,
|
user_id,
|
||||||
method_names,
|
method_names,
|
||||||
auth_context.get('extras') if auth_context else None,
|
|
||||||
domain_id=domain_id,
|
domain_id=domain_id,
|
||||||
project_id=project_id,
|
project_id=project_id,
|
||||||
expires=expires_at,
|
expires=expires_at,
|
||||||
|
Loading…
Reference in New Issue
Block a user