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

Specify headers by environment variable #21993

Merged
merged 5 commits into from
Jun 19, 2024

Conversation

JacobHenner
Copy link
Contributor

Allow vault CLI HTTP headers to be specified by environment variable. This is especially useful in situations where header values should not be exposed as vault command parameters (secrets, for example). This builds on the work introduced in #8754.

Fixes #16663

@hashicorp-cla
Copy link

hashicorp-cla commented Jul 20, 2023

CLA assistant check
All committers have signed the CLA.

@schavis schavis added the needs-eng-review Community PR waiting for ENG review label Aug 31, 2023
Copy link
Contributor

@VioletHynes VioletHynes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there @JacobHenner ! Sorry that this has lingered for a while, but this looks great.

As well as the comment I left about the conversion, there's a few other things I'd like to see before we approve and merge this:

If all of that is addressed, I'd be happy to get this merged. Let me know if you have any questions, and thank you for your patience in getting eyes on this.

api/client.go Show resolved Hide resolved
api/client.go Outdated Show resolved Hide resolved
@JacobHenner JacobHenner requested a review from a team as a code owner June 19, 2024 03:17
@JacobHenner
Copy link
Contributor Author

Hey there @JacobHenner ! Sorry that this has lingered for a while, but this looks great.

As well as the comment I left about the conversion, there's a few other things I'd like to see before we approve and merge this:

* The name of the environment variable should be in the changelog!

* An entry in `website/content/docs/commands/index.mdx` (our docs for the CLI) for the header and what it does (plus an example!)

* A test of the behaviour, to make sure it behaves as expected. For prior art, [CLI: add new -header option to be able to add headers to all cli http request #12508](https://github.com/hashicorp/vault/pull/12508) might be a good starting point

If all of that is addressed, I'd be happy to get this merged. Let me know if you have any questions, and thank you for your patience in getting eyes on this.

Done

Copy link
Contributor

@VioletHynes VioletHynes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there! Thanks for the updates, this looks great. I'm running all of the tests but assuming everything looks good I'll try and get this merged today.

We really appreciate your patience in getting this seem to. This is a fantastic value add, so I'm really excited to get it in.

@VioletHynes
Copy link
Contributor

@JacobHenner One last thing before I can merge this -- this is failing our linter, could you run make fmt and push that commit? Once that's added, I can merge this! Everything else is passing!

Thanks in advance :)

@JacobHenner
Copy link
Contributor Author

@JacobHenner One last thing before I can merge this -- this is failing our linter, could you run make fmt and push that commit? Once that's added, I can merge this! Everything else is passing!

Done, sorry for not catching earlier.

@VioletHynes VioletHynes merged commit 46a41a5 into hashicorp:main Jun 19, 2024
67 of 68 checks passed
@VioletHynes
Copy link
Contributor

Merged! Thanks again for this contribution, and we really appreciate your patience in getting this seen to and merged.

🚢 🚢 🚢

@JacobHenner JacobHenner deleted the environment-var-headers branch June 20, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-eng-review Community PR waiting for ENG review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add arbitrary headers as ENV (like vault -header)
4 participants