spring-projects / spring-vault

Provides familiar Spring abstractions for HashiCorp Vault
https://spring.io/projects/spring-vault
Apache License 2.0
283 stars 186 forks source link

differentiate between token refresh and lease renewals #647

Closed biktokle closed 3 years ago

biktokle commented 3 years ago

It seems like the spring.cloud.vault.config.lifecycle.enabled=true configuration triggers the renewal of both the authentication token and the leased secrets. In my use case I am trying to avoid renewing the leases, but I do need to keep the token valid. The only solution I have found until now is setting the min-renewal to be very large (since it affects only the leases). Is there any way to differentiate between token refresh and lease renewals?

mp911de commented 3 years ago

There's a property spring.cloud.vault.session.lifecycle.enabled to disable (enabled by default) authentication token lifecycle management. With spring.cloud.vault.session.lifecycle.enabled set to false, Spring Vault logs into Vault only once and reuses the login token throughout the application lifetime, even if the token expires.