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

Fixes Namespace Concat Bug for KV2 secrets #1921

Merged
merged 12 commits into from
May 6, 2024
10 changes: 10 additions & 0 deletions dependency/vault_read.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,16 @@ func shimKVv2Path(rawPath, mountPath string) string {
if strings.HasPrefix(p, "data/") || strings.HasPrefix(p, "metadata/") {
return rawPath
}

// If the raw path contains "/data/", it means the namespace on the Vault client
// is different from the namespace prefixing the rawPath. We want to
divyaac marked this conversation as resolved.
Show resolved Hide resolved
// keep the rawPath as is, and have the Vault client can pass the namespace as it's header
divyaac marked this conversation as resolved.
Show resolved Hide resolved
// so the concatenation is handled by the Vault server.
if strings.Contains(p, "/data/") {
divyaac marked this conversation as resolved.
Show resolved Hide resolved
return rawPath

}

return path.Join(mountPath, "data", p)
}
}
Loading