Introduce Vault KVv2 secret storage support#68
Open
kelnage wants to merge 3 commits intografana:mainfrom
Open
Conversation
jeschkies
requested changes
Jan 2, 2026
Collaborator
jeschkies
left a comment
There was a problem hiding this comment.
This is a really nice solution. I just think we need to overhaul the credentials providers.
Comment on lines
11
to
17
| type secretFetcher interface { | ||
| FetchFromAWSSecretsManager(ctx context.Context, secretArn string) (string, error) | ||
| FetchFromAWSSSMParameterStore(ctx context.Context, parameterArn string) (string, error) | ||
| FetchFromVault(ctx context.Context, key string) (string, error) | ||
| HasVaultConfig() bool | ||
| SetVaultConfig(config *VaultKVCredentials) | ||
| } |
Collaborator
There was a problem hiding this comment.
I wonder if we should change it so that the fetcher is injected in main depending on the config. This way we don't need HasVaultConfig. We could also mimic the credentials chain like in AWS. We define a Provider interface and then implement each plus a ChainProvider.
| return "", fmt.Errorf("no auth info was returned after login") | ||
| } | ||
|
|
||
| data, err := client.KVv2(c.vaultConfig.mount).Get(ctx, c.vaultConfig.path) |
Collaborator
There was a problem hiding this comment.
I would have thought that Vault would call an API. Is this actually mounting a volume? Also, this only works if Vault is also hosted on AWS right?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for fetching secrets (the
USERNAME,PASSWORD, andBEARER_TOKEN) from a configured Vault KVv2 mount path. It uses the IAM authentication approaches described in the Vault AWS auth documentation, and the implementation is partly built around the provided code example.It extends the the secret client to store both the Vault configuration (role, mount, and path) and a cache of the fetched secret data, in order to minimise time fetching environment variables and requests to Vault.
If this implementation seems reasonable, I'd be happy to update the documentation to reflect its intended usage.