Merge "Fall back to www_authenthicate_uri"

This commit is contained in:
Zuul 2018-12-04 10:37:55 +00:00 committed by Gerrit Code Review
commit 03cf039d4f
4 changed files with 5 additions and 5 deletions

View File

@ -34,5 +34,5 @@ def get_auth_uri(v3=True):
else:
# Import auth_token to have keystone_authtoken settings setup.
importutils.import_module('keystonemiddleware.auth_token')
auth_uri = cfg.CONF.keystone_authtoken.auth_uri
auth_uri = cfg.CONF.keystone_authtoken.www_authenticate_uri
return auth_uri.replace('v2.0', 'v3') if auth_uri and v3 else auth_uri

View File

@ -571,7 +571,7 @@ class Ec2TokenTest(common.HeatTestCase):
# Import auth_token to have keystone_authtoken settings setup.
importutils.import_module('keystonemiddleware.auth_token')
dummy_url = 'http://123:5000/v2.0'
cfg.CONF.set_override('auth_uri', dummy_url,
cfg.CONF.set_override('www_authenticate_uri', dummy_url,
group='keystone_authtoken')
ec2 = ec2token.EC2Token(app='woot', conf={})
params = {'AWSAccessKeyId': 'foo', 'Signature': 'xyz'}

View File

@ -45,7 +45,7 @@ class AuthUrlFilterTest(common.HeatTestCase):
def test_adds_default_auth_url_from_clients_keystone(self, mock_cfg):
self.config = {}
mock_cfg.clients_keystone.auth_uri = 'foobar'
mock_cfg.keystone_authtoken.auth_uri = 'this-should-be-ignored'
mock_cfg.keystone_authtoken.www_authenticate_uri = 'should-be-ignored'
mock_cfg.auth_password.multi_cloud = False
with mock.patch('keystoneauth1.discover.Discover') as discover:
class MockDiscover(object):
@ -62,7 +62,7 @@ class AuthUrlFilterTest(common.HeatTestCase):
def test_adds_default_auth_url_from_keystone_authtoken(self, mock_cfg):
self.config = {}
mock_cfg.clients_keystone.auth_uri = ''
mock_cfg.keystone_authtoken.auth_uri = 'foobar'
mock_cfg.keystone_authtoken.www_authenticate_uri = 'foobar'
mock_cfg.auth_password.multi_cloud = False
self.middleware = auth_url.AuthUrlFilter(self.app, self.config)
req = webob.Request.blank('/tenant_id/')

View File

@ -212,7 +212,7 @@ class TestRequestContext(common.HeatTestCase):
[clients_keystone] section.
"""
importutils.import_module('keystonemiddleware.auth_token')
cfg.CONF.set_override('auth_uri', 'http://abc/v2.0',
cfg.CONF.set_override('www_authenticate_uri', 'http://abc/v2.0',
group='keystone_authtoken')
policy_check = 'heat.common.policy.Enforcer.check_is_admin'
with mock.patch(policy_check) as pc: