Raise max header size to accommodate large tokens

The max header is exceeded in the following scenario
- Auth tokens built with a keystone v3 API catalog
- A catalog with approximately 8 or more endpoints defined

An equivalent fix will be required for all projects which use
eventlet.wsgi.

Closes-Bug: #1190149

Change-Id: Ia0882e43395f1025137173b51aab147433b54255
This commit is contained in:
lvdongbing 2014-02-24 15:57:20 +08:00
parent cf5088b55f
commit 4df858db82
3 changed files with 15 additions and 2 deletions

View File

@ -33,6 +33,12 @@ sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/trove
# before MySQL can drop the connection.
sql_idle_timeout = 3600
# Maximum line size of message headers to be accepted.
# max_header_line may need to be increased when using large tokens
# (typically those generated by the Keystone v3 API with big service
# catalogs)
# max_header_line = 16384
#DB Api Implementation
db_api_implementation = "trove.db.sqlalchemy.api"

View File

@ -258,6 +258,11 @@ common_opts = [
help='List of network IDs which should be attached'
' to instance when networks are not specified'
' in API call.'),
cfg.IntOpt('max_header_line', default=16384,
help='Maximum line size of message headers to be accepted. '
'max_header_line may need to be increased when using '
'large tokens (typically those generated by the '
'Keystone v3 API with big service catalogs'),
]
CONF = cfg.CONF

View File

@ -51,12 +51,14 @@ XMLDictSerializer = openstack_wsgi.XMLDictSerializer
XMLDeserializer = openstack_wsgi.XMLDeserializer
RequestDeserializer = openstack_wsgi.RequestDeserializer
CONF = cfg.CONF
# Raise the default from 8192 to accommodate large tokens
eventlet.wsgi.MAX_HEADER_LINE = CONF.max_header_line
eventlet.patcher.monkey_patch(all=False, socket=True)
LOG = logging.getLogger('trove.common.wsgi')
CONF = cfg.CONF
XMLNS = 'http://docs.openstack.org/database/api/v1.0'
CUSTOM_PLURALS_METADATA = {'databases': '', 'users': ''}
CUSTOM_SERIALIZER_METADATA = {