From a10859d417b6d73fe68745d0e983b7028bae2c5b Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Wed, 20 Dec 2023 12:17:51 +0100 Subject: [PATCH] Fix auth issue --- .../src/chauthenticator/chauthenticator/auth.py | 5 +---- .../src/osb_jupyter/osb_jupyter/__init__.py | 2 +- .../{jupyterhub.py => osb_jupyterhub.py} | 8 ++++++++ .../jupyterlab-minimal/overrides/index.html | 15 ++------------- .../osb-portal/deploy/values-minimal.yaml | 2 +- .../src/components/workspace/WorkspaceFrame.tsx | 8 +++++++- 6 files changed, 20 insertions(+), 20 deletions(-) rename applications/jupyterhub/src/osb_jupyter/osb_jupyter/{jupyterhub.py => osb_jupyterhub.py} (96%) mode change 100755 => 100644 diff --git a/applications/jupyterhub/src/chauthenticator/chauthenticator/auth.py b/applications/jupyterhub/src/chauthenticator/chauthenticator/auth.py index 9eccfc8a..662029f7 100644 --- a/applications/jupyterhub/src/chauthenticator/chauthenticator/auth.py +++ b/applications/jupyterhub/src/chauthenticator/chauthenticator/auth.py @@ -112,10 +112,7 @@ def get_handlers(self, app): 'process_user': self.process_user } return [ - ('/chkclogin', CloudHarnessAuthenticateHandler, extra_settings), - ('/nwbfile=.*', CloudHarnessAuthenticateHandler, extra_settings), - ('/open=.*', CloudHarnessAuthenticateHandler, extra_settings), - ('/query?.*', CloudHarnessAuthenticateHandler, extra_settings), + ('.*', CloudHarnessAuthenticateHandler, extra_settings), ] def login_url(self, base_url): diff --git a/applications/jupyterhub/src/osb_jupyter/osb_jupyter/__init__.py b/applications/jupyterhub/src/osb_jupyter/osb_jupyter/__init__.py index 15108b11..ed3a02bb 100755 --- a/applications/jupyterhub/src/osb_jupyter/osb_jupyter/__init__.py +++ b/applications/jupyterhub/src/osb_jupyter/osb_jupyter/__init__.py @@ -1 +1 @@ -from .jupyterhub import change_pod_manifest +from .osb_jupyterhub import change_pod_manifest diff --git a/applications/jupyterhub/src/osb_jupyter/osb_jupyter/jupyterhub.py b/applications/jupyterhub/src/osb_jupyter/osb_jupyter/osb_jupyterhub.py old mode 100755 new mode 100644 similarity index 96% rename from applications/jupyterhub/src/osb_jupyter/osb_jupyter/jupyterhub.py rename to applications/jupyterhub/src/osb_jupyter/osb_jupyter/osb_jupyterhub.py index 02b10934..3c403bc8 --- a/applications/jupyterhub/src/osb_jupyter/osb_jupyter/jupyterhub.py +++ b/applications/jupyterhub/src/osb_jupyter/osb_jupyter/osb_jupyterhub.py @@ -7,10 +7,18 @@ from cloudharness import applications from cloudharness.auth.exceptions import UserNotFound from urllib.parse import parse_qs, urlparse +from jupyterhub.handlers.pages import SpawnHandler allowed_chars = set( "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ") +old_get = SpawnHandler.get + +async def get(self, for_user=None, server_name=''): + print("get spawn", for_user, server_name) + return old_get(self, for_user=None, server_name=server_name) + +SpawnHandler.get = get def affinity_spec(key, value): return { diff --git a/applications/jupyterlab-minimal/overrides/index.html b/applications/jupyterlab-minimal/overrides/index.html index 0a0a9542..f8fee6e8 100644 --- a/applications/jupyterlab-minimal/overrides/index.html +++ b/applications/jupyterlab-minimal/overrides/index.html @@ -1,18 +1,7 @@ - - - JupyterLab - {# Copy so we do not modify the page_config with - updates. #} {% set page_config_full = page_config.copy() %} {# Set a dummy variable - we just want the side effect - of the update. #} {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %} - {% block favicon %} - - - {% endblock %} - - +JupyterLab{# Copy so we do not modify the page_config with updates. #} {% set page_config_full = page_config.copy() %} {# Set a dummy variable - we just want the side effect of the update. #} {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %}{% block favicon %}{% endblock %}