[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:
@@ -17,13 +17,23 @@
|
|||||||
# (boolean value)
|
# (boolean value)
|
||||||
# Defaults to $::os_service_default.
|
# 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(
|
define oslo::middleware(
|
||||||
|
# sizelimit
|
||||||
$max_request_body_size = $::os_service_default,
|
$max_request_body_size = $::os_service_default,
|
||||||
|
# http_proxy_to_wsgi
|
||||||
$enable_proxy_headers_parsing = $::os_service_default,
|
$enable_proxy_headers_parsing = $::os_service_default,
|
||||||
|
# basic_auth
|
||||||
|
$http_basic_auth_user_file = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
$middleware_options = {
|
$middleware_options = {
|
||||||
'oslo_middleware/max_request_body_size' => { value => $max_request_body_size },
|
'oslo_middleware/max_request_body_size' => { value => $max_request_body_size },
|
||||||
'oslo_middleware/enable_proxy_headers_parsing' => { value => $enable_proxy_headers_parsing },
|
'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)
|
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
|
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/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/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
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -19,11 +20,13 @@ describe 'oslo::middleware' do
|
|||||||
{
|
{
|
||||||
:max_request_body_size => 114600,
|
:max_request_body_size => 114600,
|
||||||
:enable_proxy_headers_parsing => true,
|
:enable_proxy_headers_parsing => true,
|
||||||
|
:http_basic_auth_user_file => '/etc/htpasswd',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
it 'configure oslo_middleware with overridden values' do
|
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/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/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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user