spring-cloud / spring-cloud-vault

Configuration Integration with HashiCorp Vault
http://cloud.spring.io/spring-cloud-vault/
Apache License 2.0
272 stars 151 forks source link

Add a token file authentication mechanism #611

Closed tbrantb closed 2 years ago

tbrantb commented 2 years ago

Add an authentication mechanism to load a vault token from a file rather than the static declaration of the TOKEN authentication mechanism.

This is particularly helpful for local development when using the Vault CLI to obtain a token. Once logged in to Vault via the Vault CLI, by default a file is placed in the user's home directory at ~/.vault-token which contains the vault token. Rather than copying that file to a local variable or exporting an environment variable and restarting shells or development environments, just use the provided file to retrieve the token and run/test application.

More unit tests are needed, but I could use some pointers.

Would love to see about adding to a 3.0.x patch release in addition to the 3.1.0 mainline.

tbrantb commented 2 years ago

Will attempt a different approach