Skip to content

fix(thrift): preserve reserved characters in proxy credentials - #635

Draft
vuanhphung wants to merge 1 commit into
mainfrom
vuanhphung/thrift-proxy-auth
Draft

vuanhphung wants to merge 1 commit into
mainfrom
vuanhphung/thrift-proxy-auth

Conversation

@vuanhphung

@vuanhphung vuanhphung commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Thrift interpolated structured proxy credentials into a URL without escaping them, so passwords containing /, # or ? failed with Invalid URL and usernames could change the parsed proxy host. Encode username and password separately at the existing proxy-agent boundary. Public options, empty-password handling, TLS and agent reuse remain unchanged.

Real CONNECT tests cover /, #, ?, @ in each component, both together, ordinary credentials and empty/omitted passwords: 28 pass after, versus 21 pass / 7 fail before. Lint, formatting, type-check, build and 1814 unit tests pass (inherited agent flags cleared; main reproduces the unrelated agent-detection failure without that isolation). Rebuilt kernel pin dac32e2b; 3 repository proxy/HTTP live e2e tests pass across both backends. On unchanged coverage head ce78dac55, PROXY-002 XPASSes 3/3 on fixed Thrift, main retains its narrowly matched expected failure, and SEA passes 1/1. Separate controls also verify reserved characters in both username and password.

Five alternating build/run pairs, fresh processes, authenticated proxies, same shared warehouse and pinned binding; validated every returned row and successful CloudFetch downloads. Median execute+fetch seconds (main → fix):

Backend 100k range rows 250k CloudFetch-sized rows
Thrift 0.671 → 0.678 2.370 → 2.251
SEA 0.525 → 0.477 2.296 → 2.046

The encoding runs once during cached-agent creation, not per row/request; timing differences overlap shared-warehouse variability, not an expected throughput change. Full driver-test CI uses commit_sha, not a PR-number check.

Cross-driver state

Driver State Notes
JDBC Supported UseProxy=0; separate ProxyUID/ProxyPWD, DatabricksHttpClient.java:205 @97dac8da
Python Supported (env only) HTTP[S]_PROXY, Basic by default; decoded userinfo, common/http_utils.py:87 @087b2bff
Go Supported Env proxy by default; separate kernel WithKernelProxy fields, backend.go:417 @44b21a6a
Node.js Partial → Supported Encode structured proxy.auth components; SEA already supported
ODBC (OSS) Supported ProxyAuthType=0; separate kernel credentials, kernel_connection.cpp:360 @a2f78c9b
C# ADBC Supported proxy_auth=false; NetworkCredential, HiveServer2ProxyConfigurator.cs:174 @55051e46
Kernel Supported Optional credentials passed to Proxy::basic_auth, src/client/http.rs:663 @dac32e2b

Source audit follows JDBC/kernel semantics, retaining Node's existing empty-password support rather than C#'s stricter validation. #605 also edits HttpConnection.ts (imports/retry-policy methods), but not createProxyAgent; #610 does not edit that file. No production-hunk conflict; their Unreleased changelog additions may need reconciliation.

Addresses PROXY-002, discovered by the proxy coverage workstream in databricks/databricks-driver-test#2182.

Adversarial review: pending the separate factory reviewer; this PR remains a draft.

This pull request and its description were written by Isaac.

Signed-off-by: Vu Anh Phung <vu.phung@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>

This branch was successfully deployed

1 active deployment
azure-prod — 542426fc Deployed Nov 19, 2026 by vuanhphung via e2e-test (26.12.1, 26_12_1) #2153
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.

1 participant