From 263240ea845b4cc96b8e82e6fa884005023fe78f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 16 Jul 2020 00:29:38 +0900 Subject: [PATCH] Add support for the interface parameter in authtoken middleware This patch adds support for [keystone_authtoken] interface parameter, so that operators can define which endpoint should be used by authtoken middleware. Change-Id: Iebb67609a384ee4c6be1d0f8aff86643ff6775c2 (cherry picked from commit a09758194acee428f793abb975fdd92affcb2314) --- manifests/proxy/authtoken.pp | 7 +++++++ .../keystone-authtoken-interface-a0cdde390fca1a46.yaml | 5 +++++ spec/classes/swift_proxy_authtoken_spec.rb | 3 +++ 3 files changed, 15 insertions(+) create mode 100644 releasenotes/notes/keystone-authtoken-interface-a0cdde390fca1a46.yaml diff --git a/manifests/proxy/authtoken.pp b/manifests/proxy/authtoken.pp index 3d167e27..513d4ace 100644 --- a/manifests/proxy/authtoken.pp +++ b/manifests/proxy/authtoken.pp @@ -75,6 +75,11 @@ # true/false # Defaults to $::os_service_default. # +# [*interface*] +# (Optional) Interface to use for the Identity API endpoint. Valid values are +# "public", "internal" or "admin". +# Defaults to $::os_service_default. +# # == DEPRECATED # # [*identity_uri*] @@ -121,6 +126,7 @@ class swift::proxy::authtoken( $include_service_catalog = false, $service_token_roles = $::os_service_default, $service_token_roles_required = $::os_service_default, + $interface = $::os_service_default, # DEPRECATED PARAMETERS $admin_user = undef, $admin_tenant_name = undef, @@ -188,5 +194,6 @@ class swift::proxy::authtoken( 'filter:authtoken/include_service_catalog': value => $include_service_catalog; 'filter:authtoken/service_token_roles': value => $service_token_roles; 'filter:authtoken/service_token_roles_required': value => $service_token_roles_required; + 'filter:authtoken/interface': value => $interface, } } diff --git a/releasenotes/notes/keystone-authtoken-interface-a0cdde390fca1a46.yaml b/releasenotes/notes/keystone-authtoken-interface-a0cdde390fca1a46.yaml new file mode 100644 index 00000000..d274835f --- /dev/null +++ b/releasenotes/notes/keystone-authtoken-interface-a0cdde390fca1a46.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + The new ``swift::proxy::authtoken::interface`` parameter has been added, + which can be used to set the interface parameter in authtoken middleware. diff --git a/spec/classes/swift_proxy_authtoken_spec.rb b/spec/classes/swift_proxy_authtoken_spec.rb index 2b2844f1..d68cabb0 100644 --- a/spec/classes/swift_proxy_authtoken_spec.rb +++ b/spec/classes/swift_proxy_authtoken_spec.rb @@ -35,6 +35,7 @@ describe 'swift::proxy::authtoken' do it { is_expected.to contain_swift_proxy_config('filter:authtoken/include_service_catalog').with_value('false') } it { is_expected.to contain_swift_proxy_config('filter:authtoken/service_token_roles').with_value('') } it { is_expected.to contain_swift_proxy_config('filter:authtoken/service_token_roles_required').with_value('') } + it { is_expected.to contain_swift_proxy_config('filter:authtoken/interface').with_value('') } end describe "when overriding parameters" do @@ -49,6 +50,7 @@ describe 'swift::proxy::authtoken' do :signing_dir => '/home/swift/keystone-signing', :service_token_roles => ['service'], :service_token_roles_required => true, + :interface => 'internal', } end @@ -69,6 +71,7 @@ describe 'swift::proxy::authtoken' do it { is_expected.to contain_swift_proxy_config('filter:authtoken/include_service_catalog').with_value('false') } 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') } end describe 'when overriding www_authenticate_uri' do