gcp-vault icon indicating copy to clipboard operation
gcp-vault copied to clipboard

Reuse the vault client and token if it is valid

Open ctrox opened this issue 5 years ago • 0 comments

With this change the vault client is cached between Get and Put calls and avoids logging into vault every time. We use this library to read a (growing) number of secrets at a certain interval and noticed a big overhead from always doing the full login for each GetSecrets call. This caches the vClient and also reuses the token if it is still valid. It still makes a LookupSelf call to vault but that is way less expensive than the whole login flow. This might not be the most elegant solution so let me know if you have other ideas.

ctrox avatar Dec 17 '19 12:12 ctrox