Localize notification_utils to the API

This changeset pulls in all of the notification_utils code directly into the API and removes it as an external dependency.  We are doing this to cut down on operational maintenance of the project and will begin removing parts of it no longer needed for the API.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
Carlo Costino
2024-05-16 10:17:45 -04:00
parent 4cdf8b2cb2
commit 99edc88197
129 changed files with 49913 additions and 263 deletions

View File

@@ -1,14 +1,4 @@
from flask import current_app
from notifications_utils import SMS_CHAR_COUNT_LIMIT
from notifications_utils.clients.redis import (
rate_limit_cache_key,
total_limit_cache_key,
)
from notifications_utils.recipients import (
get_international_phone_info,
validate_and_format_email_address,
validate_and_format_phone_number,
)
from sqlalchemy.orm.exc import NoResultFound
from app import redis_store
@@ -22,6 +12,16 @@ from app.serialised_models import SerialisedTemplate
from app.service.utils import service_allowed_to_send_to
from app.utils import get_public_notify_type_text
from app.v2.errors import BadRequestError, RateLimitError, TotalRequestsError
from notifications_utils import SMS_CHAR_COUNT_LIMIT
from notifications_utils.clients.redis import (
rate_limit_cache_key,
total_limit_cache_key,
)
from notifications_utils.recipients import (
get_international_phone_info,
validate_and_format_email_address,
validate_and_format_phone_number,
)
def check_service_over_api_rate_limit(service, api_key):