microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.26k stars 278 forks source link

Passing headers. VScode to Colab Enterprise/JupyterLab with authentication + CORS #15821

Closed gogasca closed 1 month ago

gogasca commented 1 month ago

Currently I want to connect VScode with JupyterLab extension to Google Cloud Colab Enterprise or AI Notebooks or any JupyterLab service that requies authentication. I'm currently using JupyterLab Gateway as a way to overwrite headers (Authentication + CORS - Origin). Is there a way to overwrite HTTP headers in current Extension? If not what is the any good pointers for me to add support for this.

Background:

Wanted behavior: Ability to pass custom HTTP header for HTTP(s) and Websockets. Example:

headers = {"Origin": PROXY_URL, "Authentication": AUTH_TOKEN}
gogasca commented 1 month ago

@DonJayamanne any pointers are appreciated. I would be happy to propose a PR. Thanks

gogasca commented 1 month ago

Related: https://github.com/microsoft/vscode-jupyter/issues/1116 @rchiodo , @IanMatthewHuff , @DonJayamanne , @greazer , @joyceerhl

DonJayamanne commented 1 month ago

@gogasca Thanks for filing this issue. At this stage we have no plans on supporting such a feature request. However you can create your own extension that passes the necessary headers and the like. Please have a look at the Jupyter Hub extension that we've created.

This is a simple extension that takes care of auth and the like (with custom headers).

https://github.com/microsoft/vscode-jupyter-hub

Feel free to reach out for additional details with regards to this extension or the like