Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] Add XCKD pwgen config options #2651

Merged
merged 3 commits into from
Sep 9, 2023

Conversation

dominikschulz
Copy link
Member

This commit adds three new config options to influence the default behaviour of the XKCD password generator.

  • pwgen.xkcd.sep for the word separator (string)
  • pwgen.xkcd.lang for the language (string)
  • pwgen.xkcd.len for the number of words (int)

Fixes #2595

This commit adds three new config options to influence the default
behaviour of the XKCD password generator.

* pwgen.xkcd.sep for the word separator (string)
* pwgen.xkcd.lang for the language (string)
* pwgen.xkcd.len for the number of words (int)

Signed-off-by: Dominik Schulz <[email protected]>
@dominikschulz dominikschulz added the feature Enhancements and new features label Sep 7, 2023
@dominikschulz dominikschulz added this to the 1.15.8 milestone Sep 7, 2023
@dominikschulz dominikschulz self-assigned this Sep 7, 2023
Copy link
Member

@AnomalRoil AnomalRoil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but should we also change it here:

if length == "" {
candidateLength := defaultXKCDLength
question := "How many words should be combined to a password?"
iv, err := termio.AskForInt(ctx, question, candidateLength)

to not ask for the length when one is configured?

Also note that I think the gopass generate -g xkcd nameofentry command isn't affected by this change since it doesn't use xkcdGen:

return xkcdgen.RandomLengthDelim(pwlen, xkcdSeparator, c.String("lang"))

So this effectively only affects gopass pwgen which is arguably less useful than gopass generate, no?

@dominikschulz dominikschulz merged commit 8389fbd into gopasspw:master Sep 9, 2023
8 checks passed
@dominikschulz dominikschulz deleted the fix/issue-2595 branch September 9, 2023 07:28
orangekame3 added a commit to orangekame3/gopass that referenced this pull request Oct 4, 2023
This commit fixes golangci-lint error.

```
Signed-off-by: orangekame3 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Enhancements and new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make xkcdsep and xkcdlang config options
2 participants