22 lines
600 B
Python
22 lines
600 B
Python
|
|
import logging
|
||
|
|
import secrets
|
||
|
|
|
||
|
|
logger = logging.getLogger(__name__)
|
||
|
|
|
||
|
|
|
||
|
|
class ClickUpPairing:
|
||
|
|
id_label = "clickupUserId"
|
||
|
|
|
||
|
|
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()
|
||
|
|
|
||
|
|
async def notify_approval(self, config: dict, peer_id: str, account_id: str | None = None) -> None:
|
||
|
|
logger.info("clickup pairing approved for peer %s", peer_id)
|