Skip to content

Commit

Permalink
jupyter-health: point staging to new Berkeley JHE
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Dec 6, 2024
1 parent c98bb31 commit a51fb29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 6 additions & 3 deletions config/clusters/jupyter-health/common.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ jupyterhub:
extraConfig:
# get organization membership for managed groups:
managed_organizations.py: |
from urllib.parse import urlparse
async def auth_state_hook(authenticator, auth_state):
if not auth_state:
return auth_state
access_token = auth_state["access_token"]
org_url = "https://jhe.fly.dev/api/v1/users/organizations"
url = urlparse(self.authorize_url)
org_url = f"{url.scheme}://{url.netloc}/api/v1/users/organizations"
organizations = await authenticator.httpfetch(
org_url,
headers={"Authorization": f"Bearer {access_token}"}
Expand All @@ -101,8 +104,7 @@ jupyterhub:
spawner.log.warning(f"Missing auth state for user {spawner.user.name}")
return
spawner.environment["JHE_TOKEN"] = auth_state["access_token"]
spawner.environment["JHE_REFRESH_TOKEN"] = auth_state["refresh_token"]
spawner.environment["JHE_CLIENT_ID"] = "Ima7rx8D6eko0PzlU1jK28WBUT2ZweZj7mqVG2wm"
spawner.environment["JHE_CLIENT_ID"] = self.client_id
c.Spawner.auth_state_hook = auth_state_env
Expand All @@ -122,6 +124,7 @@ jupyterhub:
extraEnv:
GH_SCOPED_CREDS_CLIENT_ID: Iv23lilZjNoav2oWKdPJ
GH_SCOPED_CREDS_APP_URL: https://github.com/apps/jupyter-health-demostration-hub
JHE_URL: https://jhe.fly.dev
image:
name: quay.io/jupyterhealth/singleuser-premvp
tag: "latest"
Expand Down
7 changes: 7 additions & 0 deletions config/clusters/jupyter-health/staging.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ jupyterhub:
config:
GenericOAuthenticator:
oauth_callback_url: https://staging.jupyter-health.2i2c.cloud/hub/oauth_callback
client_id: Ima7rx8D6eko0PzlU1jK28WBUT2ZweZj7mqVG2wm
authorize_url: https://berkeley-jhe-staging.jupyterhealth.org/o/authorize/
token_url: https://berkeley-jhe-staging.jupyterhealth.org/o/token/
userdata_url: https://berkeley-jhe-staging.jupyterhealth.org/api/v1/users/profile
login_service: JupyterHealth Exchange (staging)
singleuser:
extraEnv:
JHE_URL: https://berkeley-jhe-staging.jupyterhealth.org
nodeSelector:
2i2c/hub-name: staging

0 comments on commit a51fb29

Please sign in to comment.