Skip to content

Add MFA by email: optional IMAP code retrieval, preserve console prompt#175

Open
joyjit wants to merge 1 commit intotronikos:mainfrom
joyjit:imap-mfa
Open

Add MFA by email: optional IMAP code retrieval, preserve console prompt#175
joyjit wants to merge 1 commit intotronikos:mainfrom
joyjit:imap-mfa

Conversation

@joyjit
Copy link

@joyjit joyjit commented Feb 24, 2026

  • Add opower.email_mfa module: ImapMfaCodeSource (poll inbox for 6-digit code), ConsoleMfaCodeSource, RestApiMfaCodeSource, MfaCodeSource protocol.
  • CLI: --mfa_imap_host, --mfa_imap_user, --mfa_imap_password, --mfa_imap_port. When set, auto-select Email option and read code from IMAP; otherwise prompt for MFA option and code (original behavior).
  • No new dependencies (stdlib imaplib + existing aiohttp).
  • Works with PG&E and Exelon (any utility offering Email MFA option).

@joyjit joyjit marked this pull request as draft February 24, 2026 23:25
@joyjit joyjit marked this pull request as ready for review February 24, 2026 23:42
@tronikos
Copy link
Owner

tronikos commented Mar 1, 2026

Can you fix pre-commit?

- opower.email_mfa: ImapMfaCodeSource, ConsoleMfaCodeSource, MfaCodeSource protocol
- CLI: --mfa_imap_host, --mfa_imap_user, --mfa_imap_password, --mfa_imap_port
- When set, auto-select Email and read code from inbox; else prompt (original behavior)
- Refactor: _handle_mfa_challenge() to satisfy C901; fix E501, B904, ruff in email_mfa

Co-authored-by: Cursor <cursoragent@cursor.com>
Made-with: Cursor
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