Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hyphen from openid-connect section of the endpoints api #3241

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "OpenID Connect" could be shortened to oidc if we really need it that short?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brevity is not the issue; what we're trying to do is to make it be a valid Javascript identifier, which means removing the hyphen.

"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 @@ -140,17 +140,17 @@ def check_config(self, client, server_config, host, my_headers={}):

try:
oidc_client = server_config.get("openid-connect", "client")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, these lists were in sorted order.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I support keeping the list in sorted order.

On another note, @portante, when commenting on multiple lines, you can drag-select to highlight the range, and doing so has two effects: first, in the "Conversation" display, your comment will be preceded by the code from the range (instead of the default three or so lines), and, second and more importantly, your comment will be displayed after the range (in this instance, it would have made clear what you meant by "these lists").

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