Skip to content

feat(search): add --context flag to show parent object of matches#30

Merged
f3rdy merged 1 commit intomasterfrom
feature/search-context
Mar 14, 2026
Merged

feat(search): add --context flag to show parent object of matches#30
f3rdy merged 1 commit intomasterfrom
feature/search-context

Conversation

@f3rdy
Copy link
Copy Markdown
Contributor

@f3rdy f3rdy commented Mar 14, 2026

Summary

  • Add --context / -c flag to vaultctl search that shows the parent dict of each matched field
  • Sibling fields are redacted by default (****), matched field shows first 4 chars + ...
  • Combine with --show-match to display all field values in cleartext
  • Multiple matches in the same parent object are grouped into a single block

Closes #20

Test plan

  • Unit tests for search_values(include_context=True) covering nested dicts, lists, top-level strings, multiple matches
  • CLI integration tests for --context, --context --show-match, and top-level string fallback
  • All 298 tests pass, 88% coverage
  • mypy strict, ruff, bandit clean

When searching vault values, --context displays the parent dict of each
match with sibling fields redacted by default. Combine with --show-match
to reveal all field values. Matches are grouped by parent path.
@f3rdy f3rdy merged commit 47a015e into master Mar 14, 2026
2 checks passed
@f3rdy f3rdy deleted the feature/search-context branch March 14, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant