Repository navigation
feat(cli): get, edit and delete commands - #33
Open
ericliswan wants to merge 5 commits into
Open
ericliswan wants to merge 5 commits into
ericliswan wants to merge 5 commits into
Conversation
Adds the shared chooser used by get, edit and delete: one match is taken as is, several are listed by number (site and username only) and the user picks one. A bad answer is not echoed back in the error, since a misaligned --password-stdin line could be a secret. Without --show, get explains that clipboard copy is not there yet. Refs #32
get --show into a pipe or file can leave the password in a log or file the user did not mean to write. --force (only valid with --show) is for when that is the point. The check runs before unlocking so a refused run does not pay for the KDF. Refs #32
--username, --password and --notes form a required clap group that allows only one, so a run always prompts for exactly one new value. The secret fields use hidden prompts, an empty password is rejected as in add, and Vault::update bumps updated_at. The non-empty password check moves to a helper shared with add. Refs #32
Shows the chosen entry's site and username and deletes only on y or yes; anything else keeps it and exits 0. --yes skips the question for scripts. The previous file stays as <vault>.bak, as on every save. Refs #32
Two entries share a site in different case. The test covers the numbered choice, the non-terminal refusal and its --force override, every edit field (secrets never echoed on stderr, updated_at bumped), a declined delete, --yes, and clap rejecting zero or two edit fields. Refs #32
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
Adds
pwv get,pwv editandpwv delete. They share a chooser: one matching entry is used directly; when several match (case-insensitive), they are listed by number with site and username only, and the user picks one.get --showprints the password and refuses a non-terminal stdout unless--force. Without--show,getexplains that clipboard copy arrives in plan PR #18.editchanges exactly one field per run.deleteasks before removing, and--yesskips the question.Closes #32
Type of change
How was this tested?
cargo fmt --all --check;cargo clippy --workspace --all-targets [--all-features] -- -D warnings;cargo test -p pwv-cli [--all-features];cargo deny check.insecure-test-kdf) with two entries for one site:--forceoverrides it.updated_atbumped and no new secret on stderr.y/YESdeletes it;--yesdeletes it without asking.editwith zero or two field flags, andget --forcewithout--show.Security checklist
--password-stdinline could be a secret.pwv-core::kdf/pwv-core::crypto(no crypto in this PR)Notes for the reviewer