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
{{ message }}
Repository navigation
Commit 97277bd
Browse filesBrowse the repository at this point in the historyBrowse files
Brings in credentials_provider on kernel connections and the SOCKS docs. The
only conflict was tests/unit/test_kernel_client.py, where both sides added
tests at the same place; both are kept. KERNEL_REV follows main.
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com>
Co-authored-by: Isaac <no-reply@databricks.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
# Release History
2
2
3
3
# Unreleased
4
+
- Support `credentials_provider` on kernel connections (`use_kernel=True`), with the same header refresh and token federation as Thrift.
4
5
- Honor `_port` and `_connection_uri` on kernel connections (`use_kernel=True`), as Thrift does. Requires a databricks-sql-kernel release that includes databricks/databricks-sql-kernel#505.
5
6
- Support `_proxy_auth_method="negotiate"` (Kerberos proxy authentication) on kernel connections. It requires the `requests-kerberos` package and a kernel release with Negotiate proxy support.
6
7
- Speed up `fetchone()`, `fetchmany()` and `fetchall()` by building each result `Row` with fewer Python calls. The rows are unchanged. Large results and many concurrent cursors in one process benefit most.
|`token_url` (OAuth M2M) |`str`| ❌ | ✅ |`None` ⇒ OIDC discovery |**Kernel-only.** OAuth IdP token endpoint override. Required for JWT M2M against an external-IdP-backed workspace (e.g. Entra ID for Azure Databricks), since Databricks-native OIDC does not advertise the `private_key_jwt` method. Applies to shared-secret M2M too. |
95
95
|`oauth_scopes`|`List[str]`| ❌ | ✅ |`["sql","offline_access"]` for U2M |**Thrift ignores custom scopes** — it always uses the built-in scope set. Kernel honors custom scopes for U2M and M2M; an omitted M2M value uses the kernel's own default. |
96
-
|`credentials_provider`|`CredentialsProvider`| ✅ |❌|`None`| Custom external credentials provider. **Rejected on the kernel path** (`NotSupportedError`) — it is an opaque token source, so the kernel cannot own the token lifecycle; use `oauth_client_id` +`oauth_client_secret`for M2M, or the Thrift backend. |
96
+
|`credentials_provider`|`CredentialsProvider`| ✅ |✅|`None`| Custom external credentials provider. Takes precedence over `access_token` and `auth_type` on both backends. On Kernel the connector's provider chain (header caching, token federation with `identity_federation_client_id`, exchange fallback) runs as on Thrift and supplies the headers for every kernel request; combining it with`oauth_client_secret` or `oauth_jwt_key_file` raises `NotSupportedError`. |
97
97
|`identity_federation_client_id`|`str`| ✅ | ✅ |`None`| Workload identity / token-federation client id (kernel support added in #910). |
98
98
|`experimental_oauth_persistence`|`OAuthPersistence`| ✅ | ❌ |`None`|**Thrift-only.** The kernel owns its own token lifecycle and does not accept a persistence store. |
99
99
|`oauth_token_cache_enabled`|`bool \| None`| ❌ | ✅ |`None`|**Kernel-only, U2M-only.** Controls whether the kernel persists OAuth U2M refresh tokens to disk (AES-256 encrypted, in the OS config dir — `~/Library/Application Support/databricks-sql-kernel/oauth/` on macOS, `~/.config/databricks-sql-kernel/oauth/` on Linux; requires databricks-sql-kernel PR #283). **Disabled by default:** when unset (None) or False, the connector disables on-disk persistence (tokens in-memory only, matching Thrift); True enables the cache. Omitting it does **not** inherit the kernel's enabled-by-default. Distinct from `experimental_oauth_persistence` — this toggles the kernel's built-in encrypted storage, not a pluggable callback. |
@@ -128,6 +128,26 @@ to change without notice.
128
128
|`_retry_max_redirects`|`int`| ✅ | ❌ |`None`| Max HTTP redirects to follow (must be ≤ `_retry_stop_after_attempts_count`). Thrift-only. |
129
129
|`_enable_v3_retries`|`bool`| ✅ | ❌ |`True`| Use the urllib3-based v3 retry policy; `False` selects the deprecated legacy policy. Thrift-only. |
130
130
131
+
### SOCKS proxies from environment variables
132
+
133
+
The connector has no proxy URL parameter; both backends read proxies from the
134
+
environment. The backends differ for SOCKS proxies:
135
+
136
+
-**Kernel** (with a `databricks-sql-kernel` release that supports SOCKS) supports
137
+
only the `socks4://`, `socks4a://`, `socks5://` and `socks5h://` SOCKS schemes, in
138
+
`HTTPS_PROXY`, or in `ALL_PROXY` when `HTTPS_PROXY` is unset, for all kernel
139
+
traffic: queries, CloudFetch downloads and OAuth. `NO_PROXY` hosts connect
140
+
directly. `http://` and `https://` proxy URLs work as before. A value with an
141
+
unsupported scheme, such as bare `socks://`, is ignored: the kernel then uses
142
+
`ALL_PROXY` or connects directly. `socks5` and `socks4` resolve
143
+
the target host locally; `socks5h` and `socks4a` let the proxy resolve it. SOCKS5
144
+
credentials go in the URL userinfo (`socks5h://user:password@proxy:1080`;
145
+
percent-encode reserved characters). SOCKS4 has no password, and the user ID is
146
+
not sent. If a proxy with a supported scheme is unreachable or rejects the
147
+
credentials, the connection fails; it never falls back to a direct connection.
148
+
-**Thrift** has no SOCKS support. A SOCKS `HTTPS_PROXY` fails with urllib3's
149
+
`ProxySchemeUnknown`, and `ALL_PROXY` is ignored, so Thrift connects directly.
150
+
131
151
## TLS / SSL
132
152
133
153
> TLS options are assembled into a single `SSLOptions` object in `session.py`
@@ -223,6 +243,8 @@ are forwarded when supported by the installed kernel binding.
0 commit comments