mirror of
https://github.com/simple-login/app.git
synced 2025-02-25 00:03:03 +08:00
Move some comments as docstrings
This commit is contained in:
parent
112b2c77c3
commit
0f14c3e74e
1 changed files with 6 additions and 2 deletions
|
@ -1476,6 +1476,9 @@ def save_envelope_for_debugging(envelope: Envelope, file_name_prefix=None) -> st
|
|||
def generate_verp_email(
|
||||
verp_type: VerpType, object_id: int, sender_domain: Optional[str] = None
|
||||
) -> str:
|
||||
"""Generates an email address with the verp type, object_id and domain encoded in the address
|
||||
and signed with hmac to prevent tampering
|
||||
"""
|
||||
# Encoded as a list to minimize size of email address
|
||||
# Time is in minutes granularity and start counting on 2022-01-01 to reduce bytes to represent time
|
||||
data = [
|
||||
|
@ -1523,9 +1526,10 @@ def deprecated_get_verp_info_from_email(email: str) -> Optional[Tuple[VerpType,
|
|||
return VerpType(data[0]), data[1]
|
||||
|
||||
|
||||
# This method processes the email address, checks if it's a signed verp email generated by us to receive bounces
|
||||
# and extracts the type of verp email and associated email log id/transactional email id stored as object_id
|
||||
def new_get_verp_info_from_email(email: str) -> Optional[Tuple[VerpType, int]]:
|
||||
"""This method processes the email address, checks if it's a signed verp email generated by us to receive bounces
|
||||
and extracts the type of verp email and associated email log id/transactional email id stored as object_id
|
||||
"""
|
||||
idx = email.find("@")
|
||||
if idx == -1:
|
||||
return None
|
||||
|
|
Loading…
Reference in a new issue