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

Adding support for otp codes automatically #24

Merged
merged 2 commits into from
May 19, 2020

Conversation

seanmarpo
Copy link
Contributor

What's Changed?

  • Added a new field in GithubCredentials to support the OTP code
  • Added a new config line for your Github TOTP seed - Can generate codes from here
  • Added a new CLI argument --otp-code to supply your 2FA code on program run
  • Pulled in a new dependency /~https://github.com/pquerna/otp to handle TOTP generation
  • Updated docs to reflect changes to config.yml and the new CLI argument

Testing

I recommend creating a throwaway Github account in order to test this easier (otherwise you will need to redo your 2FA setup on your account to grab the TOTP Seed value). An image of where to click during the 2FA setup process is included below that lets you grab the raw TOTP seed value.
chrome_3xBunOTTbO

Update your config.yml with the new github_totp_seed field.
Run: echo "test.com" | ./git-hound

Comment out the new field in config.yml
Run: echo "test.com" | ./git-hound --otp-code <code>

Comment out the new field in config.yml
Run: echo "test.com | ./git-hound -- Ensure you are prompted for 2FA Code

Why?

I was getting annoyed while using this and having to manually enter my 2FA code every time. This allows the user to have some flexibility with automatically generating a TOTP code or letting them supply it in the CLI. Worst case, they are just prompted for it.

Feel free to adjust things as needed.

@tillson tillson merged commit 1d492bc into tillson:master May 19, 2020
@tillson
Copy link
Owner

tillson commented May 19, 2020

This is a great idea. Thank you for your contribution!

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.

2 participants