Repository navigation
feat(cli): init command - #29
Merged
Merged
Conversation
The vault is created only after both entries match, and init refuses to run when a vault already exists at the target path. Refs #28
The replaced vault stays recoverable as <vault>.bak, which storage already writes before every rename. Refs #28
Requires at least 12 characters and a zxcvbn score of 3, checked before the confirmation prompt. The error repeats zxcvbn's fixed feedback text so the user learns why, without the password appearing in the output. Refs #28
Covers unlocking the new vault, refusing to overwrite without --force, keeping the replaced file as .bak, and rejecting mismatched or weak passwords without echoing them. pwv-cli forwards insecure-test-kdf to pwv-core; without it these tests are ignored, because the production KDF takes several seconds per run in a debug build. Refs #28
Owner
Author
|
Self-review: read the full
Not covered: interactive hidden prompts on a real TTY (manual only). |
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
Implements
pwv init. It prompts for the master password twice, rejects passwords shorter than 12 characters or with a zxcvbn score below 3, and creates an empty vault. It refuses to replace an existing vault unless--forceis given; in that case the old file is kept as<vault>.bak.Closes #28
Type of change
How was this tested?
cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings(and without features),cargo test --workspace --all-features,cargo deny check--forcereplaces it and keeps the old bytes in.bak; mismatched and weak passwords fail without creating a file or echoing the password--forceand weak passwords on macOSSecurity checklist
pwv-core::kdf/pwv-core::cryptoNotes for the reviewer
pwv-cli/insecure-test-kdfforwards to pwv-core and is off by default. Without it, the vault-creating CLI tests areignored with a reason, because the production KDF in a debug build took 23 s for three tests. CI's--all-featuresrun executes them.zxcvbn3.1.1 (MIT). It pulls inderive_builder,fancy-regex,itertoolsandlazy_static, andcargo denyis clean.