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

Add configuration option for X-Vault-Request header #639

Open
bt5e opened this issue Apr 6, 2022 · 1 comment
Open

Add configuration option for X-Vault-Request header #639

bt5e opened this issue Apr 6, 2022 · 1 comment

Comments

@bt5e
Copy link

bt5e commented Apr 6, 2022

Is your feature request related to a problem? Please describe.
When vault agent is configured to enforce X-Vault-Request header requirement, spring vault would error out with

missing 'X-Vault-Request' header; nested exception is org.springframework.web.client.HttpClientErrorException: 412 Precondition Failed: "{"errors":["missing 'X-Vault-Request' header"]}<EOL>"

Describe the solution you'd like
A configuration option to add the X-Vault-Request header in all requests to vault.

Describe alternatives you've considered
We have turned off the X-Vault-Request header requirement from vault agent side for now.

Additional context
Vault documentation: https://www.vaultproject.io/api-docs#the-x-vault-request-header

@mp911de
Copy link
Member

mp911de commented Apr 7, 2022

You can customize default headers through RestTemplateBuilder:

RestTemplateBuilder builder = RestTemplateBuilder.builder().….defaultHeader("X-Vault-Request", "true");
VaultTemplate template = new VaultTemplate(builder);

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

No branches or pull requests

2 participants