From a51fdfbcfde8e04a20f711121ac899598dc980c8 Mon Sep 17 00:00:00 2001 From: Carles Garcia Cabot Date: Tue, 13 Oct 2020 15:25:44 +0200 Subject: [PATCH 1/2] migrated from py2 --- src/fts3rest/fts3rest/config/config.py | 3 +-- src/fts3rest/fts3rest/lib/openidconnect.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fts3rest/fts3rest/config/config.py b/src/fts3rest/fts3rest/config/config.py index 5228aa2..e84a2b4 100644 --- a/src/fts3rest/fts3rest/config/config.py +++ b/src/fts3rest/fts3rest/config/config.py @@ -105,8 +105,7 @@ def fts3_config_load(path="/etc/fts3/ftsrestconfig", test=False): if "_" not in option: provider_name = option provider_url = parser.get("providers", provider_name) - if not provider_url.endswith("/"): - provider_url += "/" + fts3cfg["fts3.Providers"][provider_url] = {} client_id = parser.get("providers", option + "_ClientId") fts3cfg["fts3.Providers"][provider_url]["client_id"] = client_id diff --git a/src/fts3rest/fts3rest/lib/openidconnect.py b/src/fts3rest/fts3rest/lib/openidconnect.py index 1024e6e..cd83466 100644 --- a/src/fts3rest/fts3rest/lib/openidconnect.py +++ b/src/fts3rest/fts3rest/lib/openidconnect.py @@ -42,7 +42,8 @@ class OIDCmanager: client_secret=providers_config[provider]["client_secret"], ) client.store_registration_info(client_reg) - self.clients[provider] = client + issuer = client.provider_info["issuer"] + self.clients[issuer] = client def _retrieve_clients_keys(self): for provider in self.clients: -- GitLab From c4b31daf31e2d8bcbf75a20683c9c66aa049cbf1 Mon Sep 17 00:00:00 2001 From: Carles Garcia Cabot Date: Wed, 21 Oct 2020 11:24:24 +0200 Subject: [PATCH 2/2] try fix --- src/fts3rest/fts3rest/config/config.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fts3rest/fts3rest/config/config.py b/src/fts3rest/fts3rest/config/config.py index e84a2b4..64dcaeb 100644 --- a/src/fts3rest/fts3rest/config/config.py +++ b/src/fts3rest/fts3rest/config/config.py @@ -105,6 +105,8 @@ def fts3_config_load(path="/etc/fts3/ftsrestconfig", test=False): if "_" not in option: provider_name = option provider_url = parser.get("providers", provider_name) + if test and not provider_url.endswith("/"): + provider_url += "/" fts3cfg["fts3.Providers"][provider_url] = {} client_id = parser.get("providers", option + "_ClientId") -- GitLab