Repository navigation
Conversation
The kernel backend rejected `authType: 'custom'`, `'token-provider'` and `'external-token'`, so applications that supply and refresh credentials through a provider could only use Thrift. These three modes now map to the kernel's `External` auth mode. KernelBackend passes the client's own `IAuthentication` (the chain `DBSQLClient` already builds for Thrift) as the napi `headerProvider`, and the kernel calls it for the headers of every request, retries included: - `custom` calls `provider.authenticate()` per request, as Thrift does per RPC. - `token-provider` and `external-token` keep `CachedTokenProvider`, plus `FederationProvider` when `enableTokenFederation` is set, so caching, `federationClientId` and the exchange fallback match Thrift. The kernel's own federation does not wrap `External`. - Provider headers reach the kernel with the values node-fetch sends on Thrift: every `HeadersInit` shape, array and non-string values stringified, repeated names combined. `undefined`/`null` values are skipped. - A provider rejection fails the operation as `AuthenticationError` with the provider's message. A missing provider fails `connect()`. `static-token`, PAT and OAuth mappings are unchanged. KERNEL_REV pins the kernel commit that adds `External`, and native/kernel/index.d.ts carries its `openSession(options, headerProvider)` typing. 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
Looks good, with one low concern. I traced the provider from DBSQLClient.createAuthProvider through getAuthProvider to the kernel headerProvider: caching, federation and the missing-provider error all behave correctly. As the PR says, merging still depends on published native packages that include the bridge.
This overview is Claude Opus 5.5's initial take; GPT-6.1 Sol added findings it doesn't mention — see the findings below.
Brings in the kernel SOCKS proxy routing (#653) and #651. KERNEL_REV now pins kernel 159a2ff0b69d, which carries both SOCKS and the External header-provider bridge, and native/kernel/index.d.ts matches a binding built from it. CONNECTION_PARAMETERS.md keeps both features' notes. 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 1 low concern. The provider modes reuse the client's own IAuthentication, which is created before backend.connect, so caching and federation behave as they do on Thrift. Follow-up: nothing checks binding support before connect, so on the published 1.5.0 packages External fails with an opaque native error.
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
- ⚪ Nit — The changelog entry doesn't name the kernel PR or say that the published 1.5.0 packages reject
External. The neighbouringportentry cites its kernel PR. Add the kernel PR reference and the minimum package version. (Found by Claude Opus 5.5 · confirmed by the judge)
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
Looks good apart from 1 medium concern: the PR ships source-only support while the native package pins are still 1.5.0. Auth wiring, header conversion and tests look correct. KernelBackend reuses the client's IAuthentication and fails fast at connect when there is no provider.
aakash-saravanan-db
left a comment
There was a problem hiding this comment.
The three provider modes map cleanly onto the kernel's External auth and reuse the client's own IAuthentication, so caching and federation behave as they do on Thrift. One gap inline that I think should be fixed before merge, plus a small description note.
Description: nothing in this PR tests the "auto-recovery: now works for these modes" bullet. It follows from the fallback building a KernelBackend on the same client context. Either cite the test that covers it, or reword it to say why it works, e.g. "The auto-recovery fallback reuses the client's provider, so these modes also open on the kernel there."
Honor the deprecated injected provider for direct kernel connections and Reyden recovery, matching Thrift. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
|
Thanks for the review. The description now explains that Reyden fallback reuses the client provider, and links the Node nightly AUTH-033 run and its temporary-branch / driver-test#2423 context. In e259152, the deprecated second-argument provider also takes precedence on direct kernel and Reyden fallback connections, with regression tests for both. |
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 1 low concern. The precedence of the deprecated second-argument provider, the External mapping, the provider guard and the header conversion all trace correctly through both the direct kernel path and the Reyden fallback. The shipped 1.5.0 native pins still need a bump before this works for users; the PR's merge-order notes already track that.
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
- ⚪ Nit — The changelog entry says a release "that adds custom credentials providers" is needed, but it doesn't cite the kernel change or a version. package.json pins 1.5.0, and the
portentry cites databricks/databricks-sql-kernel#505. Cite the kernel PR and name the minimum package version. (Found by Claude Opus 5.5 · confirmed by the judge)
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 Low
Looks good, with 1 medium concern. Routing, the deprecated-provider precedence, header conversion and the tests all hold up. The one gap is that the docs don't say this needs newer published native packages.
Summary
Enable
custom,token-providerandexternal-tokenauthentication on the kernel backend, including token federation and the deprecated injected-provider argument. The kernel calls the same client provider used by Thrift for each request.Kernel-managed headers, including
User-Agentand SEA routing headers, cannot be overridden by the provider; null and undefined values are skipped. Invalid credentials return HTTP 403.Testing
SELECT 1)These live cases were run before the merged-kernel re-pin. Windows and macOS were not run locally.
Merge order
This PR pins merged kernel commit
6d6c1e4(databricks/databricks-sql-kernel#527). Native packages move at the joint kernel and driver release.This pull request and its description were written by Isaac.