Skip to content

Commit

Permalink
fix some left over gaps
Browse files Browse the repository at this point in the history
  • Loading branch information
npalaska committed Mar 30, 2023
1 parent 405d5c7 commit 81d5612
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
16 changes: 16 additions & 0 deletions dashboard/src/utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,19 @@ export const uid = () => {

return head + tail;
};

/**
* Expand a templated API URI like a Python `.format`
*
* @param {Object} endpoints - endpoint object from server
* @param {string} name - name of the API to expand
* @param {Object} args - value for each templated parameter
* @return {string} - formatted URI
*/
export const expandUriTemplate = (endpoints, name, args) => {
let uri = endpoints.uri[name].template;
for (const [key, value] of Object.entries(args)) {
uri = uri.replace(`{${key}}`, value);
}
return uri;
};
6 changes: 3 additions & 3 deletions lib/pbench/server/api/resources/endpoint_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def get(self):
}

try:
client = self.server_config.get("openid-connect", "client")
realm = self.server_config.get("openid-connect", "realm")
server = self.server_config.get("openid-connect", "server_url")
client = self.server_config.get("openid", "client")
realm = self.server_config.get("openid", "realm")
server = self.server_config.get("openid", "server_url")
except (NoOptionError, NoSectionError):
pass
else:
Expand Down
2 changes: 1 addition & 1 deletion lib/pbench/server/database/models/users.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import enum
from typing import Optional, Union
from typing import Optional

from sqlalchemy import Column, String
from sqlalchemy.exc import IntegrityError
Expand Down
2 changes: 1 addition & 1 deletion server/pbenchinacan/etc/pbench-server/pbench-server.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ uri = postgresql://pbenchcontainer:pbench@localhost:5432/pbenchcontainer
[flask-app]
secret-key = "pbench-in-a-can secret shhh"

[openid-connect]
[openid]
server_url = http://localhost:8090

###########################################################################
Expand Down
2 changes: 1 addition & 1 deletion server/pbenchinacan/run-pbench-in-a-can
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export PB_SERVER_IMAGE_PULL_POLICY="${PB_SERVER_IMAGE_PULL_POLICY:-${PB_COMMON_I
export PB_DASHBOARD_DIR="${PB_DASHBOARD_DIR:-${PWD}/dashboard/build/}"

export KEYCLOAK_REALM=${KEYCLOAK_REALM:-"pbench-server"}
export KEYCLOAK_CLIENT=${KEYCLOAK_CLIENT:-"pbench-dashboard"}
export KEYCLOAK_CLIENT=${KEYCLOAK_CLIENT:-"pbench-client"}

# Set up TMP_DIR, if it's not already defined, to point to WORKSPACE_TMP, if it
# is defined (e.g., by the CI), or to `/var/tmp/pbench` as a fallback.
Expand Down

0 comments on commit 81d5612

Please sign in to comment.