Rename auth_uri to www_authenticate_uri
Keystone deprecated 'auth_uri' to bring 'www_authenticate_uri' in https://review.openstack.org/#/c/508522/, so 'auth_uri' should be removed from all openstack projects. The auth_url is the parameter passed to the keystoneauth plugin and the auth_uri is the parameter specific to keystonemiddleware, so the auth_url would be appropriate in api/client since that's going to be passed straight to keystoneauth, and it should be the same in api/client and in the fixture. So we change the parameter to auth_url in api/client instead of www_authenticate_uri. Change-Id: I7f878974fe8bebb8fe5803ca4e2f8839cdc971d0 Related-Bug: 1755728
This commit is contained in:
parent
b992b90d73
commit
59d5eb125b
|
@ -124,13 +124,13 @@ class TestOpenStackClient(object):
|
|||
|
||||
"""
|
||||
|
||||
def __init__(self, auth_user, auth_key, auth_uri,
|
||||
def __init__(self, auth_user, auth_key, auth_url,
|
||||
project_id=None):
|
||||
super(TestOpenStackClient, self).__init__()
|
||||
self.auth_result = None
|
||||
self.auth_user = auth_user
|
||||
self.auth_key = auth_key
|
||||
self.auth_uri = auth_uri
|
||||
self.auth_url = auth_url
|
||||
if project_id is None:
|
||||
self.project_id = "6f70656e737461636b20342065766572"
|
||||
else:
|
||||
|
@ -148,16 +148,17 @@ class TestOpenStackClient(object):
|
|||
if self.auth_result:
|
||||
return self.auth_result
|
||||
|
||||
auth_uri = self.auth_uri
|
||||
auth_url = self.auth_url
|
||||
headers = {'X-Auth-User': self.auth_user,
|
||||
'X-Auth-Key': self.auth_key,
|
||||
'X-Auth-Project-Id': self.project_id}
|
||||
response = self.request(auth_uri,
|
||||
response = self.request(auth_url,
|
||||
headers=headers)
|
||||
|
||||
http_status = response.status_code
|
||||
LOG.debug("%(auth_uri)s => code %(http_status)s",
|
||||
{'auth_uri': auth_uri, 'http_status': http_status})
|
||||
LOG.debug("%(auth_url)s => code %(http_status)s",
|
||||
{'auth_url': auth_url,
|
||||
'http_status': http_status})
|
||||
|
||||
# NOTE(cdent): This is a workaround for an issue where the placement
|
||||
# API fixture may respond when a request was supposed to go to the
|
||||
|
|
|
@ -29,8 +29,9 @@ class DeployTest(testtools.TestCase):
|
|||
"""Make sure that configuration settings make their way to
|
||||
the keystone middleware correctly.
|
||||
"""
|
||||
auth_uri = 'http://example.com/identity'
|
||||
CONF.set_override('auth_uri', auth_uri, group='keystone_authtoken')
|
||||
www_authenticate_uri = 'http://example.com/identity'
|
||||
CONF.set_override('www_authenticate_uri', www_authenticate_uri,
|
||||
group='keystone_authtoken')
|
||||
# ensure that the auth_token middleware is chosen
|
||||
CONF.set_override('auth_strategy', 'keystone', group='api')
|
||||
app = deploy.deploy(CONF)
|
||||
|
@ -39,5 +40,5 @@ class DeployTest(testtools.TestCase):
|
|||
response = req.get_response(app)
|
||||
|
||||
auth_header = response.headers['www-authenticate']
|
||||
self.assertIn(auth_uri, auth_header)
|
||||
self.assertIn(www_authenticate_uri, auth_header)
|
||||
self.assertIn('keystone uri=', auth_header.lower())
|
||||
|
|
Loading…
Reference in New Issue