Add Vault-style passphrase generation for record-add and record-updat…#205
Open
mtyagi-ks wants to merge 2 commits into
Open
Add Vault-style passphrase generation for record-add and record-updat…#205mtyagi-ks wants to merge 2 commits into
mtyagi-ks wants to merge 2 commits into
Conversation
…e via :passphrase
adeshmukh-ks
reviewed
Jul 2, 2026
| class KeeperPassphraseGenerator(PasswordGenerator): | ||
| """Vault-style passphrase generator using the bundled diceware word list. | ||
|
|
||
| Produces ordered word passphrases (not shuffled) matching Keeper Vault behavior: |
Contributor
There was a problem hiding this comment.
remove the non shuffled part as the words are selected randomly
adeshmukh-ks
reviewed
Jul 2, 2026
| if self.capitalize and word: | ||
| word = word[0].upper() + word[1:] | ||
| if self.append_number and first_word: | ||
| word += str(secrets.randbelow(10)) |
Contributor
There was a problem hiding this comment.
is this only for first word or after every word? check UI and ensure the implementations are in sync
adeshmukh-ks
reviewed
Jul 2, 2026
| passphrase = '' | ||
| first_word = True | ||
| for _ in range(self.word_count): | ||
| word = secrets.choice(self._vocabulary) |
Contributor
There was a problem hiding this comment.
secrets is secure random word/number selector?
sali-ks
approved these changes
Jul 2, 2026
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.
Add Vault-style passphrase generation for record-add and record-update via $GEN:passphrase
Introduce KeeperPassphraseGenerator and supporting parsing helpers in the SDK,
aligned with Commander and Keeper Vault behavior. Users can now generate
word-based passphrases when creating or updating records:
password=$GEN:passphrase[,word_count][,separator][,capitalize][,number]
SDK (generator.py):
related helpers for word count (5–9), separators, and boolean options
via create_with_options / create_from_policy
CLI (record_edit.py):
(password, error) for validation failures
requested instead of silently creating an unencrypted key
Tests: