Skip to content

Commit 7a8d315

Browse files
ai: apply changes for #932 (1 review thread)
Addresses: - #3860320318 at src/databricks/sql/client.py:230 Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
1 parent 9c968f1 commit 7a8d315

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

CONNECTION_PARAMETERS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ to change without notice.
8282
| `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. |
8383
| `identity_federation_client_id` | `str` ||| `None` | Workload identity / token-federation client id (kernel support added in #910). |
8484
| `experimental_oauth_persistence` | `OAuthPersistence` ||| `None` | **Thrift-only.** The kernel owns its own token lifecycle and does not accept a persistence store. |
85-
| `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, at `~/.config/databricks-sql-kernel/oauth/`, 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. |
85+
| `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. |
8686
| `azure_client_id` / `azure_client_secret` / `azure_tenant_id` | `str` ||| `None` | Azure service-principal (Entra ID M2M), selected by `auth_type="azure-sp-m2m"`. On the kernel path the connector forwards these to the kernel, which owns Azure resolution (Entra v2.0 token endpoint + the Databricks-resource `.default` scope) (#919). **`azure_tenant_id` is optional on the kernel path too** — like Thrift, the kernel auto-discovers it from the workspace's `/aad/auth` redirect when omitted. |
8787
| `azure_workspace_resource_id` | `str` ||| `None` | For `azure-sp-m2m`. When set, the SP **management token** (`X-Databricks-Azure-SP-Management-Token`) + `X-Databricks-Azure-Workspace-Resource-Id` header are sent, to authorize an SP that has an Azure RBAC role but is not a workspace member. Omit it for a workspace-member SP (the data token authenticates alone; no management token is fetched). Works on both the kernel and Thrift paths. |
8888
| `_use_cert_as_auth` (+ `_tls_client_cert_file`) | `bool` ||| `False` | Authenticate with a TLS client certificate instead of a token. Thrift-only. |

src/databricks/sql/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,9 @@ def read(self) -> Optional[OAuthToken]:
227227
```
228228
:param oauth_token_cache_enabled: `bool | None`, optional (default is None)
229229
**Kernel-only, U2M-only.** Controls whether the kernel persists OAuth U2M
230-
refresh tokens to disk (AES-256 encrypted, at `~/.config/databricks-sql-kernel/oauth/`).
230+
refresh tokens to disk (AES-256 encrypted). The cache lives in the
231+
OS config directory: `~/Library/Application Support/databricks-sql-kernel/oauth/`
232+
on macOS, `~/.config/databricks-sql-kernel/oauth/` on Linux.
231233
When unset (None, the default), the connector treats this as False and
232234
forwards `token_cache_enabled=False` to the kernel, so on-disk caching is
233235
disabled by default — matching the Thrift posture and avoiding silently

src/databricks/sql/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ def _create_backend(
187187
"identity_federation_client_id"
188188
),
189189
# OAuth U2M token-cache enable/disable: controls whether the kernel
190-
# persists U2M refresh tokens to disk (encrypted, at ~/.config/databricks-sql-kernel/oauth/).
190+
# persists U2M refresh tokens to disk (encrypted, in the OS config dir:
191+
# ~/Library/Application Support/databricks-sql-kernel/oauth/ on macOS,
192+
# ~/.config/databricks-sql-kernel/oauth/ on Linux).
191193
# A typed Optional[bool]; on the oauth-u2m branch omitted/None
192194
# ⇒ token_cache_enabled=False (disabled, in-memory only) — the
193195
# opt-in default that preserves backward compat when token

0 commit comments

Comments
 (0)