From e63d813a70eb4b841937a4e8a06a55e85d3ea97d Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Fri, 31 Jul 2020 13:45:46 +0300 Subject: [PATCH] Use 'barbican_endpoint_type'config option to get endpoint from catalog _get_barbican_endpoint now uses barbican_endpoint_type config option to retrieve a correct endpoint from catalog. This config option is set to 'public' by default and it's a default value for ServiceCatalog.endpoint_data_for method. It means that the default behaviour will be the same as before this patch. Change-Id: Idf4061fe3e35e3c47a993a56b23c0257c92e5cc3 --- castellan/key_manager/barbican_key_manager.py | 3 ++- ...rbican-endpoint-type-config-option-e583d30930cc22ba.yaml | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/use-barbican-endpoint-type-config-option-e583d30930cc22ba.yaml diff --git a/castellan/key_manager/barbican_key_manager.py b/castellan/key_manager/barbican_key_manager.py index 0fe63b88..9d01c846 100644 --- a/castellan/key_manager/barbican_key_manager.py +++ b/castellan/key_manager/barbican_key_manager.py @@ -193,7 +193,8 @@ class BarbicanKeyManager(key_manager.KeyManager): return barbican.barbican_endpoint elif getattr(auth, 'service_catalog', None): endpoint_data = auth.service_catalog.endpoint_data_for( - service_type='key-manager') + service_type='key-manager', + interface=barbican.barbican_endpoint_type) return endpoint_data.url else: service_parameters = {'service_type': 'key-manager', diff --git a/releasenotes/notes/use-barbican-endpoint-type-config-option-e583d30930cc22ba.yaml b/releasenotes/notes/use-barbican-endpoint-type-config-option-e583d30930cc22ba.yaml new file mode 100644 index 00000000..11baafde --- /dev/null +++ b/releasenotes/notes/use-barbican-endpoint-type-config-option-e583d30930cc22ba.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + ``barbican_endpoint_type`` is now used to retrieve Barbican endpoint URL + from service catalog. This config option is set to 'public' by default so + it will not change the current behaviour.