[oslo.middleware] Add support for basic auth middleware options
This change introduces support for options of basic auth middleware[1], which was implemented during the Xena cycle. [1] da7987ca926e9bd82ff2989a920ea9740da24f95 Change-Id: I6dc1b1bd1f49ffa6e49e5e08e2462974c89309f5
This commit is contained in:
parent
cd984ba49f
commit
ce716972b9
@ -17,13 +17,23 @@
|
||||
# (boolean value)
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*http_basic_auth_user_file*]
|
||||
# (Optional) HTTP basic auth password file.
|
||||
# (string value)
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
define oslo::middleware(
|
||||
# sizelimit
|
||||
$max_request_body_size = $::os_service_default,
|
||||
# http_proxy_to_wsgi
|
||||
$enable_proxy_headers_parsing = $::os_service_default,
|
||||
# basic_auth
|
||||
$http_basic_auth_user_file = $::os_service_default,
|
||||
) {
|
||||
$middleware_options = {
|
||||
'oslo_middleware/max_request_body_size' => { value => $max_request_body_size },
|
||||
'oslo_middleware/enable_proxy_headers_parsing' => { value => $enable_proxy_headers_parsing },
|
||||
'oslo_middleware/http_basic_auth_user_file' => { value => $http_basic_auth_user_file },
|
||||
}
|
||||
create_resources($name, $middleware_options)
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``oslo::middleware::http_basic_auth_userfile`` parameter has been
|
||||
added.
|
@ -10,6 +10,7 @@ describe 'oslo::middleware' do
|
||||
it 'configure oslo_middleware default params' do
|
||||
is_expected.to contain_keystone_config('oslo_middleware/max_request_body_size').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_keystone_config('oslo_middleware/enable_proxy_headers_parsing').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_keystone_config('oslo_middleware/http_basic_auth_user_file').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
|
||||
end
|
||||
@ -17,13 +18,15 @@ describe 'oslo::middleware' do
|
||||
context 'with overridden parameters' do
|
||||
let :params do
|
||||
{
|
||||
:max_request_body_size => 114600,
|
||||
:max_request_body_size => 114600,
|
||||
:enable_proxy_headers_parsing => true,
|
||||
:http_basic_auth_user_file => '/etc/htpasswd',
|
||||
}
|
||||
end
|
||||
it 'configure oslo_middleware with overridden values' do
|
||||
is_expected.to contain_keystone_config('oslo_middleware/max_request_body_size').with_value(114600)
|
||||
is_expected.to contain_keystone_config('oslo_middleware/enable_proxy_headers_parsing').with_value(true)
|
||||
is_expected.to contain_keystone_config('oslo_middleware/http_basic_auth_user_file').with_value('/etc/htpasswd')
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user