Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.0
0.18.1
14 changes: 13 additions & 1 deletion entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (c *Client) getEntries(ctx context.Context, vaultId string, opts GetEntries
if opts.Name != nil {
q.Set("name", *opts.Name)
}
if opts.Path != nil {
if opts.Path != nil && *opts.Path != "" {
q.Set("path", *opts.Path)
}
q.Set("page", fmt.Sprintf("%d", currentPage))
Expand Down Expand Up @@ -241,5 +241,17 @@ func (c *Client) getEntries(ctx context.Context, vaultId string, opts GetEntries
currentPage++
}

// When path is explicitly set to "", the server ignores the filter and returns all entries.
// We apply client-side filtering to return only root-level entries (entries with no path).
if opts.Path != nil && *opts.Path == "" {
var rootEntries []Entry
for _, entry := range allEntries {
if entry.Path == "" {
rootEntries = append(rootEntries, entry)
}
}
return rootEntries, nil
}

return allEntries, nil
}