Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch to support VAULT_HTTP_PROXY variable #12582

Merged

Conversation

mikeyyuen
Copy link
Contributor

What has been changed

This patch creates VAULT_HTTP_PROXY which can be used to override the default behavior of the Vault API Client.

  • Without VAULT_HTTP_PROXY set the Vault API Client will continue to work as before using the default Go HTTP behavior, reading HTTPS_PROXY as before so the changes should likely not affect any existing users.
  • With VAULT_HTTP_PROXY set, the Vault API Client creates a specific Go http transport with the proxy set via the Go API forcing it to use the specified proxy to communicate with the Vault binary.

Why is this useful

If the Vault Client has been embedded in software (e.g. terraform provider, consul-template or other) that might need to use different proxies to talk to vault vs other upstream services such as AWS, Azure, GCP (as described in hashicorp/terraform-provider-vault#1150), this allows the vault behavior to be specifically controlled.

@hashicorp-cla
Copy link

hashicorp-cla commented Sep 20, 2021

CLA assistant check
All committers have signed the CLA.

@vercel vercel bot temporarily deployed to Preview – vault September 20, 2021 09:29 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 20, 2021 09:29 Inactive
@heatherezell
Copy link
Contributor

Hello, and welcome to the HashiCorp Vault community! Please note that we are moving to a process where PRs need to be associated with an issue, either an existing one or a new issue, so that the community and the engineers can discuss implementation details, strategy, and where the request fits into an existing roadmap. Additionally, all PRs do need to have the CLA signed. Please feel free to create or link an existing issue to this PR. Thanks!

@davidducros davidducros force-pushed the vault-http-proxy-env-variable branch from f6a553a to b39bfbb Compare September 22, 2021 11:53
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 22, 2021 11:53 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 22, 2021 11:53 Inactive
@vercel vercel bot temporarily deployed to Preview – vault September 22, 2021 13:53 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 22, 2021 13:53 Inactive
@davidducros
Copy link
Contributor

The CLA signing has now been recognised properly and an issue to cover this has been created here: #12613

api/client.go Outdated Show resolved Hide resolved
api/client.go Outdated Show resolved Hide resolved
@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 12:01 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 12:01 Inactive
@ncabatoff
Copy link
Collaborator

@ncabatoff
Copy link
Collaborator

Oh, and we'll also need a changelog entry, as described in https://github.com/hashicorp/vault/blob/main/CONTRIBUTING.md#changelog-entries

@vercel vercel bot temporarily deployed to Preview – vault October 5, 2021 12:09 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 12:09 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook October 5, 2021 12:41 Inactive
@mikeyyuen mikeyyuen marked this pull request as ready for review October 5, 2021 14:00
@mikeyyuen mikeyyuen requested a review from taoism4504 as a code owner October 5, 2021 14:00
@ncabatoff
Copy link
Collaborator

Looks good, thanks! You'll need to merge in the latest changes from main so the tests pass before I can merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to override http_proxy/https_proxy to reach Vault
6 participants