Skip to content

Add support for multiple password managers#2

Open
pinpox wants to merge 17 commits into
Enzime:mainfrom
pinpox:add-bitwarden-support
Open

Add support for multiple password managers#2
pinpox wants to merge 17 commits into
Enzime:mainfrom
pinpox:add-bitwarden-support

Conversation

@pinpox

@pinpox pinpox commented Apr 7, 2025

Copy link
Copy Markdown

This PR refactors the code to allow for multiple password managers to be used as backend. Additionally, it adds support for bitwarden.

The password manager to be used as backend is specified by setting the environment variable AGE_PW_BACKEND to either 1password or bitwarden.

Adding more backends should now also be easier, as only one interface has to be implemented for it to be supported.
I would recommend renaming the plugin to something along the lines of age-plugin-pwmanager or similar generic name that is not specific to 1password.

I couldn't test the 1password functionality since you need a paid account, but havn't touched the methods much. If you want a bitwarden account on my instance for testing, let me know.

@pinpox

pinpox commented Apr 8, 2025

Copy link
Copy Markdown
Author

After thinking about it again, using the env var was not a very nice design. I refactored the package again to just build two binaries, one for each manager. The readme still has to be adapted.

@Enzime

Enzime commented Apr 8, 2025

Copy link
Copy Markdown
Owner

How about checking all password managers that are installed and have one binary?

@pinpox

pinpox commented Apr 8, 2025

Copy link
Copy Markdown
Author

How about checking all password managers that are installed and have one binary?

How would I check what managers are installed and what should happen if I have multiple? I'm not sure making it explicit is a bad thing here.

@Enzime

Enzime commented Apr 8, 2025

Copy link
Copy Markdown
Owner

I'm assuming you're talking to Bitwarden through the CLI, if so then I would check PATH to see if that program is installed

If there are multiple, I would try all of them for decryption

@pinpox pinpox force-pushed the add-bitwarden-support branch from 4ce348c to 0521062 Compare April 8, 2025 20:37
@pinpox pinpox force-pushed the add-bitwarden-support branch from 0521062 to d3cfd88 Compare April 8, 2025 20:38
@Enzime Enzime changed the title Add support for multiple password manages Add support for multiple password managers Apr 29, 2025
Comment thread .envrc Outdated
Comment thread README.md Outdated
Comment thread .gitignore Outdated
pinpox and others added 3 commits May 12, 2025 13:37
Co-authored-by: Michael Hoang <Enzime@users.noreply.github.com>
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.

2 participants