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 support for password extractor #444

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tari-dev
Copy link

This Pull Request adds support for extracting passwords in the Pass Git Helper, enabling workflows where the password is stored on the first line and the authentication information appears elsewhere.

Designed to address scenarios where credentials are distributed across different parts of a file, enhancing compatibility with diverse setups.

@Tari-dev Tari-dev changed the title Add Support for Password Extraction feat: add support for password extractor Jan 14, 2025
@languitar
Copy link
Owner

Thanks for the contribution. I can't think of many reasonable ways to have the password somewhere else than on the first line, which is the default idea of pass. However, if that exists, that would be fine.

However, in the current state, the PR needs some more work. Tests are failing and the commit convention is not obeyed. Would you mind fixing these issues (with my support)?

@languitar
Copy link
Owner

For reference: #433 (comment)

@Tari-dev
Copy link
Author

Thank you for reviewing my PR and providing feedback!

I understand that pass suggests storing credentials in a directory structure like this:

├── Business
│   ├── some-silly-business-site.com
│   └── another-business-site.net
├── Email
│   ├── donenfeld.com
│   └── zx2c4.com
└── France
    ├── bank
    ├── freebox
    └── mobilephone

Alternatively, browserpass extension often suggest organizing credentials like this:

~/.password-store/
    accounts.google.com.gpg
    amazon.com.gpg
    github.com/
        personal.gpg
        work.gpg

In my workflow, I prefer to store related credentials together in a single file per service, which is why I use a structure like:

~/.password-store/
     email1/
         github.com.gpg
         google.com.gpg
     email2/
         github.com.gpg
         google.com.gpg
     email3/
         github.com.gpg
         google.com.gpg

This allows me to keep everything related to each service under a single file. The feature I’ve added helps extract the password (or token) from a configurable location within the file, which should support this kind of organizational preference while still maintaining flexibility.

I’ll work on addressing the failing tests and I need your support.

Looking forward to collaborating as I refine the PR!

@languitar
Copy link
Owner

With your layout, why isn't the password on the first line of each gpg file?

@Tari-dev
Copy link
Author

password is, but the token isn't
I have both of them in the same file

@languitar
Copy link
Owner

I see.

For the commit linting to pass, you should rebase your changes as a single commit onto the current main branch and then use conventional commits as the commit convention for that single commit.

@mcepl
Copy link
Contributor

mcepl commented Jan 22, 2025

Wouldn’t it be nice to get some description of this functionality to README?

@languitar
Copy link
Owner

There's still something wrong with the tests. Do you need help fixing that? The commit history looks fine now.

@Tari-dev
Copy link
Author

There's still something wrong with the tests. Do you need help fixing that? The commit history looks fine now.

Yeah! I would appreciate your help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants