-
Notifications
You must be signed in to change notification settings - Fork 149
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
propagate check_origin of JupyterHandler to enable CORS websocket access #295
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
This issue could be related/fixed by this PR #248. |
6c3b0a6
to
b4d11f0
Compare
@consideRatio could you maybe take a look at this, please? this would be very useful for us, too. 🙂 |
@fhoehle I think for this PR to be accepted, i think it will need to not make the project require jupyter_server. These questions will likely be relevant to address, and anyones thoughts about those would be useful review input.
@manics @minrk @yuvipanda - this is at least a small PR in lines of code changed, but I'm not knowledgeable enough about this project or about CORS to review this. Could you give it a glance? |
@consideRatio I think jupyter_server is already required. I think this is fine, but I also think it can be simpler by putting it on the base ProxyHandler, as is done in jupyter_server when a class needs to inherit from WebSocketHandler before JupyterHandler: def check_origin(self, origin=None):
return JupyterHandler.check_origin(self, origin) |
b4d11f0
to
4c9f351
Compare
@consideRatio and @minrk thanks for your review and input.
I adapted the PR according to @minrk proposal. In the beginning I was unsure if would be more suitable to add the reassignement of |
Thanks @minrk for helping out! Does this LGTY now? |
Yes, thank you! |
I labelled this as a bugfix, is that reasonable with regards to how it will be listed in the changelog. Is it an enhancement, or breaking change? |
I would consider this an enhancement. Because this functionality could achieved by overwriting the origin header by the inverting proxy. |
@fhoehle what about breaking / non-breaking change? |
@consideRatio I would see it as non breaking, because existing configuration does not become invalid. But if someone is using this on an exposed system without any proxy service web-sockets will become accessible. It would be very helpful for me to use a release including this functionality. Would that be possible @consideRatio @minrk ? Do you need more input besides the points already mentioned? |
Bugfix is a fine label for changelog purposes, since it fixes the code's behavior to do what it is intended to do. While it's technically conceivable to rely on the incorrect behavior, I wouldn't consider fixing that a breaking change. It's very common for changes to not cleanly divide into bug/enhancement/feature/etc. and I would like to avoid spending too much time on the labeling, as long as it gets a label.
No, I think this is all done. Just need to get the release ready. |
@minrk thanks! |
Thanks for this extremly helpful package. Exposing applications like
code-server
usingjupyter-vscode-proxy
via an inverting proxy e.g.gcr.io/inverting-proxy
fails due to not allowed cross origin websockets. This seccurity rule was introduced intornado>=4
seecheck_origin
and its doc string.jupyter-server
provides a configurablecheck_origin
function consumingallow_origin
andallow_origin_pat
being very fine tunable cross origin permissions. This PR exposes thejupyter-server-proxy
to this functionality and being similar configured as thejupyter-server
regarding cross origin acceptance.Please comment/review I'm open to suggestions and feedback.