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

Enable vault.client.api-util/api-request to support Agent-based authentication #63

Closed
emilywoods opened this issue Apr 28, 2022 · 2 comments
Milestone

Comments

@emilywoods
Copy link

Vault Agent can be used to handle all of the Vault authentication for an application. This means that the application doesn’t manage its own Vault tokens i.e. it can make API calls to Vault through the agent without having to retrieve a token beforehand, and the app doesn’t need to include the X-Vault-Token header in the request.

As far as I understand, since api-request checks that there is a token associated with the client and includes the X-Vault-Token header in the request, it does not support agent-based authentication.

It would be great if this was supported in api-request, and I believe it would be possible by making the following changes:

  • The client authentication check could be made optional
  • The X-Vault-Token header would be set only if there is a token associated with the client
@greglook
Copy link
Collaborator

greglook commented May 9, 2022

Neat, I hadn't looked into the Vault agent before - sounds like it handles many of the things that the client code is doing right now. In that case you'd just want this as a pass-through library, assuming that the agent presents an HTTP API that is otherwise similar to the one that you'd get on the Vault server. 🤔

@emilywoods
Copy link
Author

sounds like it handles many of the things that the client code is doing right now

The Agent can be used to handle authentication at least, so applications interacting with the Vault server via the client don't need to worry about this or managing a token. :)

assuming that the agent presents an HTTP API that is otherwise similar to the one that you'd get on the Vault server

The Agent can be used as a proxy, which handles all authentication on behalf of the application. The client can interact with the Vault HTTP API as it is doing now, just without including the X-Vault-Token header.

Would you be open to receiving a PR which could allow vault.client.api-util/api-request to support this?

@greglook greglook added this to the 2.x milestone Sep 26, 2022
@greglook greglook closed this as completed Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants