Skip to content

Add -Purpose/-UsedBy to Set-StrongboxSecret so set can register manifest entries - #33

Open
jpol34 wants to merge 1 commit into
mainfrom
claude/set-purpose-manifest-registration
Open

jpol34 wants to merge 1 commit into
mainfrom
claude/set-purpose-manifest-registration

Conversation

@jpol34

@jpol34 jpol34 commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • strongbox set (interactive/stdin/clipboard modes) had no way to make a newly-set secret show up in list/the web UI — manifest.json only ever got updated by hand-editing it after the fact.
  • Adds optional -Purpose/-UsedBy to Set-StrongboxSecret, and --purpose/--used-by to the CLI's set subcommand. When -Purpose is given, it upserts the matching manifest entry (matched by name + scope/project, same lookup Pull-StrongboxSecret already uses). Omitting it leaves manifest.json untouched — a secret is still written and gettable, just not tracked/listed, same as today.
  • New private helper Set-StrongboxManifestEntry does the upsert.

Test plan

  • Invoke-Pester Tests/Strongbox.Tests.ps1 — 47 passed (4 new cases: no-op without -Purpose, new-entry creation, existing-entry update, project/global non-collision)
  • Invoke-Pester Tests/Strongbox.Cli.Tests.ps1 — 18 passed (unaffected, usage text updated)
  • Reinstalled the module (Install-StrongboxModule.ps1) and manually ran strongbox set tools.StrongboxSelfTest ... --purpose ... --used-by ... end to end against the real vault — confirmed via strongbox list --json

…ifest entries

strongbox set (interactive/stdin/clipboard modes) had no way to make a newly
set secret show up in `list`/the web UI - manifest.json only ever got updated
by hand-editing it after the fact. Passing -Purpose (optionally with -UsedBy)
now upserts the manifest entry directly; omitting it keeps prior behavior
(secret is written and gettable, just untracked).
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.

2 participants