Adds Vault KV v2 support - #25
Open
Raven-182 wants to merge 1 commit into
Open
Conversation
freyes
requested changes
Jul 21, 2026
ahmad-can
reviewed
Jul 22, 2026
ahmad-can
reviewed
Jul 22, 2026
ahmad-can
reviewed
Jul 22, 2026
Signed-off-by: Raven Kaur <raven.kaur@canonical.com>
Raven-182
force-pushed
the
vaultlocker-kv-v2
branch
from
July 22, 2026 16:04
b4236b2 to
cbbd1ff
Compare
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 Vault KV v2 while keeping KV v1 as the default for existing deployments.
Changes
Vault KV support
Add an optional
kv_versionsetting tovaultlocker.conf.This is needed because the HVAC APIs and response formats are different for KV v1 and KV v2.
When the setting is omitted, vaultlocker continues to use KV v1, so existing deployments do not need to update their configuration.
Only KV versions
1and2are accepted.Secret storage
Add separate
KVStoreV1andKVStoreV2implementations for the HVAC KV APIs.This:
Update the encrypt and decrypt flows to use the new storage interface.
Compatibility
KV v1 remains the default, so existing deployments continue to read and write keys from the same paths.
Operators who want to move an existing mount to KV v2 can use
Vault's in-place KV upgrade
and then set:
kv_version = 2Vaultlocker does not need a separate migration command because this is handled by vault.
Tests
kv_versionvalues.Manual testing
Manually verified the vaultlocker encrypt and decrypt flows using Vault KV v1 and KV v2.
Assisted By: GPT-5.6 Sol
Related-bug: #2158148
Jira: OPEN-4605