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

Add allow_insecure_kernelspec_params to page config #460

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
7 changes: 7 additions & 0 deletions jupyterlab_server/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def get_page_config(self) -> dict[str, Any]:
server_root = self.settings.get("server_root_dir", "")
server_root = server_root.replace(os.sep, "/")
base_url = self.settings.get("base_url")
server_app = self.settings.get("serverapp")
assert server_app is not None
if hasattr(server_app, "allow_insecure_kernelspec_params"):
allow_insecure_kernelspec_params = server_app.allow_insecure_kernelspec_params
else:
allow_insecure_kernelspec_params = False

# Remove the trailing slash for compatibility with html-webpack-plugin.
full_static_url = self.static_url_prefix.rstrip("/")
Expand All @@ -91,6 +97,7 @@ def get_page_config(self) -> dict[str, Any]:
page_config.setdefault("ignorePlugins", [])
page_config.setdefault("serverRoot", server_root)
page_config["store_id"] = self.application.store_id # type:ignore[attr-defined]
page_config.setdefault("allow_insecure_kernelspec_params", allow_insecure_kernelspec_params)

server_root = os.path.normpath(os.path.expanduser(server_root))
preferred_path = ""
Expand Down
1 change: 1 addition & 0 deletions tests/test_labapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def ispath(p):

nondirs = {k: v for k, v in page_config.items() if not ispath(k)}
assert nondirs == {
"allow_insecure_kernelspec_params": False,
"appName": "JupyterLab Server Application",
"appNamespace": "jupyterlab_server",
"appUrl": "/lab",
Expand Down
Loading