Skip to content

Commit

Permalink
fix: search in fullpath
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrinux authored and xbglowx committed Apr 4, 2024
1 parent f2aef59 commit 6afa8a0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/vault-kv-search.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6afa8a0

Please sign in to comment.