Merge "[oslo.middleware] Add support for basic auth middleware options"

This commit is contained in:
Zuul
2021年08月24日 09:13:42 +00:00
committed by Gerrit Code Review

View File

@@ -17,13 +17,23 @@
#(booleanvalue)
#Defaultsto$::os_service_default.
#
#[*http_basic_auth_user_file*]
#(Optional)HTTPbasicauthpasswordfile.
#(stringvalue)
#Defaultsto$::os_service_default.
#
defineoslo::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)
}

View File

@@ -0,0 +1,5 @@
---
features:
- |
The new ``oslo::middleware::http_basic_auth_userfile`` parameter has been
added.

View File

@@ -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
Reference in New Issue
openstack/puppet-oslo
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.