Commit 93b0331
authored
[SEA-NodeJS] feat(kernel): proxy + socketTimeout ConnectionOptions on the kernel backend (#431)
* [SEA-NodeJS] feat(kernel): support the explicit proxy ConnectionOption on the kernel backend
Map the public Thrift-shaped `ConnectionOptions.proxy`
(`{protocol, host, port, auth}`) onto the kernel napi binding's
`proxy?: string`, so the SAME proxy connection option that works on the
Thrift backend now also routes kernel/SEA traffic through a proxy.
`buildKernelProxyOptions` composes `protocol://[user:pass@]host:port`,
percent-encoding any `auth.{username,password}` into the URL userinfo so
credentials with reserved characters survive; the kernel parses the
userinfo off and applies it as proxy basic-auth. Wired into
`buildKernelConnectionOptions` alongside the TLS / HTTP option builders.
The regenerated napi contract (`native/kernel/index.d.ts`) carries the
new `proxy?: string` and `socketTimeoutMs?: number` fields exposed by the
kernel PR (databricks/databricks-sql-kernel#129).
Note: env-var proxying (`HTTPS_PROXY` / `HTTP_PROXY` / `NO_PROXY`) already
worked on the kernel backend (reqwest honours it natively); this adds the
*programmatic* path for callers who cannot set process env vars.
Verified end-to-end via mitmproxy against a live serverless warehouse:
explicit `proxy` option (no env var) routes all SEA calls through the
proxy; a dead proxy port fails the connection (proving the proxy is used).
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
* [SEA-NodeJS] feat(kernel): map the socketTimeout ConnectionOption onto the kernel
The kernel napi binding exposes `socketTimeoutMs` (kernel
`HttpConfig::request_timeout` / reqwest `Client::timeout`, kernel #129).
Map the public `socketTimeout` ConnectionOption (ms) onto it in
`buildKernelHttpOptions`, so the per-connection read timeout works on the
kernel backend just like the Thrift path.
Only a positive value is forwarded: `socketTimeout: 0` means "disabled /
wait indefinitely" on Thrift, but forwarding `0` would make reqwest time
out immediately, so it is omitted (kernel keeps its large default).
Verified directly against a live serverless warehouse: `socketTimeout: 1`
makes a SEA request time out.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
* [SEA-NodeJS] refactor(kernel): pass proxy to the kernel as a structured object
Change the kernel proxy mapping from a flattened URL string to the
structured napi `proxy` object (kernel #129), mirroring the kernel's
internal ProxyConfig: `{ url, username?, password?, bypassHosts? }`.
`buildKernelProxyOptions` now composes `url` from `protocol://host:port`
(no embedded credentials) and forwards `auth.{username,password}` as
separate basic-auth fields — eliminating the URL percent-encoding of
credentials. The `noProxy` host list is forwarded as `bypassHosts`
(previously unexpressible through the URL-string form).
Regenerated napi contract (native/kernel/index.d.ts) carries the new
`ProxyInput` object type.
Verified via mitmproxy (HttpProxyTests, SEA leg): http / https /
proxy-with-auth all route through the proxy and the query succeeds.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
* chore(kernel): bump KERNEL_REV to kernel v0.2.0 (0d46716)
Point the bundled kernel binding at the latest kernel main — the v0.2.0
beta release (databricks/databricks-sql-kernel@0d46716), which includes
the merged proxy + per-connection socketTimeout napi surface (#129) this
PR maps onto, plus the query-tags wire support (#150). The kernel-e2e CI
gate builds the napi from this SHA.
Verified: proxy routes through mitmproxy and SELECT round-trips on the
v0.2.0 binding.
Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
---------
Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>1 parent 3358a61 commit 93b0331
2 files changed
Lines changed: 65 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
193 | 213 | | |
194 | 214 | | |
195 | 215 | | |
196 | 216 | | |
197 | 217 | | |
| 218 | + | |
198 | 219 | | |
199 | 220 | | |
200 | 221 | | |
| |||
401 | 422 | | |
402 | 423 | | |
403 | 424 | | |
404 | | - | |
| 425 | + | |
405 | 426 | | |
406 | 427 | | |
407 | 428 | | |
| |||
423 | 444 | | |
424 | 445 | | |
425 | 446 | | |
426 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
427 | 459 | | |
428 | 460 | | |
429 | 461 | | |
| |||
514 | 546 | | |
515 | 547 | | |
516 | 548 | | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
517 | 575 | | |
518 | 576 | | |
519 | 577 | | |
| |||
523 | 581 | | |
524 | 582 | | |
525 | 583 | | |
526 | | - | |
| 584 | + | |
| 585 | + | |
527 | 586 | | |
528 | 587 | | |
529 | 588 | | |
| |||
539 | 598 | | |
540 | 599 | | |
541 | 600 | | |
| 601 | + | |
| 602 | + | |
542 | 603 | | |
543 | 604 | | |
544 | 605 | | |
| |||
0 commit comments