dask / dask-labextension

JupyterLab extension for Dask
BSD 3-Clause "New" or "Revised" License
311 stars 62 forks source link

Append any URL query args to dashboard URL paths #258

Closed ntabris closed 1 year ago

ntabris commented 1 year ago

If you enter http://1.2.3.4/status?token=abc as the dashboard address, the existing code will attempt to hit http://1.2.3.4/status?token=abc/individual-plots.json.

This makes it instead hit http://1.2.3.4/individual-plots.json?token=abc, and also append ?token=abc to the paths of the individual plots.

With this change, it's possible to use dask-labextension with a dashboard that has token-based auth. (We're now doing this in Coiled, using an NGINX sidecar in front of the dashboard.)

image
ntabris commented 1 year ago

This addresses (2) and (3) in https://github.com/dask/dask-labextension/issues/190#issuecomment-1434881005

ntabris commented 1 year ago

I'll note that loading static assets is requiring some (yet to be determined) shenanigans on our side.

Since the dashboard panes load in iframe, cookies don't work unless the user enables third-party cookies. Getting the auth token in the referer works in Chrome but not Safari, since Safari intentionally doesn't pass along full referer (again, unless you explicitly disable privacy setting).

Suggestions welcome if anything comes to mind.

ian-r-rose commented 1 year ago

Hmm, nothing comes to mind immediately. How does Firefox do?

ian-r-rose commented 1 year ago

Thanks @ntabris!

ian-r-rose commented 1 year ago

I've published this in 6.1.0

ntabris commented 1 year ago

Thanks, much appreciated!