Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental: Higher level VaultClient #228

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rossabaker
Copy link
Collaborator

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.

@zcox
Copy link

zcox commented Jul 6, 2021

👍 I like the VaultClient idea.

@zmccoy
Copy link
Collaborator

zmccoy commented Jul 6, 2021

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

@rossabaker
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants