Skip to content

feat(go): support universe domain as a new parameter - #332

Open
ipierre1 wants to merge 5 commits into
adbc-drivers:mainfrom
ipierre1:feat-go-universe-domain
Open

ipierre1 wants to merge 5 commits into
adbc-drivers:mainfrom
ipierre1:feat-go-universe-domain

Conversation

@ipierre1

@ipierre1 ipierre1 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What's Changed

Note

The IAM Credentials endpoint used for impersonation is exposed under the default universe domain (iamcredentials.googleapis.com) in any case.

Adds an optional universe domain parameter to the Go driver, so they can connect to Google Cloud universes other than the public one (e.g. S3NS with s3nsapis.fr). When unset, behavior is unchanged (googleapis.com).

  • Go: new option bigquery.universe_domain (URI parameter UniverseDomain). It applies to the BigQuery, Storage Read and Storage Write clients and to the default URI host. Impersonation now uses cloud.google.com/go/auth/credentials/impersonate so the IAM Credentials endpoint can follow the universe.
  • Validation: both drivers only accept a bare domain name (no scheme, port or path).
  • Limitation: user OAuth authentication only works in the default universe.
  • Docs and tests updated for driver.

Closes #328.

ipierre1 and others added 2 commits October 13, 2026 19:18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Reuse the connection's resolved credentials for the Storage Write
  client instead of falling back to ADC.
- Leave the BigQuery endpoint unset when the URI has no host, so the
  client library derives it from the universe domain or GOOGLE_CLOUD_UNIVERSE_DOMAIN.
- Keep impersonation on iamcredentials.googleapis.com, which is not
  universe-specific (S3NS still serves it from googleapis.com).
- Only accept known universe domains (googleapis.com, googleapis.de,
  s3nsapis.fr) unless bigquery.allow_unknown_universe_domain is true.
@ipierre1
ipierre1 marked this pull request as ready for review October 13, 2026 20:08
@lidavidm
lidavidm requested a balanced review from Copilot October 14, 2026 01:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Effective environment domains, case normalization, and DNS validation have unresolved correctness and security issues.

1 open finding
What changed in this PR

Adds configurable Google Cloud universe domains across Go BigQuery clients, authentication, URI parsing, documentation, and tests.

Changes:

  • Adds universe-domain options, validation, and endpoint derivation.
  • Propagates authentication settings to Storage Write and impersonation clients.
  • Documents and tests known, custom, and environment-provided universes.
File Description
go/​bigquery_database.go Parses and validates universe options.
go/​bulk_ingest_storage_write.go Propagates client authentication options.
go/​connection.go Configures clients and impersonation.
go/​docs/​bigquery.md Documents universe-domain behavior.
go/​driver.go Defines and remaps new options.
go/​driver_test.go Tests URI and option handling.
go/​statement.go Passes auth options to ingestion.
go/​universe_domain_test.go Tests impersonation endpoint behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread go/bigquery_database.go Resolved
Comment thread go/docs/bigquery.md Resolved
Comment thread go/bigquery_database.go
"QuotaProject": OptionAuthQuotaProject,

"UniverseDomain": OptionUniverseDomain,
"AllowUnknownUniverseDomain": OptionAllowUnknownUniverseDomain,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the idea is that this shouldn't be passed through, then I think embedding it in the URI is a bad idea since then applications will have to parse/sanitize the URI themselves

Comment thread go/connection.go Resolved
ipierre1 and others added 2 commits November 12, 2026 23:21
Co-authored-by: David Li <li.davidm96@gmail.com>
Co-authored-by: David Li <li.davidm96@gmail.com>
@lidavidm

Copy link
Copy Markdown
Contributor

This still has merge conflicts.

This branch has not been deployed

No deployments
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.

Driver isn't compatible with universe domain from other GCP clouds

3 participants