chore: add comments on generate_webhook_id

This commit is contained in:
Yeuoly 2025-09-10 17:23:29 +08:00
parent 9898730cc5
commit d22404994a

View File

@ -687,6 +687,10 @@ class WebhookService:
@classmethod
def generate_webhook_id(cls) -> str:
"""Generate unique 24-character webhook ID"""
"""
Generate unique 24-character webhook ID
Deduplication is not needed, DB already has unique constraint on webhook_id.
"""
# Generate 24-character random string
return secrets.token_urlsafe(18)[:24] # token_urlsafe gives base64url, take first 24 chars