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

Append any URL query args to dashboard URL paths #258

Merged
merged 3 commits into from
Feb 19, 2023

Conversation

ntabris
Copy link
Contributor

@ntabris ntabris commented Feb 18, 2023

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
Copy link
Contributor Author

ntabris commented Feb 18, 2023

This addresses (2) and (3) in #190 (comment)

Copy link
Collaborator

@ian-r-rose ian-r-rose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ntabris! Yes, I was a bit hasty in my comment, and (1) isn't necessary for this use-case.

One minor fix, but I think this otherwise looks good.

dask_labextension/dashboardhandler.py Outdated Show resolved Hide resolved
@ntabris
Copy link
Contributor Author

ntabris commented Feb 18, 2023

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
Copy link
Collaborator

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

@ian-r-rose
Copy link
Collaborator

Thanks @ntabris!

@ian-r-rose ian-r-rose merged commit f638295 into dask:main Feb 19, 2023
@ian-r-rose
Copy link
Collaborator

I've published this in 6.1.0

@ntabris
Copy link
Contributor Author

ntabris commented Feb 19, 2023

Thanks, much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants