puppetlabs / vault-plugin-secrets-oauthapp

OAuth 2.0 secrets plugin for HashiCorp Vault supporting a variety of grant types
Apache License 2.0
94 stars 11 forks source link

Add refresh_interval config option #43

Closed DrDaveD closed 3 years ago

DrDaveD commented 3 years ago

This adds a new config option "refresh_interval" which controls the number of seconds between periodically refreshing all the credentials, instead of making it always be one minute. When set to zero, it disables periodic refreshing and makes it be only on demand. I want it for disabling periodic refresh (because I don't think it scales, and because my refresh token are set to not expire for 30 days), but I thought other people might want to keep refreshing with a longer interval so I thought this was a good way to make it flexible.

I wanted to write some tests for this but I'm having trouble figuring out how TestPeriodicRefresh() works. Maybe you could explain it.