feat(security): add approved rooms/users/domains as env variables (#277)

* feat(security): add approved rooms/users/domains as env variables
* chore(lint): fix R0902
* chore(lint): fix C0114
* chore(lint): fix C0116
* chore(lint): fix C0413
This commit is contained in:
2024-08-30 19:38:56 +01:00
committed by GitHub
parent 56f1cb924e
commit b758d0dfda
8 changed files with 109 additions and 28 deletions

16
app/utils/helpers.py Normal file
View File

@ -0,0 +1,16 @@
"""Standalone helper functions."""
import re
def validate_email_syntax(email: str) -> bool:
"""Validate email syntax.
Args:
email (str): Email address.
Returns:
bool: True if valid, else False.
"""
pattern = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
return re.match(pattern, email) is not None