Add support for the use_forwarded_for parameter
Change-Id: If9f511b7a94501ad910a282c6ccd84f721d6fd64
This commit is contained in:
parent
12e535daae
commit
fe5be161ef
|
@ -104,6 +104,13 @@
|
||||||
# will also need to be changed to match.
|
# will also need to be changed to match.
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
|
# [*use_forwarded_for*]
|
||||||
|
# (optional) Treat X-Forwarded-For as the canonical remote address. Only
|
||||||
|
# enable this if you have a sanitizing proxy.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
|
# DEPRECATED PARAMETERS
|
||||||
|
#
|
||||||
# [*os_region_name*]
|
# [*os_region_name*]
|
||||||
# (optional) Some operations require cinder to make API requests
|
# (optional) Some operations require cinder to make API requests
|
||||||
# to Nova. This sets the keystone region to be used for these
|
# to Nova. This sets the keystone region to be used for these
|
||||||
|
@ -134,6 +141,7 @@ class cinder::api (
|
||||||
$ca_file = $::os_service_default,
|
$ca_file = $::os_service_default,
|
||||||
$auth_strategy = 'keystone',
|
$auth_strategy = 'keystone',
|
||||||
$osapi_volume_listen_port = $::os_service_default,
|
$osapi_volume_listen_port = $::os_service_default,
|
||||||
|
$use_forwarded_for = $::os_service_default,
|
||||||
# DEPRECATED PARAMETERS
|
# DEPRECATED PARAMETERS
|
||||||
$os_region_name = undef
|
$os_region_name = undef
|
||||||
) inherits cinder::params {
|
) inherits cinder::params {
|
||||||
|
@ -216,6 +224,7 @@ running as a standalone service, or httpd for being run by a httpd server")
|
||||||
'DEFAULT/osapi_max_limit': value => $osapi_max_limit;
|
'DEFAULT/osapi_max_limit': value => $osapi_max_limit;
|
||||||
'DEFAULT/osapi_volume_listen_port': value => $osapi_volume_listen_port;
|
'DEFAULT/osapi_volume_listen_port': value => $osapi_volume_listen_port;
|
||||||
'DEFAULT/auth_strategy': value => $auth_strategy;
|
'DEFAULT/auth_strategy': value => $auth_strategy;
|
||||||
|
'DEFAULT/use_forwarded_for': value => $use_forwarded_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
oslo::middleware {'cinder_config':
|
oslo::middleware {'cinder_config':
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``cinder::api::use_forwarded_for`` parameter has been added.
|
|
@ -31,6 +31,7 @@ describe 'cinder::api' do
|
||||||
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_base_URL').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_base_URL').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_cinder_config('DEFAULT/osapi_max_limit').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_cinder_config('DEFAULT/osapi_max_limit').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_cinder_config('DEFAULT/auth_strategy').with_value('keystone')
|
is_expected.to contain_cinder_config('DEFAULT/auth_strategy').with_value('keystone')
|
||||||
|
is_expected.to contain_cinder_config('DEFAULT/use_forwarded_for').with_value('<SERVICE DEFAULT>')
|
||||||
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_listen_port').with('value' => '<SERVICE DEFAULT>')
|
is_expected.to contain_cinder_config('DEFAULT/osapi_volume_listen_port').with('value' => '<SERVICE DEFAULT>')
|
||||||
|
|
||||||
is_expected.to contain_oslo__middleware('cinder_config').with(
|
is_expected.to contain_oslo__middleware('cinder_config').with(
|
||||||
|
@ -140,6 +141,17 @@ describe 'cinder::api' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'with a custom use_forwarded_for' do
|
||||||
|
let :params do
|
||||||
|
req_params.merge({'use_forwarded_for' => true})
|
||||||
|
end
|
||||||
|
it 'should configure the osapi_max_limit to 10000' do
|
||||||
|
is_expected.to contain_cinder_config('DEFAULT/use_forwarded_for').with(
|
||||||
|
:value => true
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'with a custom osapi_max_limit' do
|
context 'with a custom osapi_max_limit' do
|
||||||
let :params do
|
let :params do
|
||||||
req_params.merge({'osapi_max_limit' => '10000'})
|
req_params.merge({'osapi_max_limit' => '10000'})
|
||||||
|
@ -150,6 +162,7 @@ describe 'cinder::api' do
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when running cinder-api in wsgi' do
|
context 'when running cinder-api in wsgi' do
|
||||||
let :params do
|
let :params do
|
||||||
req_params.merge!({ :service_name => 'httpd' })
|
req_params.merge!({ :service_name => 'httpd' })
|
||||||
|
|
Loading…
Reference in New Issue