1Password / shell-plugins

Seamless authentication for every tool in your terminal.
https://developer.1password.com/docs/cli/shell-plugins/
MIT License
507 stars 163 forks source link

Create wireguard wg-quick plugin #418

Open drzombey opened 6 months ago

drzombey commented 6 months ago

Overview

I've created a plugin for wg-quick to use the configurations out of 1password instead of the standard config path.

Type of change

- [x] Created a new plugin - [ ] Improved an existing plugin - [ ] Fixed a bug in an existing plugin - [ ] Improved contributor utilities or experience ## How To Test Example command: Without plugin: `wg quick up wg0` With plugin: `wg-quick up` No Interface name is needed cause the plugin will handle it with the credential ## Changelog Enable secure authentication for wg-quick using 1Password Shell Plugins, ensuring proper initialization with default credentials via op plugin init and support for importing credentials from the specified standard wireguard config file e.g. "/etc/wireguard/wg0.conf"
drzombey commented 5 months ago

Thank you for your contribution! ❤️ The code looks great - my main concern is about the UX, based on the test commands outlined in the PR description.

With shell plugins, we aim to make the transition between the manual credential provisioning process to 1Password seamless - the user shouldn't have to change the command they run for that. However, the before/after commands look slightly different - can you elaborate a bit on that, so we can reason on the best way to move forward here?

Hey, yes of course I can. You're right the commands are different. Currently the main issue is that the wg0 interface is a hint for the wg-quick cli which config it should use in the /etc/wireguard folder. But you can also add as an argument the config file like the plugin will do it, for this you must replace the interface name with the config path. If we can find a way to replace the interface name during the command execution by the config file path the experience should be the same as before. Or if there is a way to get the correct secret in 1password by the interface name.