From f04b8faf38c24825a1cbb6d943752d14213d16b9 Mon Sep 17 00:00:00 2001 From: Nikhil Palaskar Date: Thu, 9 Feb 2023 16:00:01 -0500 Subject: [PATCH] Remove hyphen from openid-connect section of the endpoints api (#3241) Remove hyphen from openid-connect section of the endpoints API - Getting rid of the excess quotes and brackets would make this easier to read - It also makes it easier to reference in Dashboard javascript code when there is no hyphen involved (endpoints.openid instead of endpoints['openid-connect']) --- lib/pbench/server/api/resources/endpoint_configure.py | 8 ++++---- lib/pbench/test/functional/server/test_connect.py | 6 +++--- lib/pbench/test/unit/server/test_endpoint_configure.py | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/pbench/server/api/resources/endpoint_configure.py b/lib/pbench/server/api/resources/endpoint_configure.py index 1dbd9a3a7c..bb60f582d6 100644 --- a/lib/pbench/server/api/resources/endpoint_configure.py +++ b/lib/pbench/server/api/resources/endpoint_configure.py @@ -178,18 +178,18 @@ def get(self): } try: - secret = self.server_config.get("openid-connect", "secret") client = self.server_config.get("openid-connect", "client") realm = self.server_config.get("openid-connect", "realm") - issuer = self.server_config.get("openid-connect", "server_url") + secret = self.server_config.get("openid-connect", "secret") + server = self.server_config.get("openid-connect", "server_url") except (NoOptionError, NoSectionError): pass else: - endpoints["openid-connect"] = { + endpoints["openid"] = { "client": client, "realm": realm, - "issuer": issuer, "secret": secret, + "server": server, } try: diff --git a/lib/pbench/test/functional/server/test_connect.py b/lib/pbench/test/functional/server/test_connect.py index fb9fe8e891..d29a2f0886 100644 --- a/lib/pbench/test/functional/server/test_connect.py +++ b/lib/pbench/test/functional/server/test_connect.py @@ -28,6 +28,6 @@ def test_connect(self, server_client: PbenchServerClient): assert e in endpoints["uri"].keys() # verify all the required openid-connect fields are present - if "openid-connect" in endpoints: - expected = {"issuer", "client", "realm", "secret"} - assert set(endpoints["openid-connect"]) >= expected + if "openid" in endpoints: + expected = {"server", "client", "realm", "secret"} + assert set(endpoints["openid"]) >= expected diff --git a/lib/pbench/test/unit/server/test_endpoint_configure.py b/lib/pbench/test/unit/server/test_endpoint_configure.py index e81187cc9b..aa5830326a 100644 --- a/lib/pbench/test/unit/server/test_endpoint_configure.py +++ b/lib/pbench/test/unit/server/test_endpoint_configure.py @@ -140,17 +140,17 @@ def check_config(self, client, server_config, host, my_headers={}): try: oidc_client = server_config.get("openid-connect", "client") - oidc_issuer = server_config.get("openid-connect", "server_url") oidc_realm = server_config.get("openid-connect", "realm") oidc_secret = server_config.get("openid-connect", "secret") + oidc_server = server_config.get("openid-connect", "server_url") except (NoOptionError, NoSectionError): pass else: expected_results["openid-connect"] = { "client": oidc_client, - "issuer": oidc_issuer, "realm": oidc_realm, "secret": oidc_secret, + "server": oidc_server, } response = client.get(f"{server_config.rest_uri}/endpoints", headers=my_headers)