Address code review: fix imports, salt hashing, conditional delivery message
- Move asyncio import to module level in gmail_service.py - Move datetime import to module level in providers.py - Use hashlib.sha256 for per-user salt generation (no truncation risk) - Make delivery method message conditional in AddMailAccountModal Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/de3ef930-a980-4958-8a9d-a2c802918e81
This commit is contained in:
@@ -5,6 +5,7 @@ Uses the Gmail API's users.messages.insert() method to inject emails
|
||||
into a user's Gmail account, preserving original headers and metadata.
|
||||
This is preferred over SMTP forwarding as it doesn't modify the email.
|
||||
"""
|
||||
import asyncio
|
||||
import base64
|
||||
import logging
|
||||
from typing import Optional, Dict, Any
|
||||
@@ -94,8 +95,6 @@ class GmailService:
|
||||
Raises:
|
||||
GmailInjectionError: If injection fails
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
if label_ids is None:
|
||||
label_ids = ["INBOX"]
|
||||
|
||||
@@ -145,8 +144,6 @@ class GmailService:
|
||||
Returns:
|
||||
True if credentials are valid and can access Gmail
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
try:
|
||||
@@ -170,8 +167,6 @@ class GmailService:
|
||||
Returns:
|
||||
Email address string or None if unavailable
|
||||
"""
|
||||
import asyncio
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user