Don't pass the service catalog when making glance requests
If your service catalog has too many endpoints in it, passing this in the request to glance can result in a 400 because the header is too big. This isn't even necessary to pass to glance since we use the auth_token middleware. Per bknudson: "Any service using the auth_token middleware has no use for the x-service-catalog header. All that auth_token middleware uses is x-auth-token. The auth_token middleware will actually strip the x-service-catalog from the request before it sends the request on to the rest of the pipeline, so the application will never see it." Closes-Bug: #1482699 Change-Id: I204c6f61194bef6eba01ab0525bc80fa2e323acd
This commit is contained in:
parent
feb01439cf
commit
4fa9bc1c54
@ -116,7 +116,6 @@ def generate_identity_headers(context, status='Confirmed'):
|
||||
'X-Tenant-Id': getattr(context, 'tenant', None),
|
||||
'X-Roles': ','.join(context.roles),
|
||||
'X-Identity-Status': status,
|
||||
'X-Service-Catalog': jsonutils.dumps(context.service_catalog),
|
||||
}
|
||||
|
||||
|
||||
|
@ -206,7 +206,6 @@ class TestCreateGlanceClient(test.NoDBTestCase):
|
||||
'X-User-Id': 'fake',
|
||||
'X-Roles': '',
|
||||
'X-Tenant-Id': 'fake',
|
||||
'X-Service-Catalog': '[]',
|
||||
'X-Identity-Status': 'Confirmed'
|
||||
},
|
||||
'token': 'token'
|
||||
@ -226,7 +225,6 @@ class TestCreateGlanceClient(test.NoDBTestCase):
|
||||
'X-User-Id': 'fake',
|
||||
'X-Roles': '',
|
||||
'X-Tenant-Id': 'fake',
|
||||
'X-Service-Catalog': '[]',
|
||||
'X-Identity-Status': 'Confirmed'
|
||||
},
|
||||
'token': 'token'
|
||||
|
@ -65,8 +65,7 @@ class TestGlanceStore(stubs.XenAPITestBaseNoDB):
|
||||
'glance_port': 123,
|
||||
'glance_use_ssl': False,
|
||||
'sr_path': '/fake/sr/path',
|
||||
'extra_headers': {'X-Service-Catalog': '[]',
|
||||
'X-Auth-Token': 'foobar',
|
||||
'extra_headers': {'X-Auth-Token': 'foobar',
|
||||
'X-Roles': '',
|
||||
'X-Tenant-Id': 'project',
|
||||
'X-User-Id': 'user',
|
||||
|
@ -283,8 +283,7 @@ class FetchVhdImageTestCase(VMUtilsTestBase):
|
||||
self.session, 'call_plugin_serialized_with_retry')
|
||||
func = self.session.call_plugin_serialized_with_retry(
|
||||
'glance', 'download_vhd', 0, mox.IgnoreArg(), mox.IgnoreArg(),
|
||||
extra_headers={'X-Service-Catalog': '[]',
|
||||
'X-Auth-Token': 'auth_token',
|
||||
extra_headers={'X-Auth-Token': 'auth_token',
|
||||
'X-Roles': '',
|
||||
'X-Tenant-Id': None,
|
||||
'X-User-Id': None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user