Include 'token' in the method list for federated scoped tokens
Closes-Bug: #1501032 Change-Id: I52b1c236569db7cbddf44a196c9a98a0b1547215
This commit is contained in:
parent
029476272f
commit
a7677be518
|
@ -51,6 +51,12 @@ class Token(base.AuthMethodHandler):
|
|||
response_data = token_authenticate(request,
|
||||
token_ref)
|
||||
|
||||
# NOTE(notmorgan): The Token auth method is *very* special and sets the
|
||||
# previous values to the method_names. This is because it can be used
|
||||
# for re-scoping and we want to maintain the values. Most
|
||||
# AuthMethodHandlers do no such thing and this is not required.
|
||||
response_data.setdefault('method_names', []).extend(token_ref.methods)
|
||||
|
||||
return base.AuthHandlerResponse(status=True, response_body=None,
|
||||
response_data=response_data)
|
||||
|
||||
|
@ -103,11 +109,6 @@ def token_authenticate(request, token_ref):
|
|||
# from the response_data
|
||||
response_data.setdefault('extras', {}).update(
|
||||
token_ref.get('extras', {}))
|
||||
# NOTE(notmorgan): The Token auth method is *very* special and sets the
|
||||
# previous values to the method_names. This is because it can be used
|
||||
# for re-scoping and we want to maintain the values. Most
|
||||
# AuthMethodHandlers do no such thing and this is not required.
|
||||
response_data.setdefault('method_names', []).extend(token_ref.methods)
|
||||
|
||||
return response_data
|
||||
|
||||
|
|
|
@ -182,9 +182,9 @@ class FederatedSetupMixin(object):
|
|||
'auth': {
|
||||
'identity': {
|
||||
'methods': [
|
||||
self.AUTH_METHOD
|
||||
'token'
|
||||
],
|
||||
self.AUTH_METHOD: {
|
||||
'token': {
|
||||
'id': unscoped_token_id
|
||||
}
|
||||
},
|
||||
|
@ -1756,7 +1756,7 @@ class MappingCRUDTests(test_v3.RestfulTestCase):
|
|||
class FederatedTokenTests(test_v3.RestfulTestCase, FederatedSetupMixin):
|
||||
|
||||
def auth_plugin_config_override(self):
|
||||
methods = ['saml2']
|
||||
methods = ['saml2', 'token']
|
||||
super(FederatedTokenTests, self).auth_plugin_config_override(methods)
|
||||
|
||||
def setUp(self):
|
||||
|
@ -2151,9 +2151,6 @@ class FederatedTokenTests(test_v3.RestfulTestCase, FederatedSetupMixin):
|
|||
self.assertEqual(domains_ref, domains,
|
||||
'match failed for url %s' % url)
|
||||
|
||||
@utils.wip('This will fail because of bug #1501032. The returned method'
|
||||
'list should contain "saml2". This is documented in bug '
|
||||
'1501032.')
|
||||
def test_full_workflow(self):
|
||||
"""Test 'standard' workflow for granting access tokens.
|
||||
|
||||
|
@ -2178,8 +2175,6 @@ class FederatedTokenTests(test_v3.RestfulTestCase, FederatedSetupMixin):
|
|||
|
||||
r = self.v3_create_token(v3_scope_request)
|
||||
token_resp = r.result['token']
|
||||
# FIXME(lbragstad): 'token' should be in the list of methods returned
|
||||
# but it isn't. This is documented in bug 1501032.
|
||||
self.assertIn('token', token_resp['methods'])
|
||||
self.assertIn('saml2', token_resp['methods'])
|
||||
self._check_project_scoped_token_attributes(token_resp, project['id'])
|
||||
|
@ -2793,7 +2788,7 @@ class FederatedUserTests(test_v3.RestfulTestCase, FederatedSetupMixin):
|
|||
"""
|
||||
|
||||
def auth_plugin_config_override(self):
|
||||
methods = ['saml2']
|
||||
methods = ['saml2', 'token']
|
||||
super(FederatedUserTests, self).auth_plugin_config_override(methods)
|
||||
|
||||
def setUp(self):
|
||||
|
@ -3134,7 +3129,7 @@ class ShadowMappingTests(test_v3.RestfulTestCase, FederatedSetupMixin):
|
|||
}
|
||||
|
||||
def auth_plugin_config_override(self):
|
||||
methods = ['saml2']
|
||||
methods = ['saml2', 'token']
|
||||
super(ShadowMappingTests, self).auth_plugin_config_override(methods)
|
||||
|
||||
def load_fixtures(self, fixtures):
|
||||
|
|
Loading…
Reference in New Issue