diff --git a/manifests/api.pp b/manifests/api.pp index b18717d2..c945b12e 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -39,6 +39,11 @@ # (optional) Type of authentication to be used. # Defaults to 'keystone' # +# [*enable_proxy_headers_parsing*] +# (Optional) Enable paste middleware to handle SSL requests through +# HTTPProxyToWSGI middleware. +# Defaults to $::os_service_default. +# # = DEPRECATED PARAMETERS # # [*keystone_identity_uri*] @@ -90,6 +95,7 @@ class aodh::api ( $service_name = $::aodh::params::api_service_name, $sync_db = false, $auth_strategy = 'keystone', + $enable_proxy_headers_parsing = $::os_service_default, # DEPRECATED PARAMETERS $keystone_identity_uri = undef, $keystone_user = undef, @@ -202,4 +208,7 @@ as a standalone service, or httpd for being run by a httpd server") 'api/port': value => $port; } + oslo::middleware { 'aodh_config': + enable_proxy_headers_parsing => $enable_proxy_headers_parsing, + } } diff --git a/releasenotes/notes/adds-enable-proxy-headers-parsing-531db7e45428d03d.yaml b/releasenotes/notes/adds-enable-proxy-headers-parsing-531db7e45428d03d.yaml new file mode 100644 index 00000000..3f798751 --- /dev/null +++ b/releasenotes/notes/adds-enable-proxy-headers-parsing-531db7e45428d03d.yaml @@ -0,0 +1,4 @@ +--- +features: + - This adds the enable_proxy_headers parsing option which is used by the + http_proxy_to_wsgi middleware. diff --git a/spec/classes/aodh_api_spec.rb b/spec/classes/aodh_api_spec.rb index 81b0d52a..4c277141 100644 --- a/spec/classes/aodh_api_spec.rb +++ b/spec/classes/aodh_api_spec.rb @@ -33,6 +33,7 @@ describe 'aodh::api' do it 'configures api' do is_expected.to contain_aodh_config('api/host').with_value( params[:host] ) is_expected.to contain_aodh_config('api/port').with_value( params[:port] ) + is_expected.to contain_aodh_config('oslo_middleware/enable_proxy_headers_parsing').with_value('') end [{:enabled => true}, {:enabled => false}].each do |param_hash| @@ -63,6 +64,13 @@ describe 'aodh::api' do it { is_expected.to contain_class('aodh::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_aodh_config('oslo_middleware/enable_proxy_headers_parsing').with_value(true) } + end context 'with deprecated parameters' do before do