Skip to content

Commit

Permalink
Host app support for [pass-otp](https://github.com/tadfisher/pass-otp)
Browse files Browse the repository at this point in the history
  • Loading branch information
LucidOne committed Feb 5, 2019
1 parent 6822932 commit b8ea131
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -146,6 +146,12 @@ In the preferences of PassFF, you can enable the status bar and debug logs in th
* The typical output for an empty store is:
* `{"stderr": "", "version": "1.0.1", "exitCode": 0, "stdout": "Password Store\n"}`

#### Testing OTP support
```console
$ echo -e "\x19\x00\x00\x00[\"otp\",\"/www/github.com\"]" | /path/to/passff.py | tail -c +4; echo
{"exitCode": 0, "stderr": "", "stdout": "123456\n", "version": "1.0.1"}
```

### Preferences
If you use a customized `pass` installation: environment variables, customized repository path or extensions, you may have to customize the *preferences section* in `passff.py`.

Expand Down
5 changes: 5 additions & 0 deletions src/passff.py
Expand Up @@ -62,6 +62,11 @@ def sendMessage(encodedMessage):
pos_args = [receivedMessage[1], receivedMessage[2]]
if "-n" in receivedMessage[3:]:
opt_args.append("-n")
elif receivedMessage[0] == "otp" and len(receivedMessage) == 2:
opt_args = ["otp"]
key = receivedMessage[1]
key = "/" + (key[1:] if key[0] == "/" else key)
pos_args = [key]
else:
opt_args = ["show"]
key = receivedMessage[0]
Expand Down

0 comments on commit b8ea131

Please sign in to comment.