-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add support for 2FA codes through environment variables #41
Add support for 2FA codes through environment variables #41
Conversation
Thanks for your contribution. This looks good, but I'd like to suggest that we put the resolving of 2FA details in its own function to keep the function size low and for ease of extending the 2FA details resolution. Something like this:
Would that work for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see comments in the PR.
@jonhenrik13 I'd already considered refactoring that method due to the complexity, but had a hard time seeing how it should be split out while remaining consistent. In the end, I've refactored it a bit more. Going by my own tests, it seems to be equivalent to the old behaviour. Please let me know what you think! |
This PR adds support for a 3rd authentication environment variable,
QBEE_2FA_CODE
. If provided, it will be used as a Google authentication code for the 2FA process, rather than requiring interactive user input.This helps use the qbee-cli in scripts (in my case, shorthands to connect to a device by its hostname instead of node_id) without having to make your account less secure by removing 2FA.