Add enable_proxy_headers_parsing option

The patch enables paste middleware to handle SSL requests through
HTTPProxyToWSGI middleware.

Change-Id: I983303878f79b6cf2b1cc0dbc028878924c6ab6d
This commit is contained in:
ZhongShengping 2016-10-28 20:26:23 +08:00
parent 5ae76a1906
commit 08fba1952f
3 changed files with 33 additions and 10 deletions

View File

@ -49,17 +49,23 @@
# Can be set to noauth and keystone.
# Defaults to 'keystone'.
#
# [*enable_proxy_headers_parsing*]
# (Optional) Enable paste middleware to handle SSL requests through
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
class panko::api (
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$host = '0.0.0.0',
$port = '8779',
$workers = $::os_workers,
$max_limit = 1000,
$service_name = $::panko::params::api_service_name,
$sync_db = false,
$auth_strategy = 'keystone',
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
$host = '0.0.0.0',
$port = '8779',
$workers = $::os_workers,
$max_limit = 1000,
$service_name = $::panko::params::api_service_name,
$sync_db = false,
$auth_strategy = 'keystone',
$enable_proxy_headers_parsing = $::os_service_default,
) inherits panko::params {
include ::panko::policy
@ -134,4 +140,8 @@ class panko::api (
}
}
oslo::middleware { 'panko_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
}
}

View File

@ -0,0 +1,4 @@
---
features:
- This adds the enable_proxy_headers parsing option which is used by the
http_proxy_to_wsgi middleware.

View File

@ -38,6 +38,7 @@ describe 'panko::api' do
is_expected.to contain_panko_config('api/port').with_value( params[:port] )
is_expected.to contain_panko_config('api/max_limit').with_value( params[:max_limit] )
is_expected.to contain_panko_config('api/workers').with_value('2')
is_expected.to contain_panko_config('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>')
end
[{:enabled => true}, {:enabled => false}].each do |param_hash|
@ -68,6 +69,14 @@ describe 'panko::api' do
it { is_expected.to contain_class('panko::db::sync') }
end
context 'with enable_proxy_headers_parsing' do
before do
params.merge!({:enable_proxy_headers_parsing => true })
end
it { is_expected.to contain_panko_config('oslo_middleware/enable_proxy_headers_parsing').with_value(true) }
end
context 'with disabled service managing' do
before do
params.merge!({