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

Password Generator #86

Closed
wants to merge 4 commits into from
Closed

Password Generator #86

wants to merge 4 commits into from

Conversation

viera97
Copy link

@viera97 viera97 commented Oct 12, 2023

Espanso extension for generating passwords on windows systems

Copy link
Collaborator

@smeech smeech left a comment

Choose a reason for hiding this comment

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

No cmd or type: shell.
Nice readable python script - no malicious code apparent.
The naming convention for the package should be password-generator-win.
A few questions.

Copy link
Collaborator

@smeech smeech May 6, 2024

Choose a reason for hiding this comment

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

What does this file do? Is it needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Quite long but nice and readable.

Copy link
Collaborator

@smeech smeech Jun 30, 2024

Choose a reason for hiding this comment

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

On the other hand, you could dispense with the separate script and make package.yml something like:

  - regex: :genpass\((?P<myvar>\d*)\)
    replace: "{{output}}"
    vars:
      - name: output
        type: script
        params:
          args: 
            - python
            - -c
            - |
              import random, string, pyperclip
              characters = string.ascii_letters + string.punctuation + string.digits
              n = max(4, int('{{myvar}}') if '{{myvar}}'.isdigit() else 12)
              while True:
                password = ''.join(random.choice(characters) for _ in range(n))
                if (any(c.islower() for c in password) and any(c.isupper() for c in password) and any(c in string.punctuation for c in password) and any(c.isdigit() for c in password)):
                  break
              pyperclip.copy(password)
              print(password)

which should work in all OSs that have Python installed as there are no paths required.

Triggered by :genpass() for 12-character passwords, and :genpass(n) for n-length passwords.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could this be included in README.md?

Copy link
Collaborator

@smeech smeech May 6, 2024

Choose a reason for hiding this comment

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

What does this file do? Is it needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah - it's a reference to another package.

@smeech smeech added the question Further information is requested label Jun 1, 2024
@@ -0,0 +1,22 @@
# passwordgeneratorwin
[Espanso](https://espanso.org) extension for generating passwords and copy it to cliboard. For now this extension is only supported on windows systems, beacause of the difference of path between `dos` an `unix` systems. If your are looking this extension for `linux` or `mac` go to [passwordgeneratorlinux](https://github.com/viera97/passwordgeneratorlinux).
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think Windows will use forward slashes in paths - you could use that format for an OS-independent package.

smeech added a commit to Various-forks/v9-hub that referenced this pull request Jul 25, 2024
Apologies for the presumption, @viera97, but I wanted to see if I could fork a fork and submit updates.

I've implemented the various suggestions I made at espanso#86, for your interest, and perhaps onward submission to espanso/hub.
@smeech
Copy link
Collaborator

smeech commented Sep 5, 2024

I'm sorry it's been so long, @viera97, and I wouldn't be suprised if you've lost interest in this PR.
I'll close it for now, but it can be reopened if you wish.
All the best.

@smeech smeech closed this Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants