Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4406b2d
feat(proxy): Kerberos/Negotiate proxy authentication
cathleeny Nov 24, 2026
7b35f9a
ci(proxy): drop the proxy-negotiate PR job and its KDC fixture
cathleeny Dec 2, 2026
edc9103
test(proxy): make the Negotiate stub tests independent of timing
cathleeny Dec 2, 2026
e27c50d
chore(proxy): keep adbc/NOTICE in sync with NOTICE
cathleeny Dec 2, 2026
4624e87
fix(oauth): drop the endpoint URL from U2M token-request errors
cathleeny Dec 2, 2026
7ee5f85
fix(proxy): address review round 2 on the Negotiate client
cathleeny Dec 2, 2026
2a66825
docs(changelog): note the new client::ProxyConfig field
cathleeny Dec 2, 2026
551e63d
fix(pyo3): fail closed after interpreter shutdown and reject a bypass…
cathleeny Dec 2, 2026
6766fa9
fix(proxy): refuse plain-HTTP hops under Negotiate
cathleeny Dec 2, 2026
889e739
test(proxy): widen the Negotiate deadline test's margins again
cathleeny Dec 2, 2026
148200e
fix(proxy): refuse a plain-HTTP tenant-discovery probe under Negotiate
cathleeny Dec 3, 2026
4bea829
Merge origin/main into the Negotiate proxy branch
cathleeny Dec 3, 2026
47f5869
fix(proxy): load GSSAPI at run time on Linux instead of linking it
cathleeny Dec 3, 2026
8d4ad39
fix(proxy): bound the first Negotiate token and fail a probe 407 closed
cathleeny Dec 3, 2026
e297d8d
fix(proxy): keep a Negotiate token timeout's code at session open
cathleeny Dec 3, 2026
d630097
docs(notice): describe how cross-krb5 is linked per platform
cathleeny Dec 3, 2026
150afbd
Merge origin/main into the Negotiate proxy branch
cathleeny Dec 3, 2026
8bb644a
fix(proxy): retry Volume transfers with a fresh Negotiate token
cathleeny Dec 3, 2026
f72ffa8
fix(proxy): harden Negotiate token creation and add feature CI checks
cathleeny Dec 3, 2026
91aec4e
Merge origin/main into the Negotiate proxy branch
cathleeny Dec 3, 2026
39e39fb
test(proxy): give the Volume token-timeout test headroom on slow runners
cathleeny Dec 3, 2026
12ca015
Merge origin/main into the Negotiate proxy branch
cathleeny Dec 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ jobs:
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings

- name: cargo clippy (proxy-negotiate)
run: cargo clippy --all-targets --features proxy-negotiate -- -D warnings

test:
name: Unit + doc tests
runs-on:
Expand Down Expand Up @@ -131,6 +134,9 @@ jobs:
# a live workspace; `rust-e2e.yml` runs them separately.
run: cargo test --workspace

- name: cargo test (proxy-negotiate)
run: cargo test --lib --features proxy-negotiate
Comment thread
cathleeny marked this conversation as resolved.
Resolved

c-abi:
name: C ABI smoke test
runs-on:
Expand Down Expand Up @@ -270,6 +276,10 @@ jobs:
shell: pwsh
run: cargo clippy -p databricks-sql-kernel --no-default-features --features tls-rustls --all-targets -- -D warnings

- name: cargo clippy (tls-rustls, proxy-negotiate, Windows)
shell: pwsh
run: cargo clippy -p databricks-sql-kernel --no-default-features --features tls-rustls,proxy-negotiate --all-targets -- -D warnings

