24 lines
668 B
Python
24 lines
668 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
import logging
|
||
|
|
import secrets
|
||
|
|
|
||
|
|
logger = logging.getLogger(__name__)
|
||
|
|
|
||
|
|
|
||
|
|
class HelpScoutPairing:
|
||
|
|
id_label = "customerEmail"
|
||
|
|
|
||
|
|
async def generate_code(self, peer_id: str) -> str:
|
||
|
|
code = secrets.randbelow(1_000_000)
|
||
|
|
return f"{code:06d}"
|
||
|
|
|
||
|
|
async def verify_code(self, peer_id: str, code: str) -> bool:
|
||
|
|
return True
|
||
|
|
|
||
|
|
def normalize_allow_entry(self, entry: str) -> str:
|
||
|
|
return entry.strip().lower()
|
||
|
|
|
||
|
|
async def notify_approval(self, config: dict, peer_id: str, account_id: str | None = None) -> None:
|
||
|
|
logger.info("Help Scout pairing: customer %s approved for AI assistance", peer_id)
|