Skip to content

Add SPOG routing support for account-level vanity URLs#767

Open
msrathore-db wants to merge 1 commit intomainfrom
spog-fix
Open

Add SPOG routing support for account-level vanity URLs#767
msrathore-db wants to merge 1 commit intomainfrom
spog-fix

Conversation

@msrathore-db
Copy link
Copy Markdown
Contributor

Summary

  • Regex fix: Warehouse ID extraction regex changed from .+ to [^?&]+ to stop at query params (e.g. ?o= for SPOG routing)
  • SPOG header injection: Extract ?o=<workspaceId> from httpPath during session init, inject x-databricks-org-id header on all non-OAuth endpoints
  • Telemetry: Propagate org-id header via new extra_headers parameter
  • Feature flags: Propagate org-id header to feature flag requests
  • OAuth excluded: OAuth endpoints (/oidc/v1/token, discovery) do NOT receive the header (they reject it with 400)

Test plan

  • Unit tests for warehouse ID regex with ?o= query params (3 new cases in test_sea_backend.py)
  • Unit tests for SPOG header extraction (7 new cases in test_session.py)
  • Manual E2E: PAT + Thrift/SEA on SPOG host — data, telemetry, feature flags all return 200
  • Manual E2E: M2M OAuth + Thrift/SEA on SPOG host — all endpoints return 200
  • Manual E2E: U2M OAuth + Thrift/SEA on SPOG host — all endpoints return 200 (with explicit telemetry/FF assertion)
  • Manual E2E: Legacy host baseline — all auth modes work unchanged

This pull request was AI-assisted by Isaac.

SPOG replaces per-workspace hostnames with account-level URLs. When
httpPath contains ?o=<workspaceId>, the connector now extracts the
workspace ID and injects x-databricks-org-id as an HTTP header on all
non-OAuth endpoints (SEA, telemetry, feature flags).

Changes:
- Fix warehouse ID regex to stop at query params ([^?&]+ instead of .+)
- Extract ?o= from httpPath once during session init, store as _spog_headers
- Propagate org-id header to telemetry client via extra_headers param
- Propagate org-id header to feature flags client
- Do NOT propagate to OAuth endpoints (they reject it with 400)

Signed-off-by: Madhavendra Rathore <[email protected]>

Co-authored-by: Isaac
Signed-off-by: Madhavendra Rathore <[email protected]>
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