Skip to content

feat(rust): add org ID header for SPOG support#379

Open
vikrantpuppala wants to merge 1 commit intomainfrom
feat/rust-org-id-header
Open

feat(rust): add org ID header for SPOG support#379
vikrantpuppala wants to merge 1 commit intomainfrom
feat/rust-org-id-header

Conversation

@vikrantpuppala
Copy link
Copy Markdown
Collaborator

Summary

  • Parse ?o=<org_id> query parameter from the HTTP path (e.g., /sql/1.0/warehouses/abc123?o=987654)
  • Strip query params from warehouse ID extraction so the ID is clean
  • Send x-databricks-org-id header on all authenticated HTTP requests for multi-tenant workspace routing
  • Fix integration test to set the required databricks.auth.type option

Context

Multi-tenant Databricks deployments (e.g., pecoaws.databricks.com) include ?o=<org_id> in the HTTP path for request routing. Without the org ID, the frontend cannot route requests to the correct workspace, causing 401 authentication errors even with valid credentials.

This matches the pattern already implemented in the C# driver (StatementExecutionConnection.cs), which parses ?o= and injects the x-databricks-org-id header.

Test plan

  • Unit tests for extract_warehouse_id with query params
  • Unit tests for extract_org_id parsing
  • Unit test for set_option("databricks.http_path") with ?o=
  • E2E test against multi-tenant workspace (pecoaws.databricks.com) — verified SELECT 1 succeeds
  • cargo fmt, cargo clippy, cargo test all pass

This pull request was AI-assisted by Isaac.

Multi-tenant Databricks deployments include `?o=<org_id>` in the HTTP
path to route requests to the correct workspace. Without the org ID,
the frontend cannot validate credentials, causing 401 errors.

Parse the `?o=` query parameter from the HTTP path, strip it from the
warehouse ID, and send it as an `x-databricks-org-id` header on all
authenticated requests. This matches the C# driver's implementation.

Also fix the integration test to set the required `databricks.auth.type`
option.

Co-authored-by: Isaac
@vikrantpuppala vikrantpuppala changed the title feat(rust): add org ID header for multi-tenant workspace routing feat(rust): add org ID header for SPOG support Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant