-
Notifications
You must be signed in to change notification settings - Fork 783
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
dependency: fix kv2 data path prefix checking #1341
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense to me!
dependency/vault_common.go
Outdated
@@ -333,14 +333,15 @@ func isKVv2(client *api.Client, path string) (string, bool, error) { | |||
return mountPath, false, nil | |||
} | |||
|
|||
func addPrefixToVKVPath(p, mountPath, apiPrefix string) string { | |||
func addPrefixToVKVPath(p, mountPath, apiPrefixRaw string) string { | |||
apiPrefix := path.Clean(apiPrefixRaw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Clean() here? The KV prefixes have a path like structure, they don't follow all the rules. Seems like it might have some unintended side effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the context on the prefix structure and good point, updated changes to make it more explicit on the trailing /
check
feaa7b8
to
8d0ec8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The implicit
/data/
path prefix for kv2 secrets were not properly prepended for secret paths matching/data*
.Fixes #1340