mirror of
https://github.com/Luzifer/password.git
synced 2024-11-08 17:30:10 +00:00
Add ability for XKCD style passwords to workflow
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c8c6485064
commit
8ca878e760
1 changed files with 7 additions and 2 deletions
|
@ -20,6 +20,7 @@ descriptions = {
|
|||
def main(wf):
|
||||
password_length = 20
|
||||
use_special = False
|
||||
use_xkcd = False
|
||||
|
||||
if len(wf.args):
|
||||
for arg in wf.args[0].split():
|
||||
|
@ -27,10 +28,12 @@ def main(wf):
|
|||
password_length = int(arg)
|
||||
elif arg == 's':
|
||||
use_special = True
|
||||
elif arg == 'x':
|
||||
use_xkcd = True
|
||||
|
||||
if password_length < 5 or password_length > 256:
|
||||
if password_length < 4 or password_length > 256:
|
||||
wf.add_item(title="Password length out of bounds",
|
||||
subtitle="Please use a reasonable password length between 5 and 256")
|
||||
subtitle="Please use a reasonable password length between 4 and 256")
|
||||
wf.send_feedback()
|
||||
return 1
|
||||
|
||||
|
@ -39,6 +42,8 @@ def main(wf):
|
|||
str(password_length)]
|
||||
if use_special:
|
||||
command.append("-s")
|
||||
if use_xkcd:
|
||||
command.append("-x")
|
||||
result = json.loads(subprocess.check_output(command).strip())
|
||||
|
||||
hashed = []
|
||||
|
|
Loading…
Reference in a new issue