marcopaganini / termotp

A TOTP code generator for your terminal
Apache License 2.0
18 stars 0 forks source link

Touch ID support for macOS #4

Open timkgh opened 2 months ago

timkgh commented 2 months ago

So we don't have to type long Aegis passwords.

sam-artuso commented 2 months ago

That'd be amazing!!! 🎉

timkgh commented 2 months ago

@marcopaganini if termotp could read the password from stdin, we could use https://github.com/remko/age-plugin-se to store an encrypted Aegis password in a file that can then be decrypted using Touch ID, e.g. age --decrypt -i key.txt aegis-password.age | termotp --input aegis.json --plain | grep -i ...

Of course, native Touch ID support would be even better.

marcopaganini commented 2 months ago

It's yer lucky day :) Version 0.0.8 now supports reading passwords from stdin. Please test it thoroughly. What I did is simple: If the input is a terminal, use the regular terminal password hiding shenanigans. If not, just read the passwords from the terminal (max 256 bytes) and trim all binary zeroes and CR/LF at the end.

It would be interesting to support Touch ID, but I have no access to a Mac to test it. Also, if your workaround above works fine, I can add it to the documentation and that would make it a generic solution.

Please let me know how it goes.

timkgh commented 2 months ago

@marcopaganini It works very well, thank you!

To fully automate it, could we have full plain text output without headers (issue #5) so I can just pipe it to grep, or for --fzf / --fuzzy to just show the matches and exit when they are passed an arg?