You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(oauth): surface device-code prompt in Google Colab
In a Colab notebook, OAuth login appeared to hang: the device-code prompt
(verification URL + user code) was only emitted via DUCKDB_LOG_WARNING, which
the DuckDB Python client never surfaces, so the user never saw the code.
Colab captures the kernel's C-level stderr into the cell, so:
- Add IsColabEnvironment() (COLAB_RELEASE_TAG / COLAB_GPU / COLAB_JUPYTER_IP)
and PrintPromptIfColab(): write the device-code prompt, "still waiting", and
"success" messages (plus the PKCE visit-URL fallback) to stderr+fflush there.
- PerformAuthFlow auto-mode also routes Colab to the device flow, so it never
falls into the unusable server-side PKCE/localhost path.
Also harden EnforceHttpsUrl: the loopback allowance used a prefix match with no
host boundary, so http://127.0.0.1.evil.com / http://localhost.evil.com slipped
past the HTTPS requirement (plaintext-downgrade on discovered token endpoints).
Replaced with IsLoopbackHttpUrl(), which requires a ':'/'/'/end boundary after
the loopback host and adds http://[::1].
The two pure helpers live in a dependency-free src/vgi_oauth_env.cpp so the
Catch2 unit-test binary can exercise them without the OAuth/HTTP/Arrow link
surface; test/cpp/test_oauth.cpp covers Colab detection and the loopback
allow-list (incl. look-alike rejections).
Scope is intentionally Colab-only; the broader Jupyter/JupyterLab non-blocking
retry redesign is deferred.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments