Manage oslo_middleware/max_request_body_size

So that we can increase it from the default 114688

Useful in case for example the OS-Federation mapping is too large.

If this limit is breached keystone will return a 413 Entity Too Large
and not log anything to keystone.log.

Closes-Bug: #1835161

Change-Id: If9fc5c0bb5d6216b8656ee1673e1812c543de305
Signed-off-by: Johan Guldmyr <johan.guldmyr@csc.fi>
(cherry picked from commit a60980f3da)
This commit is contained in:
Johan Guldmyr 2019-07-03 09:52:44 +03:00
parent 87aa4df608
commit 913c2431ab
3 changed files with 19 additions and 0 deletions

View File

@ -562,6 +562,10 @@
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
# [*max_request_body_size*]
# (Optional) Set max request body size
# Defaults to $::os_service_default.
#
# [*purge_config*]
# (optional) Whether to set only the specified config options
# in the keystone config.
@ -762,6 +766,7 @@ class keystone(
$keystone_group = $::keystone::params::keystone_group,
$manage_policyrcd = false,
$enable_proxy_headers_parsing = $::os_service_default,
$max_request_body_size = $::os_service_default,
$purge_config = false,
# DEPRECATED PARAMETERS
$admin_workers = $::os_workers,
@ -967,6 +972,7 @@ We have enabled caching as a backwards compatibility that will be removed in the
oslo::middleware { 'keystone_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
max_request_body_size => $max_request_body_size,
}
# configure based on the catalog backend

View File

@ -0,0 +1,5 @@
---
features:
- |
Add support to configure `[oslo_middleware]/max_request_body_size` with
`$max_request_body_size` in the `keystone::` class.

View File

@ -836,6 +836,14 @@ describe 'keystone' do
it { is_expected.to contain_keystone_config('oslo_middleware/enable_proxy_headers_parsing').with_value(true) }
end
describe 'setting max_request_body_size' do
let :params do
default_params.merge({:max_request_body_size => '1146880' })
end
it { is_expected.to contain_keystone_config('oslo_middleware/max_request_body_size').with_value('1146880') }
end
describe 'setting sql policy driver' do
let :params do
default_params.merge({:policy_driver => 'sql' })