"""Sentry for the API and the worker, off until a DSN arrives (note Sentry). `init(component)` reads `SENTRY_DSN_API` and returns without importing the SDK when it is empty, so local and CI runs carry no Sentry dependency or network cost. When it is set, `scrub` keeps cookies, credentials, request bodies and Brazilian personal data out of the events (LGPD). """ import os import re from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit EMAIL = re.compile(r'[^\s@]+@[^\s@]+\.[A-Za-z]{2,}') # CPF (11 digits) or CNPJ (14), with or without punctuation. DOCUMENT = re.compile(r'(?