- name: Test client behavior (tls-rustls, Windows)
shell: pwsh
# Two runs: the client:: suite, then the C ABI revocation open test, which is not under client::.
Expand Down
1 change: 1 addition & 0 deletions CONNECTION_PARAMETERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ userinfo replaced by `***`.
| `username` | Proxy basic-auth (SOCKS5: RFC 1929) username. Overrides credentials embedded in `url`. | `None` |
| `password` | Proxy basic-auth password. Ignored unless `username` is set. Redacted in `Debug`. | `None` |
| `bypass_hosts` | Comma-separated hosts/domains to bypass the proxy, e.g. `localhost,*.internal.corp,.example.com`. | `None` |
| `auth` | `ProxyAuth::Default` (Basic from `username` or the URL, or none), `ProxyAuth::Negotiate { service, host, realm }` (Kerberos with the ambient credential cache / Windows logon; target `service/host[@realm]`, defaults `HTTP`, the proxy host, the default realm) or `ProxyAuth::NegotiateCallback` (tokens from a caller callback). Negotiate sends `Proxy-Authorization: Negotiate` on the proxy `CONNECT` only, creates a token at session open (and lazily for Volume storage) and retries each request hop once with a fresh token on a proxy 407, including Volume PUT, GET and REMOVE storage requests. A second 407 fails the request; it never falls back to Basic, a direct connection or an env proxy. It requires an `http(s)://` `url` and no Basic credentials (`InvalidArgument`); a failed token fails session open before any network I/O (`Unauthenticated`). On Unix the token is a raw Kerberos token, which MIT and Heimdal acceptors (such as squid's `negotiate_kerberos_auth`) accept; a proxy that accepts only SPNEGO-wrapped tokens rejects it with 407. Windows sends SPNEGO. `Negotiate` needs the non-default cargo feature `proxy-negotiate`; without it, it is rejected as unsupported. On Linux the feature adds no link dependency: MIT Kerberos (`libgssapi_krb5.so.2`) is loaded only when a token is needed, and if it is missing, `Negotiate` fails session open (`Unauthenticated`) with an install hint. Non-Linux platforms link through cross-krb5: GSS.framework on macOS (building needs libclang), SSPI on Windows, and system GSSAPI on other Unix (including BSDs, illumos and Android). C ABI: `kernel_session_config_set_proxy_negotiate`. Python: `proxy_negotiate_token` (a callable returning `bytes`). | `Default` |

## `TlsConfig` — TLS / SSL (optional)

Expand Down
181 changes: 180 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ rustls = { version = "0.23.41", optional = true, default-features = false, featu
# Enforce TLS dependency minimums for consumers with their own lockfiles.
rustls-webpki = { version = "0.103.16", optional = true, default-features = false }
webpki-roots = { version = "1.0.11", optional = true, default-features = false }
# `tls-rustls`: loads the OS trust store, the same store reqwest's
# `rustls-tls-native-roots` loads, for the Windows revocation verifier (see
# `src/client/tls_revocation.rs`) and once per Negotiate client.
rustls-native-certs = { version = "0.8", optional = true }
tokio = { version = "1", features = ["full", "sync"] }

# Serialization
Expand Down Expand Up @@ -168,13 +172,20 @@ zeroize = "1.9"
jsonwebtoken = { version = "9", default-features = false, features = ["use_pem"] } # JWT signing (RS256/384/512, PS256/384/512, ES256/384); use_pem = PEM key loading (adds pem + simple_asn1, no TLS)
pkcs8 = { version = "0.10", features = ["encryption", "pem", "std"] } # PKCS#8 PEM parsing + PBES2 passphrase decryption

# Kerberos/SPNEGO (`Proxy-Authorization: Negotiate`) proxy auth, behind the
# non-default `proxy-negotiate` feature. Non-Linux platforms use cross-krb5:
# GSS.framework on macOS (building needs libclang), SSPI on Windows, and
# system GSSAPI on other Unix, including BSDs, illumos and Android. Only Linux
# loads MIT GSSAPI (`libgssapi_krb5.so.2`) at run time instead
# (`src/client/gssapi_runtime.rs`), so Linux links no GSSAPI library and needs
# no GSSAPI headers to build. MIT.
[target.'cfg(not(target_os = "linux"))'.dependencies]
cross-krb5 = { version = "0.5", optional = true, default-features = false }

# Windows CryptoAPI for TLS certificate revocation (`src/client/tls_revocation.rs`).
# `windows-sys` is already in the lock file; no new packages.
[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Security_Cryptography"] }
# `tls-rustls` on Windows only. Loads the OS trust store for the revocation verifier (see
# `src/client/tls_revocation.rs`), the same store reqwest's `rustls-tls-native-roots` loads.
rustls-native-certs = { version = "0.8", optional = true }

# `pthread_sigmask` for kernel-owned runtime threads (`src/util/runtime.rs`).
# Already in the graph through tokio, so no new crate is added.
Expand Down Expand Up @@ -249,6 +260,11 @@ tls-rustls = [
"dep:webpki-roots",
"dep:rustls-native-certs",
]
# Kerberos token generation for `ProxyAuth::Negotiate`; without it `Negotiate`
# is rejected as unsupported. On Linux the feature adds no link dependency:
# MIT GSSAPI is loaded only when a token is needed (see `cross-krb5` above).
# `ProxyAuth::NegotiateCallback` works either way.
proxy-negotiate = ["dep:cross-krb5"]
Comment thread
cathleeny marked this conversation as resolved.
Resolved
Comment thread
cathleeny marked this conversation as resolved.
Resolved

[lib]
name = "databricks_sql_kernel"
Expand Down
2 changes: 2 additions & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ changes go in their respective binding's NEXT_CHANGELOG.
- Custom credentials providers: `AuthConfig::External` and the C ABI
`kernel_session_config_set_auth_external` call the caller's provider for the
auth headers of every request, so the host can refresh credentials.
- Kerberos (`Proxy-Authorization: Negotiate`) authentication to HTTP proxies via `ProxyConfig::auth` / `ProxyAuth::Negotiate` and the C ABI setter `kernel_session_config_set_proxy_negotiate`, behind the non-default cargo feature `proxy-negotiate`. On Linux it loads MIT Kerberos (`libgssapi_krb5.so.2`) only when used, so builds with the feature still run without it.
- Volume `PUT`, `GET` and `REMOVE`: with `StatementSpec::volume` set, executing
a statement the server marks as a Volume operation also runs its file
transfer. Local paths, with symlinks resolved, must be inside the caller's
Expand All @@ -45,6 +46,7 @@ changes go in their respective binding's NEXT_CHANGELOG.

- Proxy credentials are redacted from proxy URLs in errors, logs and `Debug`
output.
- `client::ProxyConfig`, the advanced HTTP-client proxy settings, has a new `auth` field. Code that builds it with a struct literal must add `..Default::default()`.
- `Error` and `ResultManifest` have new public fields (`local_error`,
`is_volume_operation`). Code that builds them with struct literals must set them.

Expand Down
Loading
Loading