Skip to content

[FEATURE] Add configuration for additional headers #1279

@eric-carlsson

Description

@eric-carlsson

Problem Statement

Hi,

We want to use Azure Workload Identity Federation to obtain access tokens that can be used with Databricks (see related discussions in #566, #737). Since this mechanism isn't implemented in the SDK, we have opted to obtain the access token manually, and pass it using the PAT authentication method (which also support OAuth access tokens).

This setup works great—except for a few specific endpoints, which require additional proprietary headers. If only the SDK allowed us to configure headers directly, we would not be locked into using one of the existing config implementations that append these headers.

Proposed Solution

I propose adding a configuration option to pass additional arbitrary headers to the HTTP client. This gives "advanced" users freedom to configure the client as they wish, and it future-proofs the SDK since newer features relying on headers can be used before they are natively implemented. If not specified, it has no effect.

Basically, I would like to see this:

config.go

type Config struct {
	...

	Headers    map[string]string `name:"headers" env:"HEADERS" auth:"sensitive"`
}

Which are then appended to the ApiClient.

Additional Context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions