qute-1password/README.md

80 lines
3.4 KiB
Markdown
Raw Permalink Normal View History

2019-10-11 20:58:20 +00:00
# Qute-1Password
2019-10-11 09:44:05 +00:00
2023-08-19 19:15:16 +00:00
# ⚠️ ARCHIVED. Please use the built-in [qute-1pass](https://github.com/qutebrowser/qutebrowser/blob/main/misc/userscripts/qute-1pass) userscript.
2019-10-11 20:58:20 +00:00
Qutebrowser userscript to fill 1password credentials
![Oh, stop it! you...](.readme/stopityou.png)
## Dependencies
2022-10-28 08:17:30 +00:00
2019-10-11 20:58:20 +00:00
- [The 1Password CLI](https://support.1password.com/command-line-getting-started/)
Ensure you have it installed and set up. Follow the official documentation.
2022-10-28 08:17:30 +00:00
> **Note**: Only the 1Password CLI v2 is supported from now own. If you're using v1 please use the [v1.0.0 release](https://github.com/fmartingr/qute-1password/releases/tag/v1.0.0).
2019-10-11 20:58:20 +00:00
- [rofi](https://github.com/davatorium/rofi) to ask for password and list items
2021-02-10 16:02:24 +00:00
## How it works
First we will ask for the master password using Rofi to get all login items.
Then it'll get the hostname from the current URL and filter results from all the login items stored in the 1password account logged in.
A new Rofi prompt will show up to select one item from the filtered list (items that only match for the current site based on the hostname)
Once an item is selected, we will retrieve it and submit it in the browser by injecting they characters as if the keyboard were writting them, using a `<tab>` to switch fields and a `<cr>` to submit the form. This is done using the [`fake-key`](https://qutebrowser.org/doc/help/commands.html#fake-key) qutebrowser command.
2019-10-11 20:58:20 +00:00
## Usage
Right now it defaults to the `my` account, will be configurable in the future.
2021-02-10 16:02:24 +00:00
Commands:
- `fill_credentials`: Will send the username and password (using a `<tab>` keystroke in between)
- `fill_username`: Will send the username
- `fill_password`: Will send the password
- `fill_totp`: Will send the TOTP
Flags:
- `--auto-submit` Will send a carriage return once the last character is sent, hopefully submitting the form.
- `--cache-session` Caches the session for 30 minutes to prevent asking for the password again in that interval.
- `--allow-insecure-sites` Allow filling in insecure (non-https) sites
- `--biometric` Use biometric or PAM authentication instead of asking for the master password
Using the biometric flag requires installing the 1Password Desktop app and enabling "Biometric unlock" in it's Developer options.
2021-02-10 16:02:24 +00:00
2019-10-11 20:58:20 +00:00
```
2021-02-10 16:02:24 +00:00
$ python qute_1pass.py --help
usage: qute_1pass.py [-h] [--auto-submit] [--cache-session] [--allow-insecure-sites] [--cache] [--biometric] command
2019-10-11 20:58:20 +00:00
positional arguments:
2021-02-10 16:02:24 +00:00
command fill_credentials, fill_totp, fill_username, fill_password
2019-10-11 20:58:20 +00:00
options:
2021-02-10 16:02:24 +00:00
-h, --help show this help message and exit
--auto-submit Auto submit after filling
--cache-session Cache 1password session for 30 minutes
--allow-insecure-sites
Allow filling credentials on insecure sites
--cache store and use cached information
--biometric Use biometric unlock - don't ask for password
2019-10-11 20:58:20 +00:00
```
Call your script from qutebrowser using
```
:spawn --userscript path/to/qute_1pass.py fill_credentials
```
## Contributing
2021-02-10 16:02:24 +00:00
In this project we use [Poetry](https://python-poetry.org/) to manage the python dependencies and virtual environments. Make sure you have it installed before continuing.
2019-10-11 20:58:20 +00:00
Use this command to create the virtualenv, install dev-dependencies and
install the pre-commit hook.
``` bash
make setup
```
2021-02-10 16:02:24 +00:00
After you make your desired changes, open a merge request or send me a patch via email and I will review it as soon as I can.