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

Add support for Vault KV secrets engine v2 #86

Merged
merged 5 commits into from
Mar 24, 2021
Merged

Conversation

philippgille
Copy link
Member

@philippgille philippgille commented Mar 22, 2021

This PR builds on top of #84 (thanks @mopemope!), but completely separates the handling of Vault KV secret engine v1 and v2 to ensure that no breaking changes are introduced for v1 users, for example when asking for the secret with key "data".

This PR also

  • adds a test for the v2 backend, also adding a newer Vault version in CI (not the newest one, only the oldest one that leads to our Vault backend v1 implementation not working anymore)
  • changes the tests to use "data" as key to make sure no handling of "data" in the implementation breaks that

ℹ️ In the future it could be nice to have both secret engines handled by one backend, but it might require a bit more work, similar to what the Vault CLI does here: https://github.com/hashicorp/vault/blob/28fc7714655b34d700150f8f81589013d6a07e55/command/kv_get.go#L94-L147

Background info:

@philippgille philippgille marked this pull request as ready for review March 22, 2021 17:47
@philippgille philippgille requested a review from a team March 22, 2021 17:47
Copy link
Member

@skateinmars skateinmars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

backend/vault/vault.go Outdated Show resolved Hide resolved
Copy link

@ckawasaki-isp ckawasaki-isp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Co-authored-by: Jean-Philippe Moal <[email protected]>
@philippgille
Copy link
Member Author

philippgille commented Mar 24, 2021

The CI jobs only failed because the Vault Docker container didn't start for some of the build jobs (Docker registry rate limit hit), but 1. not consistently for the PR and push builds (in one the Go 1.12 build worked but not the Go 1.13 one, the other way around in the other build), 2. both builds worked on Travis CI in another branch with the same changes recently and 3. the tests succeed locally. => Merging.

@philippgille philippgille merged commit a80b748 into master Mar 24, 2021
@skateinmars skateinmars deleted the feature/vault-kv-v2 branch March 25, 2021 09:39
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.

None yet

4 participants