8000 feat: support variable time period for a token by yitsushi · Pull Request #137 · yitsushi/totp-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: support variable time period for a token #137

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

Merged
merged 1 commit into from
Feb 26, 2025
Merged

Conversation

yitsushi
Copy link
Owner

Resolves #136

References:
- #136

Signed-off-by: Victoria Nadasdi <victoria@efertone.me>
@yitsushi
Copy link
Owner Author
yitsushi commented Feb 26, 2025
fsh ❯ TOTP_CLI_CREDENTIAL_FILE=/tmp/test-totp-credentials go run . add --algorithm sha256
Namespace: ns
Account: acc
Token: JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP
Your Password (do not forget it): ***

fsh ❯ TOTP_CLI_CREDENTIAL_FILE=/tmp/test-totp-credentials go run . add --algorithm sha256 --time-period 60
Namespace: ns
Account: acc2
Token: JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP
Password: ***

fsh ❯ TOTP_CLI_CREDENTIAL_FILE=/tmp/test-totp-credentials go run . generate --show-remaining ns acc
Password: ***
687478 (remaining time: 23s)

fsh ❯ TOTP_CLI_CREDENTIAL_FILE=/tmp/test-totp-credentials go run . generate --show-remaining ns acc2
Password: ***
634696 (remaining time: 49s)

fsh ❯ set -x TOTP_TOKEN JBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP

fsh ❯ go run . instant --algorithm sha256 --length 6 --show-remaining
037303 (remaining time: 28s)

fsh ❯ go run . instant --algorithm sha256 --length 6 --show-remaining --time-period 60
079210 (remaining time: 56s)

fsh ❯ go run . instant --algorithm sha256 --length 6 --show-remaining --time-period 600
284339 (remaining time: 517s)

@yitsushi yitsushi merged commit f3307cf into main Feb 26, 2025
9 checks passed
@yitsushi yitsushi deleted the 136-add-time-period branch February 26, 2025 21:43
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.

Add support to custom period
1 participant
0