mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
adds X-Terraform-Integration header
This can help differentiate cloud integration API requests from normal remote backend requests
This commit is contained in:
parent
3d23a8e062
commit
6d9c919f55
@ -36,6 +36,8 @@ const (
|
||||
defaultHostname = "app.terraform.io"
|
||||
defaultParallelism = 10
|
||||
tfeServiceID = "tfe.v2"
|
||||
headerSourceKey = "X-Terraform-Integration"
|
||||
headerSourceValue = "cloud"
|
||||
)
|
||||
|
||||
// Cloud is an implementation of EnhancedBackend in service of the Terraform Cloud/Enterprise
|
||||
@ -254,6 +256,7 @@ func (b *Cloud) Configure(obj cty.Value) tfdiags.Diagnostics {
|
||||
|
||||
// Set the version header to the current version.
|
||||
cfg.Headers.Set(tfversion.Header, tfversion.Version)
|
||||
cfg.Headers.Set(headerSourceKey, headerSourceValue)
|
||||
|
||||
// Create the TFC/E API client.
|
||||
b.client, err = tfe.NewClient(cfg)
|
||||
|
Loading…
Reference in New Issue
Block a user