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 minimum_seconds credential read option #16

Closed DrDaveD closed 4 years ago

DrDaveD commented 4 years ago

This adds a minimum_seconds option to the credential read option. If there are less than that many seconds remaining to the lifetime of a cached access token, it gets a new access token.

DrDaveD commented 4 years ago

I force-pushed to put the commit message into ESLint format.

impl commented 4 years ago

Another potential problem I just thought of is that there's no guarantee a freshly minted token will have an expiry outside of the requested duration, in which case we should probably also just return an error.

DrDaveD commented 4 years ago

Unfortunately I'm going to be tied up the rest of the week, I'll respond next week. I should be able to add tests.

DrDaveD commented 4 years ago

Another potential problem I just thought of is that there's no guarantee a freshly minted token will have an expiry outside of the requested duration, in which case we should probably also just return an error.

Alright, I'll add a call to tokenOk2Reuse (or whatever we end up calling it) to the credsUpdateOperation code exchange.

DrDaveD commented 4 years ago

Once again I force-pushed to put commit messages in ESLint format (that's so hard to remember)