Repository navigation
Conversation
… backend Route every authenticator that is not PAT, M2M or U2M through the kernel's new per-request credentials callback (kernel_session_config_set_auth_external) instead of rejecting it. This covers WithAuthenticator(custom), WithTokenProvider, WithExternalToken, WithStaticToken and WithFederatedTokenProvider[AndClientID]. - A cgo.Handle, held in C memory, reaches the authenticator from an exported trampoline. On each kernel request it calls Authenticate on a fresh POST to the Thrift endpoint URL and passes back every header it set. The kernel's release callback deletes the handle once the session or config is gone. - Federated providers are no longer a one-time PAT snapshot taken at connect. The driver's own FederationProvider now runs per request, as on Thrift (an RFC 8693 exchange per request, no cache, fallback on refusal), and the kernel's own federation does not run for this mode. - NUL bytes are rejected in Go before the C boundary. The kernel rejects CR and LF and ignores the headers it manages. - An authenticator error fails the request at once with its message, and the session stays usable (it is local, nothing was sent). Thrift retried it under WithRetries. - PAT, M2M and U2M mappings are unchanged. KERNEL_REV moves to the kernel change that adds the setter (fb18a18215fc11fd58e40a5451b2ce073de0abbb), and its C header is copied. The header also carries kernel main's revocation setter declaration, which the driver does not use. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
The request URL an external authenticator sees appended cfg.Port even when WithServerHostname already carried a port, so host "127.0.0.1:43337" became "https://127.0.0.1:43337:443/..." and every custom provider failed to parse it. A non-default port in the host now wins, as it does in the kernel's own endpoint, and is not appended a second time. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
Resolves the CHANGELOG.md conflict with the Go 1.26.11 minimum-version entry by keeping both entries. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low · 1 Nit
Solid design with good coverage: 1 medium and 2 low concerns. The change can't merge until the bindings pin catches up with the new ABI symbols.
Other findings
- ⚪ Nit — A Thrift connection with a custom authenticator that gets re-opened on the kernel by Reyden recovery now resolves to AuthExternal instead of failing. This is probably the intended outcome, but no test or doc covers it. Add a connector_reyden_test case that checks the kernel config gets AuthExternal with the same authenticator. (Found by Claude Opus 5.5 · confirmed by the judge)
Brings in the SOCKS proxy support from HTTPS_PROXY (ba98d6e). KERNEL_REV now pins kernel 159a2ff, which contains both the SOCKS change and External auth, and the C header is copied from that commit. Both changelog entries and CONNECTION_PARAMETERS.md rows are kept. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High
Not ready to merge: 1 high blocker (bindings pin). The External auth bridge, handle lifetime, local provider-failure classification and request-URL construction look correct and are well tested. No driver_e2e_test.go coverage was added for the new provider paths; that could be follow-up work.
aakash-saravanan-db
left a comment
There was a problem hiding this comment.
Nice work moving every non-PAT/OAuth authenticator onto the per-request callback. The cgo handle lifetime, panic containment and pooled-session handling look right to me. I left two inline gaps against Thrift behavior that I think should be addressed (request context and error identity), plus one optional note.
Description fixes:
- "A server 401 or 403 still evicts the connection" isn't right for 403. The kernel maps 403 to
PermissionDenied, andisSessionFatalhas no case for it, so a 403 leaves the connection in the pool, both before and after this PR. Suggest: "A server 401 still evicts the connection; a 403 leaves it in the pool, as before." - The testing table lists "Real federation exchange, GitHub OIDC (driver-test AUTH-033 in CI)". AUTH-033 isn't on
databricks-driver-testmain yet, and databricks/databricks-driver-test#2423 has no CI checks at its current head, so I couldn't find that run. Could you link it, or mark it pending #2423? - If you take the context fix inline, the "
Authenticategetscontext.Background()" difference can come out.
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
|
Thanks for the review. Updated the description to correct 401/403 pooling and link the Go nightly AUTH-033 run and its temporary branch; the test lands in databricks/databricks-driver-test#2423. The background-context difference remains documented and is tracked in databricks/databricks-sql-kernel#537.
|
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low
Looks good, with one low concern. The callback lifecycle, error wrapping and session-eviction logic are sound and well tested. This can't merge yet: go.mod must move to bindings that export kernel_session_config_set_auth_external, because v1.5.0 lacks it and the kernel-tagged build would fail to link with only KERNEL_REV bumped.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Nit
Looks good, with one low concern: the CHANGELOG entry needs a behavior-change label. The cgo handle lifecycle, the nil-safe wrapProviderFailure, the local-failure exception for session eviction and the request URL match Thrift, and tests cover them. The auth docs omit Accept-Encoding and the SEA routing headers from the ignored list (nit).
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Other findings
- 🟠 High — The new callback ABI is used while consumer builds still select the unchanged v1.5.0 bindings, so bumping KERNEL_REV and passing source-built tests does not establish that the shipped archive supports these symbols and semantics. Publish and pin matching bindings before merging these calls, and verify a normal tagged build without the local archive override. (Found by GPT-6.1 Sol · the judge couldn't confirm it)
- ⚪ Nit — The entry changes existing behavior without the Behavior change: label. Custom authenticators no longer return ErrNotSupportedByKernel, and federated providers switch from one connect-time snapshot to a per-request exchange. Label the entry and state the fallback-detection effect. (Found by Claude Opus 5.5 · confirmed by the judge)
|
Per the release model, the bindings module moves at the joint kernel and driver release; this PR pins merged kernel |
Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
There was a problem hiding this comment.
🔀 Cross-reviewed: two independent reviews (Claude Opus 5.5 · GPT-6.1 Sol), checked by a judge model (Claude Sonnet 5.5).
Verdict: 1 High · 1 Low
Mostly solid: 1 high, 1 low. The callback bridge, eviction classification and tests look correct. The main risk is that the bindings pin hasn't moved along with the new ABI symbols.
Summary
Custom authenticators and token providers now work with the kernel backend. Previously rejected authenticators no longer return
ErrNotSupportedByKernel, so callers using that error to fall back to Thrift stop doing so. Providers run on each kernel request, as on Thrift; PAT, M2M and U2M are unchanged.What changes
WithAuthenticator,WithTokenProvider,WithExternalToken,WithStaticTokenandWithFederatedTokenProvider[AndClientID]use the kernel's External auth callback.Authenticatereceives a syntheticPOSTto the Thrift endpoint. Provider failures fail only that operation; the pooled session stays usable. A server 401 still evicts the session, while a 403 does not.context.Background()(kernel issue #537); the kernel ignores its managed headers, includingUser-Agent,Accept-Encodingand SEA routing headers.Testing
Previously run live:
Not run for this re-pin: live tests, Windows, macOS and arm.
Merge order
This PR pins merged kernel
6d6c1e4with the matching header. The bindings module moves at the joint kernel and driver release.Whichever of this PR and #616 merges second should update the federation documentation and tests: after #616, the one-exchange-per-request, no-cache wording no longer applies.
This pull request and its description were written by Isaac.