solara
solara copied to clipboard
_solara/cdn is broken in jupyter notebook classic
Seems to be because of jupyter server. Tested (and fails) with
solara: development install, ~1.38.0
notebook: 6.4.13 - 6.5.7
server: 2.13.0 - 2.14.2
Works with jupyter_server<2
The error we get is:
GET http://localhost:8889/_solara/cdn/[email protected]/dist/mermaid.min.js?v=20240830132155 net::ERR_TOO_MANY_REDIRECTS
We suspect this is caused by the need for authentication in jupyter server, see this warning here
@property
def authorizer(self) -> Authorizer:
if "authorizer" not in self.settings:
warnings.warn(
"The Tornado web application does not have an 'authorizer' defined "
"in its settings. In future releases of jupyter_server, this will "
"be a required key for all subclasses of `JupyterHandler`. For an "
"example, see the jupyter_server source code for how to "
"add an authorizer to the tornado settings: "
"https://github.com/jupyter-server/jupyter_server/blob/"
"653740cbad7ce0c8a8752ce83e4d3c2c754b13cb/jupyter_server/serverapp.py"
"#L234-L256",
stacklevel=2,
)
from jupyter_server.auth import AllowAllAuthorizer
self.settings["authorizer"] = AllowAllAuthorizer(
config=self.settings.get("config", None),
identity_provider=self.identity_provider,
)
return cast("Authorizer", self.settings.get("authorizer"))
This is how they advice for it to be implemented:
if identity_provider is None:
warnings.warn(
"identity_provider unspecified. Using default IdentityProvider."
" Specify an identity_provider to avoid this message.",
RuntimeWarning,
stacklevel=2,
)
identity_provider = IdentityProvider(parent=jupyter_app)