Add http_headers and http_path_prefix provider configuration options for HTTP proxy support - #5232
Add http_headers and http_path_prefix provider configuration options for HTTP proxy support#5232cjoy wants to merge 2 commits into
http_headers and http_path_prefix provider configuration options for HTTP proxy support#5232Conversation
…n options for HTTP proxy support
|
IMHO, it should be done in Go SDK and only then exposed to TF |
@alexott Fair point. I've raised a PR here: databricks/databricks-sdk-go#1340 |
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
|
Marking this pull request as stale because it has been open for 180 days with no activity. This helps our maintainers find and focus on the active pull requests. If this pull request receives no comments or updates in the next 30 days it will automatically be closed. Maintainers can also remove the stale label. If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you! |
Added two new provider configuration options to support HTTP proxy scenarios where custom headers or URL path rewriting are required:
http_headers- A map of custom HTTP headers added to all API requests (marked as sensitive)http_path_prefix- A path prefix prepended to all API request URLsChanges:
Core Implementation (
internal/providers/client/databricks_client.go):HTTPConfigstruct to hold custom headers and path prefixhttpTransportWrapperimplementinghttp.RoundTripperthat injects headers and prepends path prefixPrepareDatabricksClientto accept optional*HTTPConfigand configure HTTP transportSDKv2 Provider (
internal/providers/sdkv2/sdkv2.go):http_headersschema field (TypeMap, optional, sensitive)http_path_prefixschema field (TypeString, optional)ConfigureDatabricksClientto read and pass HTTP configPlugin Framework Provider (
internal/providers/pluginfw/pluginfw.go):http_headersschema field (MapAttribute with StringType)http_path_prefixschema field (StringAttribute)configureDatabricksClientto read and pass HTTP configUnit Tests:
internal/providers/client/databricks_client_test.go: Tests forhttpTransportWrapperRoundTrip behaviorinternal/providers/sdkv2/sdkv2_test.go: Schema validation and configuration testsImplementation Details:
HTTPTransportfield to inject a customhttp.RoundTripperreq.Header.Set()req.URL.Path(trailing slashes are trimmed)http_headersis marked as sensitive to avoid logging credentialsExample Usage:
Tests
make testruns locally (2615 tests pass)docs/folderconfig.HTTPTransport)NEXT_CHANGELOG.mdfile