Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TOTP time remaining calc and printout #95

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

warricksothr
Copy link

In reference to feature request #94. I've added a TOTP time remaining calculation and the accompanying printout to TOTP code requests.

This adds a reliance on the system date program to print out the current unix time.

@tadfisher
Copy link
Owner

So, I'm a little bit worried that echoing the time remaining universally would break existing tools/scripts that read the code.

Would you mind if I built upon this to echo in interactive terminals only?

@warricksothr
Copy link
Author

Would you mind if I built upon this to echo in interactive terminals only?

That absolutely seems reasonable.

@brunelli
Copy link

Would you mind if I built upon this to echo in interactive terminals only?

Maybe it should be added behind a flag, so it doesn't break existing tools/scripts but also won't keep them from implementing this as a feature.

I'd suggest pass otp [--time,-t] to print the remaing time. Also, adding : will make it easier to parse the output.

$ pass otp --time totp-secret
698816
Expires in: 26 seconds

@davidfetter
Copy link

Would it make sense to send it to stderr instead of stdout?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants