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>
This commit is contained in:
Johan Guldmyr 2019-07-03 09:52:44 +03:00
parent 5b5e713378
commit a60980f3da
No known key found for this signature in database
GPG Key ID: B856C95D74525E1C
3 changed files with 19 additions and 0 deletions

View File

@ -531,6 +531,10 @@
# (Optional) Enable oslo middleware to parse proxy headers.
# 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.
@ -675,6 +679,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,
$amqp_durable_queues = $::os_service_default,
# DEPRECATED PARAMETERS
@ -835,6 +840,7 @@ admin_token will be removed in a later release")
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

@ -661,6 +661,14 @@ describe 'keystone' do
)}
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' })