Merge pull request #33 from LucidOne/otp-support

Host app support for OTP
This commit is contained in:
Thomas Vogt 2019-02-05 13:21:08 +01:00 committed by GitHub
commit 4e74463180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -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`.

View File

@ -62,6 +62,11 @@ if __name__ == "__main__":
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]