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 aodh will return a 413 Entity Too Large
and not log anything to aodh.log.

Change-Id: I3ce3523f00a88dece33657a583d661eea58e90a4
Closes-Bug: #1835161
This commit is contained in:
ZhongShengping 2019-07-04 11:34:41 +08:00
parent 257be71d59
commit 31b4547b05
3 changed files with 22 additions and 0 deletions

View File

@ -36,6 +36,10 @@
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
# [*max_request_body_size*]
# (Optional) Set max request body size
# Defaults to $::os_service_default.
#
# [*paste_config*]
# (Optional) Configuration file for WSGI definition of API
# Defaults to $::os_service_default.
@ -62,6 +66,7 @@ class aodh::api (
$sync_db = false,
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
$max_request_body_size = $::os_service_default,
$paste_config = $::os_service_default,
$gnocchi_external_project_owner = 'services',
# DEPRECATED PARAMETERS
@ -138,5 +143,6 @@ as a standalone service, or httpd for being run by a httpd server")
oslo::middleware { 'aodh_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
max_request_body_size => $max_request_body_size,
}
}

View File

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

View File

@ -36,6 +36,7 @@ describe 'aodh::api' do
is_expected.to contain_aodh_config('api/paste_config').with_value('<SERVICE DEFAULT>')
is_expected.to contain_oslo__middleware('aodh_config').with(
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
:max_request_body_size => '<SERVICE DEFAULT>',
)
end
@ -78,6 +79,16 @@ describe 'aodh::api' do
)}
end
context 'with max_request_body_size' do
before do
params.merge!({:max_request_body_size => '102400' })
end
it { is_expected.to contain_oslo__middleware('aodh_config').with(
:max_request_body_size => '102400',
)}
end
context 'with paste_config' do
before do
params.merge!({:paste_config => '/etc/aodh/api-paste.ini' })