Repository navigation
Add interactive, stdin, and clipboard input modes to strongbox set - #30
Merged
Merged
Conversation
strongbox set <name> with no value now prompts via a masked Read-Host (no echo, no retype-confirm); '-' reads the value from stdin for scripts; --from-clipboard reads it off the OS clipboard, clears it after, and is gated the same way get/reveal already are (refuses outside a real interactive terminal without --real, since clipboard content is ambient rather than something an automated caller should silently grab). Closes #28. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbfuHLCmCUaTFi6A1gKugh
- Restore the usage error when set resolves to an empty value (was silently writing empty-valued secrets) - Gate the bare interactive-prompt path the same way as --from-clipboard, so a non-interactive caller that omits a value fails fast instead of hanging on Read-Host against a non-terminal stdin - Match set's flag names exactly instead of a '--*' wildcard, so a literal value that happens to start with '--' is stored as given instead of being misread as "no value provided" - Deduplicate the non-interactive gate (get/reveal/set --from-clipboard/ set's bare prompt) into one Assert-StrongboxNonInteractiveGate helper - Extract Test-StrongboxPositionalValueGiven so the CLI tests exercise the real dispatch logic instead of duplicating its expression Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RbfuHLCmCUaTFi6A1gKugh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
strongbox set <name>with no value arg now prompts via maskedRead-Host -AsSecureString(no echo, no retype-confirm)strongbox set <name> -reads the value from stdin, for scriptsstrongbox set <name> --from-clipboardreads the value off the OS clipboard and clears it after, gated the same wayget/revealalready are (refuses outside a real interactive terminal without--real)--owner/--rotation-days/--scope/--projectare unaffectedTest plan
Invoke-Pester -Path Tests/Strongbox.Cli.Tests.ps1— 12/12 new tests passingInvoke-Pester -Path Tests/Strongbox.Tests.ps1— 43 passed, 1 pre-existing skip, no regressionsecho value | strongbox set tools.StrongboxSelfTest -thenget --realround-trips correctlystrongbox set personal.NotReal --from-clipboardrefuses non-interactively without--realtools.StrongboxSelfTestrestored to its documented placeholder value after manual testingCloses #28.
🤖 Generated with Claude Code
https://claude.ai/code/session_01RbfuHLCmCUaTFi6A1gKugh