Skip to content

Commit

Permalink
Remove hyphen from openid-connect section of the endpoints api (#3241)
Browse files Browse the repository at this point in the history
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'])
  • Loading branch information
npalaska committed Mar 13, 2023
1 parent d9c95e6 commit 1a85a27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lib/pbench/server/api/resources/endpoint_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions lib/pbench/test/functional/server/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions lib/pbench/test/unit/server/test_endpoint_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,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)
Expand Down

0 comments on commit 1a85a27

Please sign in to comment.