Is your feature request related to a problem? Please describe.
We have many application based on Spring Vault Cloud 1.1.3. We want to migrate to kubernetes and use Vault Agent Caching as 'sidecar' container.
But as we know:
We want make sure the requests made to vault agent will be always forwarded to the Vault server with the auto-auth token attached.
Describe the solution you'd like
Could we provide new configuration flag, like use_auto_auth_token_enforce?
It feels like the right solution is to instead patch Spring Vault to allow an empty token.
Hi @jefferai ,
Spring Vault will be coupled with source code. And vault agent is 'sidecar' component.
So, we think patch vault agent is more easier.
PS. In my option, Spring Vault 1.x is too old, nobody will patch it.
Looking at Spring Vault codebase, it would be a very difficult patch given that the internal notion of VaultToken is being carried all throughout the code, so adding a multitude of checks for if vaultToken == null would be a bit rough. ;)
It also does not help with any other frameworks which might, or might not, also have the same expectation of always expecting a vault token to be present.
Looking at the vault agent codebase it "appears" that the fix could be relatively simple.
use_auto_auth_token_enforce to https://github.com/hashicorp/vault/blob/master/command/agent/config/config.go#L45cache.Handler in https://github.com/hashicorp/vault/blob/master/command/agent.go#L459use_auto_auth_token_enforce is set to true, ignore setting the token from client request header in https://github.com/hashicorp/vault/blob/master/command/agent/cache/handler.go#L27I merged https://github.com/hashicorp/vault/pull/8101 , and will follow up with a separate pull request the corresponding documentation
Most helpful comment
It feels like the right solution is to instead patch Spring Vault to allow an empty token.