vault4s icon indicating copy to clipboard operation
vault4s copied to clipboard

Experimental: Higher level VaultClient

Open rossabaker opened this issue 3 years ago • 3 comments

Every function on Vault accepts the same two parameters, an HTTP client and a base URI. Most require a token, which requires periodic refreshing. That token is sometimes a VaultToken, sometimes a String. Sometimes it's first in the second parameter list, sometimes it's last, sometimes it's in the first parameter list.

This provides a VaultClient[F] algebra that hid the token entirely. The client is obtained as a resource by logging in, which spawns a fiber to keep the token current in a ref. The client transparently manages the token, and revokes it when the resource is disposed. The VaultClient does not break the existing Vault functions, and can be thought of as a higher-level access.

rossabaker avatar Jul 02 '21 22:07 rossabaker

👍 I like the VaultClient idea.

zcox avatar Jul 06 '21 15:07 zcox

I like the way that the VaultClient is going being more of a guided operational hand.

zmccoy avatar Jul 06 '21 15:07 zmccoy

Alright. I probably won't make much progress on it the next couple weeks, but that's enough encouragement to keep it in my queue.

rossabaker avatar Jul 06 '21 15:07 rossabaker