Browse Source

Merge "Fall back to www_authenthicate_uri"

changes/32/622632/1
Zuul 3 years ago
committed by Gerrit Code Review
parent
commit
03cf039d4f
  1. 2
      heat/common/endpoint_utils.py
  2. 2
      heat/tests/api/aws/test_api_ec2token.py
  3. 4
      heat/tests/test_auth_url.py
  4. 2
      heat/tests/test_common_context.py

2
heat/common/endpoint_utils.py

@ -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

2
heat/tests/api/aws/test_api_ec2token.py

@ -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'}

4
heat/tests/test_auth_url.py

@ -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/')

2
heat/tests/test_common_context.py

@ -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:

Loading…
Cancel
Save