Merge "Expose request_headers option of apache::vhost"

This commit is contained in:
Zuul 2022-07-30 15:56:05 +00:00 committed by Gerrit Code Review
commit 6fd26895a3
3 changed files with 15 additions and 1 deletions

View File

@ -124,6 +124,10 @@
# (Optional) Headers for the vhost.
# Defaults to undef
#
# [*request_headers*]
# (optional) Modifies collected request headers in various ways.
# Defaults to undef
#
# [*vhost_custom_fragment*]
# (Optional) Passes a string of custom configuration
# directives to be placed at the end of the vhost configuration.
@ -161,6 +165,7 @@ class keystone::wsgi::apache (
$error_log_pipe = undef,
$error_log_syslog = undef,
$headers = undef,
$request_headers = undef,
$vhost_custom_fragment = undef,
$custom_wsgi_process_options = {},
) inherits keystone::params {
@ -195,6 +200,7 @@ class keystone::wsgi::apache (
wsgi_pass_authorization => $wsgi_pass_authorization,
wsgi_chunked_request => $wsgi_chunked_request,
headers => $headers,
request_headers => $request_headers,
custom_wsgi_process_options => $custom_wsgi_process_options,
vhost_custom_fragment => $vhost_custom_fragment,
access_log_file => $access_log_file,

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``keystone::wsgi::apache`` class now supports customizing request
headers added by apache.

View File

@ -34,6 +34,7 @@ describe 'keystone::wsgi::apache' do
:wsgi_script_source => '/usr/bin/keystone-wsgi-public',
:wsgi_pass_authorization => 'On',
:headers => nil,
:request_headers => nil,
:custom_wsgi_process_options => {},
:access_log_file => false,
:access_log_pipe => false,
@ -67,7 +68,8 @@ describe 'keystone::wsgi::apache' do
:wsgi_pass_authorization => 'Off',
:wsgi_chunked_request => 'On',
:wsgi_script_source => '/path/to/my/script.py',
:headers => 'set X-Frame-Options "DENY"',
:headers => ['set X-XSS-Protection "1; mode=block"'],
:request_headers => ['set Content-Type "application/json"'],
:vhost_custom_fragment => 'custom',
:custom_wsgi_process_options => { 'python-path' => '/my/python/virtualenv' },
}
@ -94,6 +96,7 @@ describe 'keystone::wsgi::apache' do
:wsgi_chunked_request => params[:wsgi_chunked_request],
:wsgi_script_source => params[:wsgi_script_source],
:headers => params[:headers],
:request_headers => params[:request_headers],
:vhost_custom_fragment => params[:vhost_custom_fragment],
:custom_wsgi_process_options => params[:custom_wsgi_process_options],
)}