Skip to content

Conversation

@cjoy
Copy link

@cjoy cjoy commented Nov 27, 2025

What changes are proposed in this pull request?

Add two new configuration options to enable the SDK to work with HTTP proxies:

  1. HTTPHeaders (map[string]string): Custom headers added to all API requests
  2. HTTPPathPrefix (string): Path prefix prepended to all API URLs

These options can be configured via:

  • Struct fields (programmatic)
  • Environment variables: DATABRICKS_HTTP_HEADERS (format: key1=value1;key2=value2) and DATABRICKS_HTTP_PATH_PREFIX
  • Config file attributes: http_headers and http_path_prefix

Files changed:

  • config/config.go: Added new config fields with struct tags
  • config/config_attribute.go: Added support for parsing map[string]string from environment variables
  • config/api_client.go: Added request visitors for applying headers and path prefix

How is this tested?

Existing CI.

Also added unit tests in config/config_test.go:

  • TestConfig_HTTPHeaders: Verifies headers are applied to requests
  • TestConfig_HTTPPathPrefix: Verifies path prefix is prepended
  • TestConfig_HTTPHeadersAndPathPrefix: Verifies both work together
  • TestConfig_HTTPHeadersFromEnvVar: Verifies env var parsing for headers
  • TestConfig_HTTPPathPrefixFromEnvVar: Verifies env var parsing for path prefix
  • TestParseMapFromString: Verifies map parsing edge cases

@github-actions
Copy link

If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:

Trigger:
go/deco-tests-run/sdk-go

Inputs:

  • PR number: 1340
  • Commit SHA: 86ef628bacdf4ed1d0ee5929ad511e6283b028aa

Checks will be approved automatically on success.

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