From 6afa8a0e55e8f512e8472859496644cbb39199bd Mon Sep 17 00:00:00 2001 From: Cyril Levis Date: Thu, 4 Apr 2024 15:19:42 +0200 Subject: [PATCH] fix: search in fullpath --- cmd/vault-kv-search.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/vault-kv-search.go b/cmd/vault-kv-search.go index 88934da..92fa785 100644 --- a/cmd/vault-kv-search.go +++ b/cmd/vault-kv-search.go @@ -160,8 +160,14 @@ func (vc *vaultClient) secretMatch(dirEntry string, fullPath string, searchObjec if vc.useRegex { found, _ = regexp.MatchString(vc.searchString, term) + if !found && searchObject == "path" { + found, _ = regexp.MatchString(vc.searchString, fullPath) + } } else { found = strings.Contains(term, vc.searchString) + if !found && searchObject == "path" { + found = strings.Contains(fullPath, vc.searchString) + } } if found {