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: add oauth_token_cache_enabled to control kernel U2M on-disk token cache
Adds the oauth_token_cache_enabled connect() kwarg, forwarded to the pyo3 Session token_cache_enabled field on the oauth-u2m path. U2M-only; disabled by default (matches Thrift no-persistence posture); enable-flag only; experimental_oauth_persistence is untouched.
Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
Copy file name to clipboardExpand all lines: CONNECTION_PARAMETERS.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
@@ -82,6 +82,7 @@ to change without notice.
82
82
|`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. |
83
83
|`identity_federation_client_id`|`str`| ✅ | ✅ |`None`| Workload identity / token-federation client id (kernel support added in #910). |
84
84
|`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). When unset (None, default), the kernel's default applies; False disables persistence (in-memory only); True enables on-disk cache. Distinct from `experimental_oauth_persistence` — this controls the kernel's built-in encrypted storage, not a pluggable callback. |
85
86
|`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. |
86
87
|`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. |
87
88
|`_use_cert_as_auth` (+ `_tls_client_cert_file`) |`bool`| ✅ | ❌ |`False`| Authenticate with a TLS client certificate instead of a token. Thrift-only. |
0 commit comments