Replace deprecated auth_plugin by auth_type

The auth_plugin parameter was deprecated a while ago in keystoneauth
and should be replaced by auth_type. This patch updates the parameter
accordingly.

[1] a56ed4218a

Change-Id: If8289993f494ebebdc125a71cc482b658acf4d51
This commit is contained in:
Takashi Kajinami 2020-09-24 18:00:21 +09:00
parent 2c3a746d06
commit 5722f7149c
3 changed files with 31 additions and 6 deletions

View File

@ -21,7 +21,7 @@
# (Optional) The URL to use for authentication.
# Defaults to 'http://127.0.0.1:5000'
#
# [*auth_plugin*]
# [*auth_type*]
# (Optional) The plugin for authentication
# Defaults to 'password'
#
@ -82,6 +82,10 @@
# The cache directory for signing certificates.
# Defaults to undef
#
# [*auth_plugin*]
# (Optional) The plugin for authentication
# Defaults to undef
#
# == Authors
#
# Dan Bode dan@puppetlabs.com
@ -95,7 +99,7 @@ class swift::proxy::authtoken(
$cache = 'swift.cache',
$www_authenticate_uri = 'http://127.0.0.1:5000',
$auth_url = 'http://127.0.0.1:5000',
$auth_plugin = 'password',
$auth_type = 'password',
$project_domain_id = 'default',
$user_domain_id = 'default',
$project_name = 'services',
@ -107,7 +111,8 @@ class swift::proxy::authtoken(
$service_token_roles_required = $::os_service_default,
$interface = $::os_service_default,
# DEPRECATED PARAMETERS
$signing_dir = undef
$signing_dir = undef,
$auth_plugin = undef,
) inherits swift::params {
include swift::deps
@ -124,12 +129,19 @@ Please set password parameter')
warning('The signing_dir parameter was deprecated and has no effect')
}
if $auth_plugin != undef {
warning('auth_plugin is deprecated. please use auth_type instead')
$auth_type_real = $auth_plugin
} else {
$auth_type_real = $auth_type
}
swift_proxy_config {
'filter:authtoken/log_name': value => 'swift';
'filter:authtoken/paste.filter_factory': value => 'keystonemiddleware.auth_token:filter_factory';
'filter:authtoken/www_authenticate_uri': value => $www_authenticate_uri;
'filter:authtoken/auth_url': value => $auth_url;
'filter:authtoken/auth_plugin': value => $auth_plugin;
'filter:authtoken/auth_type': value => $auth_type_real;
'filter:authtoken/project_domain_id': value => $project_domain_id;
'filter:authtoken/user_domain_id': value => $user_domain_id;
'filter:authtoken/project_name': value => $project_name;
@ -143,4 +155,9 @@ Please set password parameter')
'filter:authtoken/service_token_roles_required': value => $service_token_roles_required;
'filter:authtoken/interface': value => $interface,
}
# cleanup the deprecated parameter
swift_proxy_config {
'filter:authtoken/auth_plugin': ensure => 'absent';
}
}

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
The ``swift::proxy::authtoken::auth_plugin`` parameter has been deprecated
and will be removed in a future release. Use the ``auth_type`` parameter
instead.

View File

@ -7,7 +7,7 @@ describe 'swift::proxy::authtoken' do
it { is_expected.to contain_swift_proxy_config('filter:authtoken/paste.filter_factory').with_value('keystonemiddleware.auth_token:filter_factory') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/www_authenticate_uri').with_value('http://127.0.0.1:5000') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_url').with_value('http://127.0.0.1:5000') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_plugin').with_value('password') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_type').with_value('password') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/project_domain_id').with_value('default') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/user_domain_id').with_value('default') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/project_name').with_value('services') }
@ -20,6 +20,7 @@ describe 'swift::proxy::authtoken' do
it { is_expected.to contain_swift_proxy_config('filter:authtoken/service_token_roles').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/service_token_roles_required').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/interface').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_plugin').with_ensure('absent') }
end
describe "when overriding parameters" do
@ -41,7 +42,7 @@ describe 'swift::proxy::authtoken' do
it { is_expected.to contain_swift_proxy_config('filter:authtoken/paste.filter_factory').with_value('keystonemiddleware.auth_token:filter_factory') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/www_authenticate_uri').with_value('http://127.0.0.1:5000') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_url').with_value('http://127.0.0.1:5000') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_plugin').with_value('password') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_type').with_value('password') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/project_domain_id').with_value('default') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/user_domain_id').with_value('default') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/project_name').with_value('admin') }
@ -54,6 +55,7 @@ describe 'swift::proxy::authtoken' do
it { is_expected.to contain_swift_proxy_config('filter:authtoken/service_token_roles').with_value(['service']) }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/service_token_roles_required').with_value(true) }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/interface').with_value('internal') }
it { is_expected.to contain_swift_proxy_config('filter:authtoken/auth_plugin').with_ensure('absent') }
end
describe 'when overriding www_authenticate_uri' do