-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Problem
I often find myself needing to generate a password where characters such as ' " \ or a backtick are not allowed.
A while back the --exclude flag was added in #23, but I often find myself hitting this scenario:
$ pws gen example-passwd --exclude '\\`\'"'
dquote>
Usually I'm too lazy to figure out the proper quoting conventions for these characters in my current shell, and often my workflow for sites that block characters like these is to do this:
pws gen example-passwd --charpool 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()_-+='Which works, but is a bit much in terms of manual typing.
Even then, sometimes sites will reject some of those characters. So I end up defaulting to:
pws gen example-passwd --charpool 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890'Proposed Solution:
Add two new options:
--alphanumericto generate a password only matching the character class[A-Za0-9a-z]--simpleto generate a password only matching the character class[0-9a-zA-Z!@#$%^&*()]
I've taken the liberty of prototyping a few Gherkin tests about what the end behavior might look like:
Scenario: Generate a new password for "github", using only alphanumeric characters
Given A safe exists with master password "my_master_password"
When I run `pws generate github 0 --alphanumeric` interactively
And I type "my_master_password"
Then the output should contain "Master password:"
And the output should contain "The password for github has been added"
And the output should contain "The password for github has been copied to your clipboard"
And the clipboard should match ^[0-9a-zA-Z]{64}$
Scenario: Generate a new password for "github", using only alphanumeric and no special characters
Given A safe exists with master password "my_master_password"
When I run `pws generate github 0 --basic` interactively
And I type "my_master_password"
Then the output should contain "Master password:"
And the output should contain "The password for github has been added"
And the output should contain "The password for github has been copied to your clipboard"
And the clipboard should match ^[0-9a-zA-Z!@#$%^&*()]{64}$Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels