From ad84fc536bc66c6652e1f3fc0087a17f295784c4 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 19 Jun 2024 13:00:54 -0700 Subject: [PATCH 01/56] remove dead code --- Makefile | 2 +- app/errors.py | 7 +- .../notifications_ses_callback.py | 4 +- app/notifications/sns_handlers.py | 5 +- app/user/rest.py | 122 ++++---- app/utils.py | 22 +- poetry.lock | 8 +- tests/app/test_errors.py | 6 - tests/app/test_utils.py | 58 ++-- tests/app/user/test_rest.py | 290 +++++++++--------- 10 files changed, 254 insertions(+), 270 deletions(-) delete mode 100644 tests/app/test_errors.py diff --git a/Makefile b/Makefile index 9cb8bdac9..175f630c4 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ run-celery: ## Run celery, TODO remove purge for staging/prod .PHONY: dead-code -dead-code: +dead-code: ## Use 60 to look for suspected dead code poetry run vulture ./app --min-confidence=100 .PHONY: run-celery-beat diff --git a/app/errors.py b/app/errors.py index 6ed311dba..5c208d407 100644 --- a/app/errors.py +++ b/app/errors.py @@ -9,10 +9,9 @@ from app.exceptions import ArchiveValidationError from notifications_utils.recipients import InvalidEmailError - -class VirusScanError(Exception): - def __init__(self, message): - super().__init__(message) +# class VirusScanError(Exception): +# def __init__(self, message): +# super().__init__(message) class InvalidRequest(Exception): diff --git a/app/notifications/notifications_ses_callback.py b/app/notifications/notifications_ses_callback.py index 0b41c64db..6550b073c 100644 --- a/app/notifications/notifications_ses_callback.py +++ b/app/notifications/notifications_ses_callback.py @@ -1,4 +1,4 @@ -from datetime import timedelta +# from datetime import timedelta from flask import Blueprint, jsonify, request @@ -8,7 +8,7 @@ from app.notifications.sns_handlers import sns_notification_handler ses_callback_blueprint = Blueprint("notifications_ses_callback", __name__) -DEFAULT_MAX_AGE = timedelta(days=10000) +# DEFAULT_MAX_AGE = timedelta(days=10000) # 400 counts as a permanent failure so SNS will not retry. diff --git a/app/notifications/sns_handlers.py b/app/notifications/sns_handlers.py index 96ae4e6bf..4407bee06 100644 --- a/app/notifications/sns_handlers.py +++ b/app/notifications/sns_handlers.py @@ -1,5 +1,6 @@ import enum -from datetime import timedelta + +# from datetime import timedelta from json import decoder import requests @@ -8,7 +9,7 @@ from app.errors import InvalidRequest from app.notifications.sns_cert_validator import validate_sns_cert -DEFAULT_MAX_AGE = timedelta(days=10000) +# DEFAULT_MAX_AGE = timedelta(days=10000) class SNSMessageType(enum.Enum): diff --git a/app/user/rest.py b/app/user/rest.py index 760334841..ad3c57fb8 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -13,7 +13,7 @@ from app.dao.services_dao import dao_fetch_service_by_id from app.dao.template_folder_dao import dao_get_template_folder_by_id_and_service_id from app.dao.templates_dao import dao_get_template_by_id -from app.dao.users_dao import ( +from app.dao.users_dao import ( # get_user_and_accounts,; update_user_password, count_user_verify_codes, create_secret_code, create_user_code, @@ -29,7 +29,6 @@ reset_failed_login_count, save_model_user, save_user_attribute, - update_user_password, use_user_code, ) from app.enums import CodeType, KeyType, NotificationType, TemplateType @@ -40,11 +39,10 @@ send_notification_to_queue, ) from app.schema_validation import validate -from app.schemas import ( +from app.schemas import ( # user_update_password_schema_load_json, create_user_schema, email_data_request_schema, partial_email_data_request_schema, - user_update_password_schema_load_json, user_update_schema_load_json, ) from app.user.users_schema import ( @@ -616,55 +614,55 @@ def get_all_users(): return jsonify(data=result), 200 -@user_blueprint.route("/reset-password", methods=["POST"]) -def send_user_reset_password(): - request_json = request.get_json() - email = email_data_request_schema.load(request_json) - - user_to_send_to = get_user_by_email(email["email"]) - template = dao_get_template_by_id(current_app.config["PASSWORD_RESET_TEMPLATE_ID"]) - service = Service.query.get(current_app.config["NOTIFY_SERVICE_ID"]) - personalisation = { - "user_name": user_to_send_to.name, - "url": _create_reset_password_url( - user_to_send_to.email_address, - base_url=request_json.get("admin_base_url"), - next_redirect=request_json.get("next"), - ), - } - saved_notification = persist_notification( - template_id=template.id, - template_version=template.version, - recipient=email["email"], - service=service, - personalisation=None, - notification_type=template.template_type, - api_key_id=None, - key_type=KeyType.NORMAL, - reply_to_text=service.get_default_reply_to_email_address(), - ) - saved_notification.personalisation = personalisation - - redis_store.set( - f"email-personalisation-{saved_notification.id}", - json.dumps(personalisation), - ex=60 * 60, - ) - send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) - - return jsonify({}), 204 - - -@user_blueprint.route("//update-password", methods=["POST"]) -def update_password(user_id): - user = get_user_by_id(user_id=user_id) - req_json = request.get_json() - password = req_json.get("_password") - - user_update_password_schema_load_json.load(req_json) - - update_user_password(user, password) - return jsonify(data=user.serialize()), 200 +# @user_blueprint.route("/reset-password", methods=["POST"]) +# def send_user_reset_password(): +# request_json = request.get_json() +# email = email_data_request_schema.load(request_json) + +# user_to_send_to = get_user_by_email(email["email"]) +# template = dao_get_template_by_id(current_app.config["PASSWORD_RESET_TEMPLATE_ID"]) +# service = Service.query.get(current_app.config["NOTIFY_SERVICE_ID"]) +# personalisation = { +# "user_name": user_to_send_to.name, +# "url": _create_reset_password_url( +# user_to_send_to.email_address, +# base_url=request_json.get("admin_base_url"), +# next_redirect=request_json.get("next"), +# ), +# } +# saved_notification = persist_notification( +# template_id=template.id, +# template_version=template.version, +# recipient=email["email"], +# service=service, +# personalisation=None, +# notification_type=template.template_type, +# api_key_id=None, +# key_type=KeyType.NORMAL, +# reply_to_text=service.get_default_reply_to_email_address(), +# ) +# saved_notification.personalisation = personalisation + +# redis_store.set( +# f"email-personalisation-{saved_notification.id}", +# json.dumps(personalisation), +# ex=60 * 60, +# ) +# send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) + +# return jsonify({}), 204 + + +# @user_blueprint.route("//update-password", methods=["POST"]) +# def update_password(user_id): +# user = get_user_by_id(user_id=user_id) +# req_json = request.get_json() +# password = req_json.get("_password") + +# user_update_password_schema_load_json.load(req_json) + +# update_user_password(user, password) +# return jsonify(data=user.serialize()), 200 @user_blueprint.route("//organizations-and-services", methods=["GET"]) @@ -674,15 +672,15 @@ def get_organizations_and_services_for_user(user_id): return jsonify(data) -def _create_reset_password_url(email, next_redirect, base_url=None): - data = json.dumps({"email": email, "created_at": str(utc_now())}) - static_url_part = "/new-password/" - full_url = url_with_token( - data, static_url_part, current_app.config, base_url=base_url - ) - if next_redirect: - full_url += "?{}".format(urlencode({"next": next_redirect})) - return full_url +# def _create_reset_password_url(email, next_redirect, base_url=None): +# data = json.dumps({"email": email, "created_at": str(utc_now())}) +# static_url_part = "/new-password/" +# full_url = url_with_token( +# data, static_url_part, current_app.config, base_url=base_url +# ) +# if next_redirect: +# full_url += "?{}".format(urlencode({"next": next_redirect})) +# return full_url def _create_verification_url(user, base_url): diff --git a/app/utils.py b/app/utils.py index b23a000d1..13028c0ab 100644 --- a/app/utils.py +++ b/app/utils.py @@ -61,9 +61,9 @@ def get_midnight_in_utc(date): return datetime.combine(date, datetime.min.time()) -def get_midnight_for_day_before(date): - day_before = date - timedelta(1) - return get_midnight_in_utc(day_before) +# def get_midnight_for_day_before(date): +# day_before = date - timedelta(1) +# return get_midnight_in_utc(day_before) def get_month_from_utc_column(column): @@ -113,18 +113,18 @@ def get_dt_string_or_none(val): return val.strftime(DATETIME_FORMAT) if val else None -def get_uuid_string_or_none(val): - return str(val) if val else None +# def get_uuid_string_or_none(val): +# return str(val) if val else None -def format_sequential_number(sequential_number): - return format(sequential_number, "x").zfill(8) +# def format_sequential_number(sequential_number): +# return format(sequential_number, "x").zfill(8) -def get_reference_from_personalisation(personalisation): - if personalisation: - return personalisation.get("reference") - return None +# def get_reference_from_personalisation(personalisation): +# if personalisation: +# return personalisation.get("reference") +# return None # Function used for debugging. diff --git a/poetry.lock b/poetry.lock index 5d95cdd54..fd83e39ce 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] name = "aiohttp" @@ -2098,13 +2098,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2493,6 +2489,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3475,7 +3472,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, diff --git a/tests/app/test_errors.py b/tests/app/test_errors.py deleted file mode 100644 index 2cdbc0b33..000000000 --- a/tests/app/test_errors.py +++ /dev/null @@ -1,6 +0,0 @@ -from app.errors import VirusScanError - - -def test_virus_scan_error(): - vse = VirusScanError("a message") - assert "a message" in vse.args diff --git a/tests/app/test_utils.py b/tests/app/test_utils.py index 20675aec5..db688bca7 100644 --- a/tests/app/test_utils.py +++ b/tests/app/test_utils.py @@ -1,4 +1,4 @@ -import uuid +# import uuid from datetime import date, datetime import pytest @@ -6,12 +6,8 @@ from app.enums import ServicePermissionType from app.utils import ( - format_sequential_number, - get_midnight_for_day_before, get_midnight_in_utc, get_public_notify_type_text, - get_reference_from_personalisation, - get_uuid_string_or_none, midnight_n_days_ago, scrub, ) @@ -32,16 +28,16 @@ def test_get_midnight_in_utc_returns_expected_date(date, expected_date): assert get_midnight_in_utc(date) == expected_date -@pytest.mark.parametrize( - "date, expected_date", - [ - (datetime(2016, 1, 15, 0, 30), datetime(2016, 1, 14, 0, 0)), - (datetime(2016, 7, 15, 0, 0), datetime(2016, 7, 14, 0, 0)), - (datetime(2016, 8, 23, 11, 59), datetime(2016, 8, 22, 0, 0)), - ], -) -def test_get_midnight_for_day_before_returns_expected_date(date, expected_date): - assert get_midnight_for_day_before(date) == expected_date +# @pytest.mark.parametrize( +# "date, expected_date", +# [ +# (datetime(2016, 1, 15, 0, 30), datetime(2016, 1, 14, 0, 0)), +# (datetime(2016, 7, 15, 0, 0), datetime(2016, 7, 14, 0, 0)), +# (datetime(2016, 8, 23, 11, 59), datetime(2016, 8, 22, 0, 0)), +# ], +# ) +# def test_get_midnight_for_day_before_returns_expected_date(date, expected_date): +# assert get_midnight_for_day_before(date) == expected_date @pytest.mark.parametrize( @@ -66,27 +62,27 @@ def test_midnight_n_days_ago(current_time, arg, expected_datetime): assert midnight_n_days_ago(arg) == expected_datetime -def test_format_sequential_number(): - assert format_sequential_number(123) == "0000007b" +# def test_format_sequential_number(): +# assert format_sequential_number(123) == "0000007b" -@pytest.mark.parametrize( - "personalisation, expected_response", - [ - ({"nothing": "interesting"}, None), - ({"reference": "something"}, "something"), - (None, None), - ], -) -def test_get_reference_from_personalisation(personalisation, expected_response): - assert get_reference_from_personalisation(personalisation) == expected_response +# @pytest.mark.parametrize( +# "personalisation, expected_response", +# [ +# ({"nothing": "interesting"}, None), +# ({"reference": "something"}, "something"), +# (None, None), +# ], +# ) +# def test_get_reference_from_personalisation(personalisation, expected_response): +# assert get_reference_from_personalisation(personalisation) == expected_response -def test_get_uuid_string_or_none(): - my_uuid = uuid.uuid4() - assert str(my_uuid) == get_uuid_string_or_none(my_uuid) +# def test_get_uuid_string_or_none(): +# my_uuid = uuid.uuid4() +# assert str(my_uuid) == get_uuid_string_or_none(my_uuid) - assert get_uuid_string_or_none(None) is None +# assert get_uuid_string_or_none(None) is None def test_get_public_notify_type_text(): diff --git a/tests/app/user/test_rest.py b/tests/app/user/test_rest.py index a388d264e..bddc11a3a 100644 --- a/tests/app/user/test_rest.py +++ b/tests/app/user/test_rest.py @@ -632,135 +632,135 @@ def test_remove_user_folder_permissions(admin_request, sample_user, sample_servi assert service_user.folders == [] -@freeze_time("2016-01-01 11:09:00.061258") -def test_send_user_reset_password_should_send_reset_password_link( - admin_request, sample_user, mocker, password_reset_email_template -): - mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") - data = {"email": sample_user.email_address} - notify_service = password_reset_email_template.service - - admin_request.post( - "user.send_user_reset_password", - _data=data, - _expected_status=204, - ) - - notification = Notification.query.first() - mocked.assert_called_once_with( - [str(notification.id)], queue="notify-internal-tasks" - ) - assert ( - notification.reply_to_text - == notify_service.get_default_reply_to_email_address() - ) - - -@pytest.mark.parametrize( - "data, expected_url", - ( - ( - { - "email": "notify@digital.fake.gov", - }, - ("http://localhost:6012/new-password/"), - ), - ( - { - "email": "notify@digital.fake.gov", - "admin_base_url": "https://different.example.com", - }, - ("https://different.example.com/new-password/"), - ), - ), -) -@freeze_time("2016-01-01 11:09:00.061258") -def test_send_user_reset_password_should_use_provided_base_url( - admin_request, - sample_user, - password_reset_email_template, - mocker, - data, - expected_url, -): - mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") - - admin_request.post( - "user.send_user_reset_password", - _data=data, - _expected_status=204, - ) - - assert Notification.query.first().personalisation["url"].startswith(expected_url) - - -@freeze_time("2016-01-01 11:09:00.061258") -def test_send_user_reset_password_reset_password_link_contains_redirect_link_if_present_in_request( - admin_request, sample_user, mocker, password_reset_email_template -): - mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") - data = {"email": sample_user.email_address, "next": "blob"} - - admin_request.post( - "user.send_user_reset_password", - _data=data, - _expected_status=204, - ) - - notification = Notification.query.first() - assert "?next=blob" in notification.content - mocked.assert_called_once_with( - [str(notification.id)], queue="notify-internal-tasks" - ) - - -def test_send_user_reset_password_should_return_400_when_email_is_missing( - admin_request, mocker -): - mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") - data = {} - - json_resp = admin_request.post( - "user.send_user_reset_password", - _data=data, - _expected_status=400, - ) - assert json_resp["message"] == {"email": ["Missing data for required field."]} - assert mocked.call_count == 0 - - -def test_send_user_reset_password_should_return_400_when_user_doesnot_exist( - admin_request, mocker -): - mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") - bad_email_address = "bad@email.gov.uk" - data = {"email": bad_email_address} - - json_resp = admin_request.post( - "user.send_user_reset_password", - _data=data, - _expected_status=404, - ) - - assert json_resp["message"] == "No result found" - assert mocked.call_count == 0 - - -def test_send_user_reset_password_should_return_400_when_data_is_not_email_address( - admin_request, mocker -): - mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") - bad_email_address = "bad.email.gov.uk" - data = {"email": bad_email_address} - - json_resp = admin_request.post( - "user.send_user_reset_password", - _data=data, - _expected_status=400, - ) - - assert json_resp["message"] == {"email": ["Not a valid email address"]} - assert mocked.call_count == 0 +# @freeze_time("2016-01-01 11:09:00.061258") +# def test_send_user_reset_password_should_send_reset_password_link( +# admin_request, sample_user, mocker, password_reset_email_template +# ): +# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") +# data = {"email": sample_user.email_address} +# notify_service = password_reset_email_template.service + +# admin_request.post( +# "user.send_user_reset_password", +# _data=data, +# _expected_status=204, +# ) + +# notification = Notification.query.first() +# mocked.assert_called_once_with( +# [str(notification.id)], queue="notify-internal-tasks" +# ) +# assert ( +# notification.reply_to_text +# == notify_service.get_default_reply_to_email_address() +# ) + + +# @pytest.mark.parametrize( +# "data, expected_url", +# ( +# ( +# { +# "email": "notify@digital.fake.gov", +# }, +# ("http://localhost:6012/new-password/"), +# ), +# ( +# { +# "email": "notify@digital.fake.gov", +# "admin_base_url": "https://different.example.com", +# }, +# ("https://different.example.com/new-password/"), +# ), +# ), +# ) +# @freeze_time("2016-01-01 11:09:00.061258") +# def test_send_user_reset_password_should_use_provided_base_url( +# admin_request, +# sample_user, +# password_reset_email_template, +# mocker, +# data, +# expected_url, +# ): +# mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") + +# admin_request.post( +# "user.send_user_reset_password", +# _data=data, +# _expected_status=204, +# ) + +# assert Notification.query.first().personalisation["url"].startswith(expected_url) + + +# @freeze_time("2016-01-01 11:09:00.061258") +# def test_send_user_reset_password_reset_password_link_contains_redirect_link_if_present_in_request( +# admin_request, sample_user, mocker, password_reset_email_template +# ): +# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") +# data = {"email": sample_user.email_address, "next": "blob"} + +# admin_request.post( +# "user.send_user_reset_password", +# _data=data, +# _expected_status=204, +# ) + +# notification = Notification.query.first() +# assert "?next=blob" in notification.content +# mocked.assert_called_once_with( +# [str(notification.id)], queue="notify-internal-tasks" +# ) + + +# def test_send_user_reset_password_should_return_400_when_email_is_missing( +# admin_request, mocker +# ): +# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") +# data = {} + +# json_resp = admin_request.post( +# "user.send_user_reset_password", +# _data=data, +# _expected_status=400, +# ) +# assert json_resp["message"] == {"email": ["Missing data for required field."]} +# assert mocked.call_count == 0 + + +# def test_send_user_reset_password_should_return_400_when_user_doesnot_exist( +# admin_request, mocker +# ): +# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") +# bad_email_address = "bad@email.gov.uk" +# data = {"email": bad_email_address} + +# json_resp = admin_request.post( +# "user.send_user_reset_password", +# _data=data, +# _expected_status=404, +# ) + +# assert json_resp["message"] == "No result found" +# assert mocked.call_count == 0 + + +# def test_send_user_reset_password_should_return_400_when_data_is_not_email_address( +# admin_request, mocker +# ): +# mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") +# bad_email_address = "bad.email.gov.uk" +# data = {"email": bad_email_address} + +# json_resp = admin_request.post( +# "user.send_user_reset_password", +# _data=data, +# _expected_status=400, +# ) + +# assert json_resp["message"] == {"email": ["Not a valid email address"]} +# assert mocked.call_count == 0 def test_send_already_registered_email( @@ -842,25 +842,25 @@ def test_send_user_confirm_new_email_returns_400_when_email_missing( mocked.assert_not_called() -@freeze_time("2020-02-14T12:00:00") -def test_update_user_password_saves_correctly(admin_request, sample_service): - sample_user = sample_service.users[0] - new_password = "1234567890" - data = {"_password": "1234567890"} +# @freeze_time("2020-02-14T12:00:00") +# def test_update_user_password_saves_correctly(admin_request, sample_service): +# sample_user = sample_service.users[0] +# new_password = "1234567890" +# data = {"_password": "1234567890"} - json_resp = admin_request.post( - "user.update_password", user_id=str(sample_user.id), _data=data - ) +# json_resp = admin_request.post( +# "user.update_password", user_id=str(sample_user.id), _data=data +# ) - assert json_resp["data"]["password_changed_at"] is not None - data = {"password": new_password} +# assert json_resp["data"]["password_changed_at"] is not None +# data = {"password": new_password} - admin_request.post( - "user.verify_user_password", - user_id=str(sample_user.id), - _data=data, - _expected_status=204, - ) +# admin_request.post( +# "user.verify_user_password", +# user_id=str(sample_user.id), +# _data=data, +# _expected_status=204, +# ) def test_activate_user(admin_request, sample_user): From 85557dbb752061fd2dccd7b5a5970ec670391684 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 17 Jul 2024 13:07:40 -0700 Subject: [PATCH 02/56] put all of csv file in one line --- app/commands.py | 6 ++++-- poetry.lock | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/commands.py b/app/commands.py index c97a2f774..cdf84ee91 100644 --- a/app/commands.py +++ b/app/commands.py @@ -597,8 +597,10 @@ def download_csv_file_by_name(csv_filename): access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"] secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] - print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region)) - + content = s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region) + # We want it all to get logged in one line + content = content.replace("\n", "|") + print(content) @notify_command(name="populate-annual-billing-with-the-previous-years-allowance") @click.option( diff --git a/poetry.lock b/poetry.lock index c6de7033d..9b23a4db8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2098,13 +2098,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2493,6 +2489,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3475,7 +3472,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 7600699e23a9039333daa5da24c8f7745ff897d0 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 18 Jul 2024 07:39:01 -0700 Subject: [PATCH 03/56] fix flake8 --- app/commands.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/commands.py b/app/commands.py index cdf84ee91..c10327108 100644 --- a/app/commands.py +++ b/app/commands.py @@ -602,6 +602,7 @@ def download_csv_file_by_name(csv_filename): content = content.replace("\n", "|") print(content) + @notify_command(name="populate-annual-billing-with-the-previous-years-allowance") @click.option( "-y", From 86c9065a440d1aacb3004187694a3b0bc4cbd0c8 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 23 Jul 2024 07:47:35 -0700 Subject: [PATCH 04/56] use click.echo --- app/commands.py | 6 ++---- docs/all.md | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/commands.py b/app/commands.py index c10327108..cca20d626 100644 --- a/app/commands.py +++ b/app/commands.py @@ -590,7 +590,7 @@ def process_row_from_job(job_id, job_row_number): @notify_command(name="download-csv-file-by-name") -@click.option("-f", "--csv_filename", required=True, help="csv file name") +@click.argument("csv_filename") def download_csv_file_by_name(csv_filename): bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"] @@ -598,9 +598,7 @@ def download_csv_file_by_name(csv_filename): secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] content = s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region) - # We want it all to get logged in one line - content = content.replace("\n", "|") - print(content) + click.echo(content) @notify_command(name="populate-annual-billing-with-the-previous-years-allowance") diff --git a/docs/all.md b/docs/all.md index d98f0d336..3b1c999d2 100644 --- a/docs/all.md +++ b/docs/all.md @@ -1349,7 +1349,7 @@ cf run-task notify-api-production --command "flask command download-csv-file-by- locally, just do: ``` -poetry run flask command download-csv-file-by-name -f +poetry run flask command download-csv-file-by-name ``` ## Debug steps From dab47e7cf627577f902a4a19f9f3e889f6bd122a Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 23 Jul 2024 10:53:57 -0700 Subject: [PATCH 05/56] make user command --- app/commands.py | 8 ++++++++ poetry.lock | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/commands.py b/app/commands.py index c97a2f774..b3732e638 100644 --- a/app/commands.py +++ b/app/commands.py @@ -639,6 +639,14 @@ def populate_annual_billing_with_the_previous_years_allowance(year): ) +@notify_command(name="dump-user-info") +@click.argument("user_email_address") +def dump_user_info(user_email_address): + user = get_user_by_email(user_email_address) + content = user.serialize() + click.echo(content) + + @notify_command(name="populate-annual-billing-with-defaults") @click.option( "-y", diff --git a/poetry.lock b/poetry.lock index f6061f389..98b7a4343 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2098,13 +2098,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2493,6 +2489,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3475,7 +3472,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 74d0b40e163ada4fab87bf40cce87bc43a55ea79 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Wed, 24 Jul 2024 14:11:12 -0700 Subject: [PATCH 06/56] Doc updates, including setting Network Policy --- docs/all.md | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/docs/all.md b/docs/all.md index 5f9be2a30..9f54146fa 100644 --- a/docs/all.md +++ b/docs/all.md @@ -439,22 +439,32 @@ Rules for use: If this is the first time you have used Terraform in this repository, you will first have to hook your copy of Terraform up to our remote state. Follow [Retrieving existing bucket credentials](https://github.com/GSA/notifications-api/tree/main/terraform#retrieving-existing-bucket-credentials). 1. Set up services: - ``` + ```bash $ cd terraform/sandbox $ ../create_service_account.sh -s notify-sandbox -u -terraform -m > secrets.auto.tfvars $ terraform init $ terraform plan $ terraform apply ``` + Check [Terraform troubleshooting](https://github.com/GSA/notifications-api/tree/main/terraform#troubleshooting) if you encounter problems. 1. Change back to the project root directory: `cd ../..` -1. start a poetry shell as a shortcut to load `.env` file variables: `$ poetry shell` +1. Start a poetry shell as a shortcut to load `.env` file variables by running `poetry shell` 1. Output requirements.txt file: `poetry export --without-hashes --format=requirements.txt > requirements.txt` -1. Deploy the application: +1. Ensure you are using the correct CloudFoundry target + ```bash + cf target -o gsa-tts-benefits-studio -s notify-sandbox ``` +1. Deploy the application: + ```bash cf push --vars-file deploy-config/sandbox.yml --var NEW_RELIC_LICENSE_KEY=$NEW_RELIC_LICENSE_KEY ``` The real `push` command has more var arguments than the single one above. Get their values from a Notify team member. -1. Visit the URL of the app you just deployed +1. If you are setting up both our API app and our [Admin app](https://github.com/GSA/notifications-admin) in the sandbox, run this to allow the two apps to communicate with each other: + ```bash + cf add-network-policy notify-admin-sandbox notify-api-sandbox --protocol tcp --port 61443 + ``` + Check [API request failed](#api-request-failed) for problems. +1. Visit the URL(s) of the app you just deployed * Admin https://notify-sandbox.app.cloud.gov/ * API https://notify-api-sandbox.app.cloud.gov/ @@ -1392,7 +1402,20 @@ After pushing the Admin app, you might see this in the logs {"name": "app", "levelname": "ERROR", "message": "API unknown failed with status 503 message Request failed", "pathname": "/home/vcap/app/app/__init__.py", ... ``` -This indicates that the Admin and API apps are unable to talk to each other because of either a missing route or a missing network policy. The apps require [container-to-container networking](https://cloud.gov/docs/management/container-to-container/) to communicate. List `cf network-policies` and compare the output to our other deployed envs. If you find a policy is missing, you might have to create a network policy with something like: +And you would also see this in the Admin web UI + +``` +Sorry, we can't deliver what you asked for right now. +``` + +This indicates that the Admin and API apps are unable to talk to each other because of either a missing route or a missing network policy. The apps require [container-to-container networking](https://cloud.gov/docs/management/container-to-container/) to communicate. List `cf network-policies` and compare the output to our other deployed envs. If you find a policy is missing, you may not have created the correct Network Policy. See the command in [Deploying to the sandbox](#deploying-to-the-sandbox). + +### Service instance not found + +This error encounted after `cf push` indicates you may be using the wrong CloudFoundry target + ``` -cf add-network-policy notify-admin-sandbox notify-api-sandbox --protocol tcp --port 61443 +For application 'notify-api-sandbox': Service instance 'notify-api-rds-sandbox' not found ``` + +Run `cf target -o gsa-tts-benefits-studio -s notify-sandbox` before pushing to the Sandbox From 8b054d839621a62b791ffb7e2feb6dbc3c7bf0bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:57:34 +0000 Subject: [PATCH 07/56] Bump cryptography from 42.0.8 to 43.0.0 Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.8 to 43.0.0. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/42.0.8...43.0.0) --- updated-dependencies: - dependency-name: cryptography dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 65 +++++++++++++++++++++++--------------------------- pyproject.toml | 2 +- 2 files changed, 31 insertions(+), 36 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0857013cc..b704b4a72 100644 --- a/poetry.lock +++ b/poetry.lock @@ -939,43 +939,38 @@ files = [ [[package]] name = "cryptography" -version = "42.0.8" +version = "43.0.0" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:81d8a521705787afe7a18d5bfb47ea9d9cc068206270aad0b96a725022e18d2e"}, - {file = "cryptography-42.0.8-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:961e61cefdcb06e0c6d7e3a1b22ebe8b996eb2bf50614e89384be54c48c6b63d"}, - {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e3ec3672626e1b9e55afd0df6d774ff0e953452886e06e0f1eb7eb0c832e8902"}, - {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e599b53fd95357d92304510fb7bda8523ed1f79ca98dce2f43c115950aa78801"}, - {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:5226d5d21ab681f432a9c1cf8b658c0cb02533eece706b155e5fbd8a0cdd3949"}, - {file = "cryptography-42.0.8-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:6b7c4f03ce01afd3b76cf69a5455caa9cfa3de8c8f493e0d3ab7d20611c8dae9"}, - {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:2346b911eb349ab547076f47f2e035fc8ff2c02380a7cbbf8d87114fa0f1c583"}, - {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ad803773e9df0b92e0a817d22fd8a3675493f690b96130a5e24f1b8fabbea9c7"}, - {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:2f66d9cd9147ee495a8374a45ca445819f8929a3efcd2e3df6428e46c3cbb10b"}, - {file = "cryptography-42.0.8-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:d45b940883a03e19e944456a558b67a41160e367a719833c53de6911cabba2b7"}, - {file = "cryptography-42.0.8-cp37-abi3-win32.whl", hash = "sha256:a0c5b2b0585b6af82d7e385f55a8bc568abff8923af147ee3c07bd8b42cda8b2"}, - {file = "cryptography-42.0.8-cp37-abi3-win_amd64.whl", hash = "sha256:57080dee41209e556a9a4ce60d229244f7a66ef52750f813bfbe18959770cfba"}, - {file = "cryptography-42.0.8-cp39-abi3-macosx_10_12_universal2.whl", hash = "sha256:dea567d1b0e8bc5764b9443858b673b734100c2871dc93163f58c46a97a83d28"}, - {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4783183f7cb757b73b2ae9aed6599b96338eb957233c58ca8f49a49cc32fd5e"}, - {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0608251135d0e03111152e41f0cc2392d1e74e35703960d4190b2e0f4ca9c70"}, - {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:dc0fdf6787f37b1c6b08e6dfc892d9d068b5bdb671198c72072828b80bd5fe4c"}, - {file = "cryptography-42.0.8-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9c0c1716c8447ee7dbf08d6db2e5c41c688544c61074b54fc4564196f55c25a7"}, - {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:fff12c88a672ab9c9c1cf7b0c80e3ad9e2ebd9d828d955c126be4fd3e5578c9e"}, - {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:cafb92b2bc622cd1aa6a1dce4b93307792633f4c5fe1f46c6b97cf67073ec961"}, - {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:31f721658a29331f895a5a54e7e82075554ccfb8b163a18719d342f5ffe5ecb1"}, - {file = "cryptography-42.0.8-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:b297f90c5723d04bcc8265fc2a0f86d4ea2e0f7ab4b6994459548d3a6b992a14"}, - {file = "cryptography-42.0.8-cp39-abi3-win32.whl", hash = "sha256:2f88d197e66c65be5e42cd72e5c18afbfae3f741742070e3019ac8f4ac57262c"}, - {file = "cryptography-42.0.8-cp39-abi3-win_amd64.whl", hash = "sha256:fa76fbb7596cc5839320000cdd5d0955313696d9511debab7ee7278fc8b5c84a"}, - {file = "cryptography-42.0.8-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ba4f0a211697362e89ad822e667d8d340b4d8d55fae72cdd619389fb5912eefe"}, - {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:81884c4d096c272f00aeb1f11cf62ccd39763581645b0812e99a91505fa48e0c"}, - {file = "cryptography-42.0.8-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c9bb2ae11bfbab395bdd072985abde58ea9860ed84e59dbc0463a5d0159f5b71"}, - {file = "cryptography-42.0.8-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:7016f837e15b0a1c119d27ecd89b3515f01f90a8615ed5e9427e30d9cdbfed3d"}, - {file = "cryptography-42.0.8-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5a94eccb2a81a309806027e1670a358b99b8fe8bfe9f8d329f27d72c094dde8c"}, - {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:dec9b018df185f08483f294cae6ccac29e7a6e0678996587363dc352dc65c842"}, - {file = "cryptography-42.0.8-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:343728aac38decfdeecf55ecab3264b015be68fc2816ca800db649607aeee648"}, - {file = "cryptography-42.0.8-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:013629ae70b40af70c9a7a5db40abe5d9054e6f4380e50ce769947b73bf3caad"}, - {file = "cryptography-42.0.8.tar.gz", hash = "sha256:8d09d05439ce7baa8e9e95b07ec5b6c886f548deb7e0f69ef25f64b3bce842f2"}, + {file = "cryptography-43.0.0-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:64c3f16e2a4fc51c0d06af28441881f98c5d91009b8caaff40cf3548089e9c74"}, + {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3dcdedae5c7710b9f97ac6bba7e1052b95c7083c9d0e9df96e02a1932e777895"}, + {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d9a1eca329405219b605fac09ecfc09ac09e595d6def650a437523fcd08dd22"}, + {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ea9e57f8ea880eeea38ab5abf9fbe39f923544d7884228ec67d666abd60f5a47"}, + {file = "cryptography-43.0.0-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:9a8d6802e0825767476f62aafed40532bd435e8a5f7d23bd8b4f5fd04cc80ecf"}, + {file = "cryptography-43.0.0-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:cc70b4b581f28d0a254d006f26949245e3657d40d8857066c2ae22a61222ef55"}, + {file = "cryptography-43.0.0-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:4a997df8c1c2aae1e1e5ac49c2e4f610ad037fc5a3aadc7b64e39dea42249431"}, + {file = "cryptography-43.0.0-cp37-abi3-win32.whl", hash = "sha256:6e2b11c55d260d03a8cf29ac9b5e0608d35f08077d8c087be96287f43af3ccdc"}, + {file = "cryptography-43.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:31e44a986ceccec3d0498e16f3d27b2ee5fdf69ce2ab89b52eaad1d2f33d8778"}, + {file = "cryptography-43.0.0-cp39-abi3-macosx_10_9_universal2.whl", hash = "sha256:7b3f5fe74a5ca32d4d0f302ffe6680fcc5c28f8ef0dc0ae8f40c0f3a1b4fca66"}, + {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac1955ce000cb29ab40def14fd1bbfa7af2017cca696ee696925615cafd0dce5"}, + {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:299d3da8e00b7e2b54bb02ef58d73cd5f55fb31f33ebbf33bd00d9aa6807df7e"}, + {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:ee0c405832ade84d4de74b9029bedb7b31200600fa524d218fc29bfa371e97f5"}, + {file = "cryptography-43.0.0-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:cb013933d4c127349b3948aa8aaf2f12c0353ad0eccd715ca789c8a0f671646f"}, + {file = "cryptography-43.0.0-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fdcb265de28585de5b859ae13e3846a8e805268a823a12a4da2597f1f5afc9f0"}, + {file = "cryptography-43.0.0-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2905ccf93a8a2a416f3ec01b1a7911c3fe4073ef35640e7ee5296754e30b762b"}, + {file = "cryptography-43.0.0-cp39-abi3-win32.whl", hash = "sha256:47ca71115e545954e6c1d207dd13461ab81f4eccfcb1345eac874828b5e3eaaf"}, + {file = "cryptography-43.0.0-cp39-abi3-win_amd64.whl", hash = "sha256:0663585d02f76929792470451a5ba64424acc3cd5227b03921dab0e2f27b1709"}, + {file = "cryptography-43.0.0-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2c6d112bf61c5ef44042c253e4859b3cbbb50df2f78fa8fae6747a7814484a70"}, + {file = "cryptography-43.0.0-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:844b6d608374e7d08f4f6e6f9f7b951f9256db41421917dfb2d003dde4cd6b66"}, + {file = "cryptography-43.0.0-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:51956cf8730665e2bdf8ddb8da0056f699c1a5715648c1b0144670c1ba00b48f"}, + {file = "cryptography-43.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:aae4d918f6b180a8ab8bf6511a419473d107df4dbb4225c7b48c5c9602c38c7f"}, + {file = "cryptography-43.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:232ce02943a579095a339ac4b390fbbe97f5b5d5d107f8a08260ea2768be8cc2"}, + {file = "cryptography-43.0.0-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5bcb8a5620008a8034d39bce21dc3e23735dfdb6a33a06974739bfa04f853947"}, + {file = "cryptography-43.0.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:08a24a7070b2b6804c1940ff0f910ff728932a9d0e80e7814234269f9d46d069"}, + {file = "cryptography-43.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:e9c5266c432a1e23738d178e51c2c7a5e2ddf790f248be939448c0ba2021f9d1"}, + {file = "cryptography-43.0.0.tar.gz", hash = "sha256:b88075ada2d51aa9f18283532c9f60e72170041bba88d7f37e49cbb10275299e"}, ] [package.dependencies] @@ -988,7 +983,7 @@ nox = ["nox"] pep8test = ["check-sdist", "click", "mypy", "ruff"] sdist = ["build"] ssh = ["bcrypt (>=3.1.5)"] -test = ["certifi", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] +test = ["certifi", "cryptography-vectors (==43.0.0)", "pretend", "pytest (>=6.2.0)", "pytest-benchmark", "pytest-cov", "pytest-xdist"] test-randomorder = ["pytest-randomly"] [[package]] @@ -4747,4 +4742,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "d6bdb4ac6902b3afbd1699801fe56e2d7c307c925364239f8613691446f1c46f" +content-hash = "73b4e076cfdfa6a0282ff4b7f4acf7db179fce61d485ccc660f3aea9d210cc48" diff --git a/pyproject.toml b/pyproject.toml index 0649c713c..96d56344d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ shapely = "^2.0.5" smartypants = "^2.0.1" mistune = "0.8.4" blinker = "^1.8.2" -cryptography = "^42.0.8" +cryptography = "^43.0.0" idna = "^3.7" jmespath = "^1.0.1" markupsafe = "^2.1.5" From 9ee7959211a9305a8e65dcf2772359d98fc6d8a2 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 25 Jul 2024 19:40:10 -0700 Subject: [PATCH 08/56] Remove manual Network Policy creation step from all.md --- docs/all.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/all.md b/docs/all.md index 9f54146fa..140fa6ef3 100644 --- a/docs/all.md +++ b/docs/all.md @@ -438,6 +438,8 @@ Rules for use: If this is the first time you have used Terraform in this repository, you will first have to hook your copy of Terraform up to our remote state. Follow [Retrieving existing bucket credentials](https://github.com/GSA/notifications-api/tree/main/terraform#retrieving-existing-bucket-credentials). +:anchor: The Admin app depends upon the API app, so set up the API first. + 1. Set up services: ```bash $ cd terraform/sandbox @@ -448,7 +450,7 @@ If this is the first time you have used Terraform in this repository, you will f ``` Check [Terraform troubleshooting](https://github.com/GSA/notifications-api/tree/main/terraform#troubleshooting) if you encounter problems. 1. Change back to the project root directory: `cd ../..` -1. Start a poetry shell as a shortcut to load `.env` file variables by running `poetry shell` +1. Start a poetry shell as a shortcut to load `.env` file variables by running `poetry shell`. (You'll have to restart this any time you change the file.) 1. Output requirements.txt file: `poetry export --without-hashes --format=requirements.txt > requirements.txt` 1. Ensure you are using the correct CloudFoundry target ```bash @@ -459,11 +461,7 @@ If this is the first time you have used Terraform in this repository, you will f cf push --vars-file deploy-config/sandbox.yml --var NEW_RELIC_LICENSE_KEY=$NEW_RELIC_LICENSE_KEY ``` The real `push` command has more var arguments than the single one above. Get their values from a Notify team member. -1. If you are setting up both our API app and our [Admin app](https://github.com/GSA/notifications-admin) in the sandbox, run this to allow the two apps to communicate with each other: - ```bash - cf add-network-policy notify-admin-sandbox notify-api-sandbox --protocol tcp --port 61443 - ``` - Check [API request failed](#api-request-failed) for problems. + 1. Visit the URL(s) of the app you just deployed * Admin https://notify-sandbox.app.cloud.gov/ * API https://notify-api-sandbox.app.cloud.gov/ @@ -1408,7 +1406,11 @@ And you would also see this in the Admin web UI Sorry, we can't deliver what you asked for right now. ``` -This indicates that the Admin and API apps are unable to talk to each other because of either a missing route or a missing network policy. The apps require [container-to-container networking](https://cloud.gov/docs/management/container-to-container/) to communicate. List `cf network-policies` and compare the output to our other deployed envs. If you find a policy is missing, you may not have created the correct Network Policy. See the command in [Deploying to the sandbox](#deploying-to-the-sandbox). +This indicates that the Admin and API apps are unable to talk to each other because of either a missing route or a missing network policy. The apps require [container-to-container networking](https://cloud.gov/docs/management/container-to-container/) to communicate. List `cf network-policies`; you should see one connecting API and Admin on port 61443. If not, you can create one manually: + +```bash +cf add-network-policy notify-admin-sandbox notify-api-sandbox --protocol tcp --port 61443 +``` ### Service instance not found From efdffa83596a419023c0f1faf65c130b70f191b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:33:56 +0000 Subject: [PATCH 09/56] Bump boto3 from 1.34.144 to 1.34.148 Bumps [boto3](https://github.com/boto/boto3) from 1.34.144 to 1.34.148. - [Release notes](https://github.com/boto/boto3/releases) - [Commits](https://github.com/boto/boto3/compare/1.34.144...1.34.148) --- updated-dependencies: - dependency-name: boto3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index b704b4a72..4bb7c7257 100644 --- a/poetry.lock +++ b/poetry.lock @@ -403,17 +403,17 @@ files = [ [[package]] name = "boto3" -version = "1.34.144" +version = "1.34.148" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.34.144-py3-none-any.whl", hash = "sha256:b8433d481d50b68a0162c0379c0dd4aabfc3d1ad901800beb5b87815997511c1"}, - {file = "boto3-1.34.144.tar.gz", hash = "sha256:2f3e88b10b8fcc5f6100a9d74cd28230edc9d4fa226d99dd40a3ab38ac213673"}, + {file = "boto3-1.34.148-py3-none-any.whl", hash = "sha256:d63d36e5a34533ba69188d56f96da132730d5e9932c4e11c02d79319cd1afcec"}, + {file = "boto3-1.34.148.tar.gz", hash = "sha256:2058397f0a92c301e3116e9e65fbbc70ea49270c250882d65043d19b7c6e2d17"}, ] [package.dependencies] -botocore = ">=1.34.144,<1.35.0" +botocore = ">=1.34.148,<1.35.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -4742,4 +4742,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "73b4e076cfdfa6a0282ff4b7f4acf7db179fce61d485ccc660f3aea9d210cc48" +content-hash = "1ae472767fefe4ee835358932190a1231b2f0118d2412193d7875e48bc748384" diff --git a/pyproject.toml b/pyproject.toml index 96d56344d..666b0bfcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.12.2" alembic = "==1.13.2" amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" -boto3 = "^1.34.144" +boto3 = "^1.34.148" botocore = "^1.34.148" cachetools = "==5.4.0" celery = {version = "==5.4.0", extras = ["redis"]} From 4bbb85264a951690b61ca9429849a7054260fc95 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Mon, 29 Jul 2024 10:11:02 -0700 Subject: [PATCH 10/56] Remove unused recursive_delete local var --- terraform/development/main.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/terraform/development/main.tf b/terraform/development/main.tf index 0d8920c6f..91719db81 100644 --- a/terraform/development/main.tf +++ b/terraform/development/main.tf @@ -1,7 +1,6 @@ locals { cf_org_name = "gsa-tts-benefits-studio" cf_space_name = "notify-local-dev" - recursive_delete = true key_name = "${var.username}-api-dev-key" } From 4de0965426132d7dacaacdd7389172d5fecd0a28 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Mon, 29 Jul 2024 10:13:53 -0700 Subject: [PATCH 11/56] Remove unneeded comment - domain is controlled elsewhere --- terraform/production/main.tf | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/terraform/production/main.tf b/terraform/production/main.tf index 45cf7a5b8..e3bd10a26 100644 --- a/terraform/production/main.tf +++ b/terraform/production/main.tf @@ -74,23 +74,3 @@ module "sns_sms" { aws_region = "us-gov-west-1" monthly_spend_limit = 1000 } - -########################################################################### -# The following lines need to be commented out for the initial `terraform apply` -# It can be re-enabled after: -# TODO: decide on public API domain name -# 1) the app has first been deployed -# 2) the route has been manually created by an OrgManager: -# `cf create-domain gsa-tts-benefits-studio api.notify.gov` -########################################################################### -# module "domain" { -# source = "github.com/18f/terraform-cloudgov//domain?ref=v0.7.1" -# -# cf_org_name = local.cf_org_name -# cf_space_name = local.cf_space_name -# app_name_or_id = "${local.app_name}-${local.env}" -# name = "${local.app_name}-domain-${local.env}" -# recursive_delete = local.recursive_delete -# cdn_plan_name = "domain" -# domain_name = "api.notify.gov" -# } From 01eb6edac53999fbf016762050f406cea07ad4f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:47:37 +0000 Subject: [PATCH 12/56] Bump notifications-python-client from 9.1.0 to 10.0.0 Bumps [notifications-python-client](https://github.com/alphagov/notifications-python-client) from 9.1.0 to 10.0.0. - [Changelog](https://github.com/alphagov/notifications-python-client/blob/main/CHANGELOG.md) - [Commits](https://github.com/alphagov/notifications-python-client/compare/9.1.0...10.0.0) --- updated-dependencies: - dependency-name: notifications-python-client dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 4bb7c7257..660052a13 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2655,12 +2655,12 @@ files = [ [[package]] name = "notifications-python-client" -version = "9.1.0" +version = "10.0.0" description = "Python API client for GOV.UK Notify." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "notifications_python_client-9.1.0-py3-none-any.whl", hash = "sha256:43b8f738dfa81ae3aa656d91e361dbc51316194f8b9a430706b03347fa7a01bc"}, + {file = "notifications_python_client-10.0.0-py3-none-any.whl", hash = "sha256:0f152a4d23b7f7b827dae6b45ac63568a2bc56044b1aa57b66bc68b137c40e57"}, ] [package.dependencies] @@ -4742,4 +4742,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "1ae472767fefe4ee835358932190a1231b2f0118d2412193d7875e48bc748384" +content-hash = "88c3375017b63f5c05d2209a528f7d61112fa63ba118712edc720a0d899047f9" diff --git a/pyproject.toml b/pyproject.toml index 666b0bfcd..f603afc48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ lxml = "==5.2.2" marshmallow = "==3.21.3" marshmallow-sqlalchemy = "==1.0.0" newrelic = "*" -notifications-python-client = "==9.1.0" +notifications-python-client = "==10.0.0" oscrypto = "==1.3.0" packaging = "==24.1" poetry-dotenv-plugin = "==0.2.0" From b3fc6755b2ffddc6c0ebee4d7557e93592aeb944 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:32:03 +0000 Subject: [PATCH 13/56] Bump regex from 2024.5.15 to 2024.7.24 Bumps [regex](https://github.com/mrabarnett/mrab-regex) from 2024.5.15 to 2024.7.24. - [Changelog](https://github.com/mrabarnett/mrab-regex/blob/hg/changelog.txt) - [Commits](https://github.com/mrabarnett/mrab-regex/compare/2024.5.15...2024.7.24) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 162 ++++++++++++++++++++++++------------------------- pyproject.toml | 2 +- 2 files changed, 82 insertions(+), 82 deletions(-) diff --git a/poetry.lock b/poetry.lock index 660052a13..4410e8028 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3660,90 +3660,90 @@ rpds-py = ">=0.7.0" [[package]] name = "regex" -version = "2024.5.15" +version = "2024.7.24" description = "Alternative regular expression module, to replace re." optional = false python-versions = ">=3.8" files = [ - {file = "regex-2024.5.15-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a81e3cfbae20378d75185171587cbf756015ccb14840702944f014e0d93ea09f"}, - {file = "regex-2024.5.15-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7b59138b219ffa8979013be7bc85bb60c6f7b7575df3d56dc1e403a438c7a3f6"}, - {file = "regex-2024.5.15-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a0bd000c6e266927cb7a1bc39d55be95c4b4f65c5be53e659537537e019232b1"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5eaa7ddaf517aa095fa8da0b5015c44d03da83f5bd49c87961e3c997daed0de7"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba68168daedb2c0bab7fd7e00ced5ba90aebf91024dea3c88ad5063c2a562cca"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6e8d717bca3a6e2064fc3a08df5cbe366369f4b052dcd21b7416e6d71620dca1"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1337b7dbef9b2f71121cdbf1e97e40de33ff114801263b275aafd75303bd62b5"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f9ebd0a36102fcad2f03696e8af4ae682793a5d30b46c647eaf280d6cfb32796"}, - {file = "regex-2024.5.15-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9efa1a32ad3a3ea112224897cdaeb6aa00381627f567179c0314f7b65d354c62"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:1595f2d10dff3d805e054ebdc41c124753631b6a471b976963c7b28543cf13b0"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:b802512f3e1f480f41ab5f2cfc0e2f761f08a1f41092d6718868082fc0d27143"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:a0981022dccabca811e8171f913de05720590c915b033b7e601f35ce4ea7019f"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:19068a6a79cf99a19ccefa44610491e9ca02c2be3305c7760d3831d38a467a6f"}, - {file = "regex-2024.5.15-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1b5269484f6126eee5e687785e83c6b60aad7663dafe842b34691157e5083e53"}, - {file = "regex-2024.5.15-cp310-cp310-win32.whl", hash = "sha256:ada150c5adfa8fbcbf321c30c751dc67d2f12f15bd183ffe4ec7cde351d945b3"}, - {file = "regex-2024.5.15-cp310-cp310-win_amd64.whl", hash = "sha256:ac394ff680fc46b97487941f5e6ae49a9f30ea41c6c6804832063f14b2a5a145"}, - {file = "regex-2024.5.15-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f5b1dff3ad008dccf18e652283f5e5339d70bf8ba7c98bf848ac33db10f7bc7a"}, - {file = "regex-2024.5.15-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c6a2b494a76983df8e3d3feea9b9ffdd558b247e60b92f877f93a1ff43d26656"}, - {file = "regex-2024.5.15-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a32b96f15c8ab2e7d27655969a23895eb799de3665fa94349f3b2fbfd547236f"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:10002e86e6068d9e1c91eae8295ef690f02f913c57db120b58fdd35a6bb1af35"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ec54d5afa89c19c6dd8541a133be51ee1017a38b412b1321ccb8d6ddbeb4cf7d"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:10e4ce0dca9ae7a66e6089bb29355d4432caed736acae36fef0fdd7879f0b0cb"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e507ff1e74373c4d3038195fdd2af30d297b4f0950eeda6f515ae3d84a1770f"}, - {file = "regex-2024.5.15-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d1f059a4d795e646e1c37665b9d06062c62d0e8cc3c511fe01315973a6542e40"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0721931ad5fe0dda45d07f9820b90b2148ccdd8e45bb9e9b42a146cb4f695649"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:833616ddc75ad595dee848ad984d067f2f31be645d603e4d158bba656bbf516c"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:287eb7f54fc81546346207c533ad3c2c51a8d61075127d7f6d79aaf96cdee890"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:19dfb1c504781a136a80ecd1fff9f16dddf5bb43cec6871778c8a907a085bb3d"}, - {file = "regex-2024.5.15-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:119af6e56dce35e8dfb5222573b50c89e5508d94d55713c75126b753f834de68"}, - {file = "regex-2024.5.15-cp311-cp311-win32.whl", hash = "sha256:1c1c174d6ec38d6c8a7504087358ce9213d4332f6293a94fbf5249992ba54efa"}, - {file = "regex-2024.5.15-cp311-cp311-win_amd64.whl", hash = "sha256:9e717956dcfd656f5055cc70996ee2cc82ac5149517fc8e1b60261b907740201"}, - {file = "regex-2024.5.15-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:632b01153e5248c134007209b5c6348a544ce96c46005d8456de1d552455b014"}, - {file = "regex-2024.5.15-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:e64198f6b856d48192bf921421fdd8ad8eb35e179086e99e99f711957ffedd6e"}, - {file = "regex-2024.5.15-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68811ab14087b2f6e0fc0c2bae9ad689ea3584cad6917fc57be6a48bbd012c49"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f8ec0c2fea1e886a19c3bee0cd19d862b3aa75dcdfb42ebe8ed30708df64687a"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d0c0c0003c10f54a591d220997dd27d953cd9ccc1a7294b40a4be5312be8797b"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2431b9e263af1953c55abbd3e2efca67ca80a3de8a0437cb58e2421f8184717a"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a605586358893b483976cffc1723fb0f83e526e8f14c6e6614e75919d9862cf"}, - {file = "regex-2024.5.15-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:391d7f7f1e409d192dba8bcd42d3e4cf9e598f3979cdaed6ab11288da88cb9f2"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9ff11639a8d98969c863d4617595eb5425fd12f7c5ef6621a4b74b71ed8726d5"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:4eee78a04e6c67e8391edd4dad3279828dd66ac4b79570ec998e2155d2e59fd5"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8fe45aa3f4aa57faabbc9cb46a93363edd6197cbc43523daea044e9ff2fea83e"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:d0a3d8d6acf0c78a1fff0e210d224b821081330b8524e3e2bc5a68ef6ab5803d"}, - {file = "regex-2024.5.15-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c486b4106066d502495b3025a0a7251bf37ea9540433940a23419461ab9f2a80"}, - {file = "regex-2024.5.15-cp312-cp312-win32.whl", hash = "sha256:c49e15eac7c149f3670b3e27f1f28a2c1ddeccd3a2812cba953e01be2ab9b5fe"}, - {file = "regex-2024.5.15-cp312-cp312-win_amd64.whl", hash = "sha256:673b5a6da4557b975c6c90198588181029c60793835ce02f497ea817ff647cb2"}, - {file = "regex-2024.5.15-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:87e2a9c29e672fc65523fb47a90d429b70ef72b901b4e4b1bd42387caf0d6835"}, - {file = "regex-2024.5.15-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c3bea0ba8b73b71b37ac833a7f3fd53825924165da6a924aec78c13032f20850"}, - {file = "regex-2024.5.15-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bfc4f82cabe54f1e7f206fd3d30fda143f84a63fe7d64a81558d6e5f2e5aaba9"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5bb9425fe881d578aeca0b2b4b3d314ec88738706f66f219c194d67179337cb"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:64c65783e96e563103d641760664125e91bd85d8e49566ee560ded4da0d3e704"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cf2430df4148b08fb4324b848672514b1385ae3807651f3567871f130a728cc3"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5397de3219a8b08ae9540c48f602996aa6b0b65d5a61683e233af8605c42b0f2"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:455705d34b4154a80ead722f4f185b04c4237e8e8e33f265cd0798d0e44825fa"}, - {file = "regex-2024.5.15-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b2b6f1b3bb6f640c1a92be3bbfbcb18657b125b99ecf141fb3310b5282c7d4ed"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:3ad070b823ca5890cab606c940522d05d3d22395d432f4aaaf9d5b1653e47ced"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:5b5467acbfc153847d5adb21e21e29847bcb5870e65c94c9206d20eb4e99a384"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:e6662686aeb633ad65be2a42b4cb00178b3fbf7b91878f9446075c404ada552f"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:2b4c884767504c0e2401babe8b5b7aea9148680d2e157fa28f01529d1f7fcf67"}, - {file = "regex-2024.5.15-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:3cd7874d57f13bf70078f1ff02b8b0aa48d5b9ed25fc48547516c6aba36f5741"}, - {file = "regex-2024.5.15-cp38-cp38-win32.whl", hash = "sha256:e4682f5ba31f475d58884045c1a97a860a007d44938c4c0895f41d64481edbc9"}, - {file = "regex-2024.5.15-cp38-cp38-win_amd64.whl", hash = "sha256:d99ceffa25ac45d150e30bd9ed14ec6039f2aad0ffa6bb87a5936f5782fc1569"}, - {file = "regex-2024.5.15-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:13cdaf31bed30a1e1c2453ef6015aa0983e1366fad2667657dbcac7b02f67133"}, - {file = "regex-2024.5.15-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:cac27dcaa821ca271855a32188aa61d12decb6fe45ffe3e722401fe61e323cd1"}, - {file = "regex-2024.5.15-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7dbe2467273b875ea2de38ded4eba86cbcbc9a1a6d0aa11dcf7bd2e67859c435"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:64f18a9a3513a99c4bef0e3efd4c4a5b11228b48aa80743be822b71e132ae4f5"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d347a741ea871c2e278fde6c48f85136c96b8659b632fb57a7d1ce1872547600"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1878b8301ed011704aea4c806a3cadbd76f84dece1ec09cc9e4dc934cfa5d4da"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4babf07ad476aaf7830d77000874d7611704a7fcf68c9c2ad151f5d94ae4bfc4"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:35cb514e137cb3488bce23352af3e12fb0dbedd1ee6e60da053c69fb1b29cc6c"}, - {file = "regex-2024.5.15-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:cdd09d47c0b2efee9378679f8510ee6955d329424c659ab3c5e3a6edea696294"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:72d7a99cd6b8f958e85fc6ca5b37c4303294954eac1376535b03c2a43eb72629"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:a094801d379ab20c2135529948cb84d417a2169b9bdceda2a36f5f10977ebc16"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:c0c18345010870e58238790a6779a1219b4d97bd2e77e1140e8ee5d14df071aa"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:16093f563098448ff6b1fa68170e4acbef94e6b6a4e25e10eae8598bb1694b5d"}, - {file = "regex-2024.5.15-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:e38a7d4e8f633a33b4c7350fbd8bad3b70bf81439ac67ac38916c4a86b465456"}, - {file = "regex-2024.5.15-cp39-cp39-win32.whl", hash = "sha256:71a455a3c584a88f654b64feccc1e25876066c4f5ef26cd6dd711308aa538694"}, - {file = "regex-2024.5.15-cp39-cp39-win_amd64.whl", hash = "sha256:cab12877a9bdafde5500206d1020a584355a97884dfd388af3699e9137bf7388"}, - {file = "regex-2024.5.15.tar.gz", hash = "sha256:d3ee02d9e5f482cc8309134a91eeaacbdd2261ba111b0fef3748eeb4913e6a2c"}, + {file = "regex-2024.7.24-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b0d3f567fafa0633aee87f08b9276c7062da9616931382993c03808bb68ce"}, + {file = "regex-2024.7.24-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:3426de3b91d1bc73249042742f45c2148803c111d1175b283270177fdf669024"}, + {file = "regex-2024.7.24-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f273674b445bcb6e4409bf8d1be67bc4b58e8b46fd0d560055d515b8830063cd"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23acc72f0f4e1a9e6e9843d6328177ae3074b4182167e34119ec7233dfeccf53"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:65fd3d2e228cae024c411c5ccdffae4c315271eee4a8b839291f84f796b34eca"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c414cbda77dbf13c3bc88b073a1a9f375c7b0cb5e115e15d4b73ec3a2fbc6f59"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bf7a89eef64b5455835f5ed30254ec19bf41f7541cd94f266ab7cbd463f00c41"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19c65b00d42804e3fbea9708f0937d157e53429a39b7c61253ff15670ff62cb5"}, + {file = "regex-2024.7.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7a5486ca56c8869070a966321d5ab416ff0f83f30e0e2da1ab48815c8d165d46"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:6f51f9556785e5a203713f5efd9c085b4a45aecd2a42573e2b5041881b588d1f"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:a4997716674d36a82eab3e86f8fa77080a5d8d96a389a61ea1d0e3a94a582cf7"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:c0abb5e4e8ce71a61d9446040c1e86d4e6d23f9097275c5bd49ed978755ff0fe"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:18300a1d78cf1290fa583cd8b7cde26ecb73e9f5916690cf9d42de569c89b1ce"}, + {file = "regex-2024.7.24-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:416c0e4f56308f34cdb18c3f59849479dde5b19febdcd6e6fa4d04b6c31c9faa"}, + {file = "regex-2024.7.24-cp310-cp310-win32.whl", hash = "sha256:fb168b5924bef397b5ba13aabd8cf5df7d3d93f10218d7b925e360d436863f66"}, + {file = "regex-2024.7.24-cp310-cp310-win_amd64.whl", hash = "sha256:6b9fc7e9cc983e75e2518496ba1afc524227c163e43d706688a6bb9eca41617e"}, + {file = "regex-2024.7.24-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:382281306e3adaaa7b8b9ebbb3ffb43358a7bbf585fa93821300a418bb975281"}, + {file = "regex-2024.7.24-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4fdd1384619f406ad9037fe6b6eaa3de2749e2e12084abc80169e8e075377d3b"}, + {file = "regex-2024.7.24-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3d974d24edb231446f708c455fd08f94c41c1ff4f04bcf06e5f36df5ef50b95a"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a2ec4419a3fe6cf8a4795752596dfe0adb4aea40d3683a132bae9c30b81e8d73"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eb563dd3aea54c797adf513eeec819c4213d7dbfc311874eb4fd28d10f2ff0f2"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:45104baae8b9f67569f0f1dca5e1f1ed77a54ae1cd8b0b07aba89272710db61e"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:994448ee01864501912abf2bad9203bffc34158e80fe8bfb5b031f4f8e16da51"}, + {file = "regex-2024.7.24-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3fac296f99283ac232d8125be932c5cd7644084a30748fda013028c815ba3364"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:7e37e809b9303ec3a179085415cb5f418ecf65ec98cdfe34f6a078b46ef823ee"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:01b689e887f612610c869421241e075c02f2e3d1ae93a037cb14f88ab6a8934c"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f6442f0f0ff81775eaa5b05af8a0ffa1dda36e9cf6ec1e0d3d245e8564b684ce"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:871e3ab2838fbcb4e0865a6e01233975df3a15e6fce93b6f99d75cacbd9862d1"}, + {file = "regex-2024.7.24-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:c918b7a1e26b4ab40409820ddccc5d49871a82329640f5005f73572d5eaa9b5e"}, + {file = "regex-2024.7.24-cp311-cp311-win32.whl", hash = "sha256:2dfbb8baf8ba2c2b9aa2807f44ed272f0913eeeba002478c4577b8d29cde215c"}, + {file = "regex-2024.7.24-cp311-cp311-win_amd64.whl", hash = "sha256:538d30cd96ed7d1416d3956f94d54e426a8daf7c14527f6e0d6d425fcb4cca52"}, + {file = "regex-2024.7.24-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:fe4ebef608553aff8deb845c7f4f1d0740ff76fa672c011cc0bacb2a00fbde86"}, + {file = "regex-2024.7.24-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:74007a5b25b7a678459f06559504f1eec2f0f17bca218c9d56f6a0a12bfffdad"}, + {file = "regex-2024.7.24-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7df9ea48641da022c2a3c9c641650cd09f0cd15e8908bf931ad538f5ca7919c9"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a1141a1dcc32904c47f6846b040275c6e5de0bf73f17d7a409035d55b76f289"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80c811cfcb5c331237d9bad3bea2c391114588cf4131707e84d9493064d267f9"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7214477bf9bd195894cf24005b1e7b496f46833337b5dedb7b2a6e33f66d962c"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d55588cba7553f0b6ec33130bc3e114b355570b45785cebdc9daed8c637dd440"}, + {file = "regex-2024.7.24-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:558a57cfc32adcf19d3f791f62b5ff564922942e389e3cfdb538a23d65a6b610"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a512eed9dfd4117110b1881ba9a59b31433caed0c4101b361f768e7bcbaf93c5"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:86b17ba823ea76256b1885652e3a141a99a5c4422f4a869189db328321b73799"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5eefee9bfe23f6df09ffb6dfb23809f4d74a78acef004aa904dc7c88b9944b05"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:731fcd76bbdbf225e2eb85b7c38da9633ad3073822f5ab32379381e8c3c12e94"}, + {file = "regex-2024.7.24-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:eaef80eac3b4cfbdd6de53c6e108b4c534c21ae055d1dbea2de6b3b8ff3def38"}, + {file = "regex-2024.7.24-cp312-cp312-win32.whl", hash = "sha256:185e029368d6f89f36e526764cf12bf8d6f0e3a2a7737da625a76f594bdfcbfc"}, + {file = "regex-2024.7.24-cp312-cp312-win_amd64.whl", hash = "sha256:2f1baff13cc2521bea83ab2528e7a80cbe0ebb2c6f0bfad15be7da3aed443908"}, + {file = "regex-2024.7.24-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:66b4c0731a5c81921e938dcf1a88e978264e26e6ac4ec96a4d21ae0354581ae0"}, + {file = "regex-2024.7.24-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:88ecc3afd7e776967fa16c80f974cb79399ee8dc6c96423321d6f7d4b881c92b"}, + {file = "regex-2024.7.24-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:64bd50cf16bcc54b274e20235bf8edbb64184a30e1e53873ff8d444e7ac656b2"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb462f0e346fcf41a901a126b50f8781e9a474d3927930f3490f38a6e73b6950"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a82465ebbc9b1c5c50738536fdfa7cab639a261a99b469c9d4c7dcbb2b3f1e57"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:68a8f8c046c6466ac61a36b65bb2395c74451df2ffb8458492ef49900efed293"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dac8e84fff5d27420f3c1e879ce9929108e873667ec87e0c8eeb413a5311adfe"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ba2537ef2163db9e6ccdbeb6f6424282ae4dea43177402152c67ef869cf3978b"}, + {file = "regex-2024.7.24-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:43affe33137fcd679bdae93fb25924979517e011f9dea99163f80b82eadc7e53"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:c9bb87fdf2ab2370f21e4d5636e5317775e5d51ff32ebff2cf389f71b9b13750"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:945352286a541406f99b2655c973852da7911b3f4264e010218bbc1cc73168f2"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:8bc593dcce679206b60a538c302d03c29b18e3d862609317cb560e18b66d10cf"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_s390x.whl", hash = "sha256:3f3b6ca8eae6d6c75a6cff525c8530c60e909a71a15e1b731723233331de4169"}, + {file = "regex-2024.7.24-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:c51edc3541e11fbe83f0c4d9412ef6c79f664a3745fab261457e84465ec9d5a8"}, + {file = "regex-2024.7.24-cp38-cp38-win32.whl", hash = "sha256:d0a07763776188b4db4c9c7fb1b8c494049f84659bb387b71c73bbc07f189e96"}, + {file = "regex-2024.7.24-cp38-cp38-win_amd64.whl", hash = "sha256:8fd5afd101dcf86a270d254364e0e8dddedebe6bd1ab9d5f732f274fa00499a5"}, + {file = "regex-2024.7.24-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:0ffe3f9d430cd37d8fa5632ff6fb36d5b24818c5c986893063b4e5bdb84cdf24"}, + {file = "regex-2024.7.24-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:25419b70ba00a16abc90ee5fce061228206173231f004437730b67ac77323f0d"}, + {file = "regex-2024.7.24-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:33e2614a7ce627f0cdf2ad104797d1f68342d967de3695678c0cb84f530709f8"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d33a0021893ede5969876052796165bab6006559ab845fd7b515a30abdd990dc"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:04ce29e2c5fedf296b1a1b0acc1724ba93a36fb14031f3abfb7abda2806c1535"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b16582783f44fbca6fcf46f61347340c787d7530d88b4d590a397a47583f31dd"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:836d3cc225b3e8a943d0b02633fb2f28a66e281290302a79df0e1eaa984ff7c1"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:438d9f0f4bc64e8dea78274caa5af971ceff0f8771e1a2333620969936ba10be"}, + {file = "regex-2024.7.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:973335b1624859cb0e52f96062a28aa18f3a5fc77a96e4a3d6d76e29811a0e6e"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:c5e69fd3eb0b409432b537fe3c6f44ac089c458ab6b78dcec14478422879ec5f"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:fbf8c2f00904eaf63ff37718eb13acf8e178cb940520e47b2f05027f5bb34ce3"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:ae2757ace61bc4061b69af19e4689fa4416e1a04840f33b441034202b5cd02d4"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:44fc61b99035fd9b3b9453f1713234e5a7c92a04f3577252b45feefe1b327759"}, + {file = "regex-2024.7.24-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:84c312cdf839e8b579f504afcd7b65f35d60b6285d892b19adea16355e8343c9"}, + {file = "regex-2024.7.24-cp39-cp39-win32.whl", hash = "sha256:ca5b2028c2f7af4e13fb9fc29b28d0ce767c38c7facdf64f6c2cd040413055f1"}, + {file = "regex-2024.7.24-cp39-cp39-win_amd64.whl", hash = "sha256:7c479f5ae937ec9985ecaf42e2e10631551d909f203e31308c12d703922742f9"}, + {file = "regex-2024.7.24.tar.gz", hash = "sha256:9cfd009eed1a46b27c14039ad5bbc5e71b6367c5b2e6d5f5da0ea91600817506"}, ] [[package]] @@ -4742,4 +4742,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "88c3375017b63f5c05d2209a528f7d61112fa63ba118712edc720a0d899047f9" +content-hash = "3c7039bc108ba62f74459dc798d578e3c19974691380a2cdf857d82c0bb24ace" diff --git a/pyproject.toml b/pyproject.toml index f603afc48..dc025f51d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,7 +58,7 @@ ordered-set = "^4.1.0" phonenumbers = "^8.13.40" python-json-logger = "^2.0.7" pytz = "^2024.1" -regex = "^2024.5.15" +regex = "^2024.7.24" shapely = "^2.0.5" smartypants = "^2.0.1" mistune = "0.8.4" From 8a32adf3327aeef686027c18148deedebd3d270c Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Mon, 29 Jul 2024 22:46:11 -0400 Subject: [PATCH 14/56] Update Python dependencies - 7/30/24 This changeset updates a few dependendencies referenced in our pyproject.toml file. Dependabot has a couple of PRs open but they are not rebasing properly with updates. Signed-off-by: Carlo Costino --- poetry.lock | 50 +++++++++++++++++++++++--------------------------- pyproject.toml | 12 ++++++------ 2 files changed, 29 insertions(+), 33 deletions(-) diff --git a/poetry.lock b/poetry.lock index 4410e8028..4e68c0fce 100644 --- a/poetry.lock +++ b/poetry.lock @@ -204,17 +204,17 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "awscli" -version = "1.33.30" +version = "1.33.32" description = "Universal Command Line Environment for AWS." optional = false python-versions = ">=3.8" files = [ - {file = "awscli-1.33.30-py3-none-any.whl", hash = "sha256:dd8b26de3128c7fbfbdf30f08fe6a0c8ae789d589feb702e131ac81c35d9eddb"}, - {file = "awscli-1.33.30.tar.gz", hash = "sha256:a312b5a06b9cbad4b975bd86dd8fec15326594727f2da2025effc11638dafc89"}, + {file = "awscli-1.33.32-py3-none-any.whl", hash = "sha256:94e0e348b4e98d949d01f3c9bba817ef9c0da4aabea53a5d966445618339c7dd"}, + {file = "awscli-1.33.32.tar.gz", hash = "sha256:90137622dcd7695939d64f57172901376d8ca5eb995c12e5fce50f55316c5b62"}, ] [package.dependencies] -botocore = "1.34.148" +botocore = "1.34.150" colorama = ">=0.2.5,<0.4.7" docutils = ">=0.10,<0.17" PyYAML = ">=3.10,<6.1" @@ -403,17 +403,17 @@ files = [ [[package]] name = "boto3" -version = "1.34.148" +version = "1.34.150" description = "The AWS SDK for Python" optional = false python-versions = ">=3.8" files = [ - {file = "boto3-1.34.148-py3-none-any.whl", hash = "sha256:d63d36e5a34533ba69188d56f96da132730d5e9932c4e11c02d79319cd1afcec"}, - {file = "boto3-1.34.148.tar.gz", hash = "sha256:2058397f0a92c301e3116e9e65fbbc70ea49270c250882d65043d19b7c6e2d17"}, + {file = "boto3-1.34.150-py3-none-any.whl", hash = "sha256:ad648c89a4935590a69341e5430fc42a021489a22de171ee3fd7bb204f9ef0fa"}, + {file = "boto3-1.34.150.tar.gz", hash = "sha256:894b222f7850b870a7ac63d7e378ac36c5c34375da24ddc30e131d9fafe369dc"}, ] [package.dependencies] -botocore = ">=1.34.148,<1.35.0" +botocore = ">=1.34.150,<1.35.0" jmespath = ">=0.7.1,<2.0.0" s3transfer = ">=0.10.0,<0.11.0" @@ -422,13 +422,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.148" +version = "1.34.150" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.34.148-py3-none-any.whl", hash = "sha256:9e09428b0bc4d0c1cf5e368dd6ab18eabf6047304060f8b5dd8391677cfe00e6"}, - {file = "botocore-1.34.148.tar.gz", hash = "sha256:258dd95570b43db9fa21cce5426eabaea5867e3a61224157650448b5019d1bbd"}, + {file = "botocore-1.34.150-py3-none-any.whl", hash = "sha256:b988d47f4d502df85befce11a48002421e4e6ea4289997b5e0261bac5fa76ce6"}, + {file = "botocore-1.34.150.tar.gz", hash = "sha256:4d23387e0f076d87b637a2a35c0ff2b8daca16eace36b63ce27f65630c6b375a"}, ] [package.dependencies] @@ -2093,13 +2093,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -3036,13 +3032,13 @@ files = [ [[package]] name = "pre-commit" -version = "3.7.1" +version = "3.8.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." optional = false python-versions = ">=3.9" files = [ - {file = "pre_commit-3.7.1-py2.py3-none-any.whl", hash = "sha256:fae36fd1d7ad7d6a5a1c0b0d5adb2ed1a3bda5a21bf6c3e5372073d7a11cd4c5"}, - {file = "pre_commit-3.7.1.tar.gz", hash = "sha256:8ca3ad567bc78a4972a3f1a477e94a79d4597e8140a6e0b651c5e33899c3654a"}, + {file = "pre_commit-3.8.0-py2.py3-none-any.whl", hash = "sha256:9a90a53bf82fdd8778d58085faf8d83df56e40dfe18f45b19446e26bf1b3a63f"}, + {file = "pre_commit-3.8.0.tar.gz", hash = "sha256:8bb6494d4a20423842e198980c9ecf9f96607a07ea29549e180eef9ae80fe7af"}, ] [package.dependencies] @@ -3294,13 +3290,13 @@ files = [ [[package]] name = "pytest" -version = "8.3.1" +version = "8.3.2" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-8.3.1-py3-none-any.whl", hash = "sha256:e9600ccf4f563976e2c99fa02c7624ab938296551f280835ee6516df8bc4ae8c"}, - {file = "pytest-8.3.1.tar.gz", hash = "sha256:7e8e5c5abd6e93cb1cc151f23e57adc31fcf8cfd2a3ff2da63e23f732de35db6"}, + {file = "pytest-8.3.2-py3-none-any.whl", hash = "sha256:4ba08f9ae7dcf84ded419494d229b48d0903ea6407b030eaec46df5e6a73bba5"}, + {file = "pytest-8.3.2.tar.gz", hash = "sha256:c132345d12ce551242c87269de812483f5bcc87cdbb4722e48487ba194f9fdce"}, ] [package.dependencies] @@ -3470,7 +3466,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -4016,18 +4011,19 @@ jeepney = ">=0.6" [[package]] name = "setuptools" -version = "70.3.0" +version = "72.1.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-70.3.0-py3-none-any.whl", hash = "sha256:fe384da74336c398e0d956d1cae0669bc02eed936cdb1d49b57de1990dc11ffc"}, - {file = "setuptools-70.3.0.tar.gz", hash = "sha256:f171bab1dfbc86b132997f26a119f6056a57950d058587841a0082e8830f9dc5"}, + {file = "setuptools-72.1.0-py3-none-any.whl", hash = "sha256:5a03e1860cf56bb6ef48ce186b0e557fdba433237481a9a625176c2831be15d1"}, + {file = "setuptools-72.1.0.tar.gz", hash = "sha256:8d243eff56d095e5817f796ede6ae32941278f542e0f941867cc05ae52b162ec"}, ] [package.extras] +core = ["importlib-metadata (>=6)", "importlib-resources (>=5.10.2)", "jaraco.text (>=3.7)", "more-itertools (>=8.8)", "ordered-set (>=3.1.1)", "packaging (>=24)", "platformdirs (>=2.6.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.11.*)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (<0.4)", "pytest-ruff (>=0.2.1)", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] [[package]] name = "shapely" @@ -4742,4 +4738,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "3c7039bc108ba62f74459dc798d578e3c19974691380a2cdf857d82c0bb24ace" +content-hash = "4ef9a352a137fe091b1084b06959b9b674c30635771abc23010d2ba560f6bfd6" diff --git a/pyproject.toml b/pyproject.toml index dc025f51d..3bfff266b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,8 +11,8 @@ python = "^3.12.2" alembic = "==1.13.2" amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" -boto3 = "^1.34.148" -botocore = "^1.34.148" +boto3 = "^1.34.150" +botocore = "^1.34.150" cachetools = "==5.4.0" celery = {version = "==5.4.0", extras = ["redis"]} certifi = ">=2022.12.7" @@ -81,7 +81,7 @@ requests = "^2.32.3" [tool.poetry.group.dev.dependencies] -awscli = "^1.29.74" +awscli = "^1.33.32" bandit = "*" black = "^24.3.0" cloudfoundry-client = "*" @@ -94,15 +94,15 @@ isort = "^5.13.2" jinja2-cli = {version = "==0.8.2", extras = ["yaml"]} moto = "==5.0.11" pip-audit = "*" -pre-commit = "^3.7.1" -pytest = "^8.3.1" +pre-commit = "^3.8.0" +pytest = "^8.3.2" pytest-env = "^1.1.3" pytest-mock = "^3.14.0" pytest-cov = "^5.0.0" pytest-xdist = "^3.5.0" radon = "^6.0.1" requests-mock = "^1.11.0" -setuptools = "^70.3.0" +setuptools = "^72.1.0" sqlalchemy-utils = "^0.41.2" vulture = "^2.10" detect-secrets = "^1.5.0" From ace04bd6cf87fa4815f8299ef688caf339169131 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 31 Jul 2024 10:48:50 -0700 Subject: [PATCH 15/56] new command to look at sms senders --- app/commands.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/commands.py b/app/commands.py index c97a2f774..a82424e3d 100644 --- a/app/commands.py +++ b/app/commands.py @@ -36,12 +36,14 @@ dao_get_organization_by_email_address, dao_get_organization_by_id, ) +from app.dao.service_sms_sender_dao import dao_get_sms_senders_by_service_id from app.dao.services_dao import ( dao_fetch_all_services_by_user, dao_fetch_all_services_created_by_user, dao_fetch_service_by_id, dao_update_service, delete_service_and_all_associated_db_objects, + get_services_by_partial_name, ) from app.dao.templates_dao import dao_get_template_by_id from app.dao.users_dao import ( @@ -600,6 +602,21 @@ def download_csv_file_by_name(csv_filename): print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region)) +@notify_command(name="dump-sms-senders") +@click.argument("service_name") +def dump_user_info(service_name): + services = get_services_by_partial_name(service_name) + if len(services) > 1: + raise ValueError( + f"Please use a unique and complete service name instead of {service_name}" + ) + + senders = dao_get_sms_senders_by_service_id(services[0].id) + for sender in senders: + # Not PII, okay to put in logs + click.echo(sender.serialize()) + + @notify_command(name="populate-annual-billing-with-the-previous-years-allowance") @click.option( "-y", From 0b96a517011b4bef8ed6f4e33a90eb7d2a07c5d9 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 31 Jul 2024 11:03:07 -0700 Subject: [PATCH 16/56] update comments --- app/commands.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/commands.py b/app/commands.py index a82424e3d..fb8e48739 100644 --- a/app/commands.py +++ b/app/commands.py @@ -604,7 +604,10 @@ def download_csv_file_by_name(csv_filename): @notify_command(name="dump-sms-senders") @click.argument("service_name") -def dump_user_info(service_name): +def dump_sms_senders(service_name): + + # poetry run flask command dump-sms-senders MyServiceName + # cf run-task notify-api-production --command "flask command dump-sms-senders MyServiceName" services = get_services_by_partial_name(service_name) if len(services) > 1: raise ValueError( From 1e26511dc6a17e26da6003809524a46160f19fe9 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 31 Jul 2024 13:54:03 -0700 Subject: [PATCH 17/56] raise exception if phone number doesn't match --- app/delivery/send_to_providers.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index c0d32bf86..c5b8fe0ee 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -10,6 +10,7 @@ from app.dao.email_branding_dao import dao_get_email_branding_by_id from app.dao.notifications_dao import dao_update_notification from app.dao.provider_details_dao import get_provider_details_by_notification_type +from app.dao.service_sms_sender_dao import dao_get_sms_senders_by_service_id from app.enums import BrandType, KeyType, NotificationStatus, NotificationType from app.exceptions import NotificationTechnicalFailureException from app.serialised_models import SerialisedService, SerialisedTemplate @@ -101,6 +102,18 @@ def send_sms_to_provider(notification): raise Exception( f"The recipient for (Service ID: {si}; Job ID: {ji}; Job Row Number {jrn} was not found." ) + + possible_senders = dao_get_sms_senders_by_service_id( + notification.service_id + ) + sender_numbers = [] + for possible_sender in possible_senders: + sender_numbers.append(possible_sender.sms_sender) + if notification.reply_to_text not in sender_numbers: + raise ValueError( + f"{notification.reply_to_text} not in {sender_numbers} #notify-admin-1701" + ) + send_sms_kwargs = { "to": recipient, "content": str(template), From e244278ccf4827fe0e4cc535ff3df5a3398de842 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 31 Jul 2024 14:21:30 -0700 Subject: [PATCH 18/56] fix tests --- app/delivery/send_to_providers.py | 15 +++++++++------ tests/app/delivery/test_send_to_providers.py | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index c5b8fe0ee..4f811de22 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -103,12 +103,7 @@ def send_sms_to_provider(notification): f"The recipient for (Service ID: {si}; Job ID: {ji}; Job Row Number {jrn} was not found." ) - possible_senders = dao_get_sms_senders_by_service_id( - notification.service_id - ) - sender_numbers = [] - for possible_sender in possible_senders: - sender_numbers.append(possible_sender.sms_sender) + sender_numbers = get_sender_numbers(notification) if notification.reply_to_text not in sender_numbers: raise ValueError( f"{notification.reply_to_text} not in {sender_numbers} #notify-admin-1701" @@ -143,6 +138,14 @@ def send_sms_to_provider(notification): return message_id +def get_sender_numbers(notification): + possible_senders = dao_get_sms_senders_by_service_id(notification.service_id) + sender_numbers = [] + for possible_sender in possible_senders: + sender_numbers.append(possible_sender.sms_sender) + return sender_numbers + + def send_email_to_provider(notification): # Someone needs an email, possibly new registration recipient = redis_store.get(f"email-address-{notification.id}") diff --git a/tests/app/delivery/test_send_to_providers.py b/tests/app/delivery/test_send_to_providers.py index af65dd766..ade2563cb 100644 --- a/tests/app/delivery/test_send_to_providers.py +++ b/tests/app/delivery/test_send_to_providers.py @@ -318,6 +318,9 @@ def test_should_send_sms_with_downgraded_content(notify_db_session, mocker): # é, o, and u are in GSM. # ī, grapes, tabs, zero width space and ellipsis are not # ó isn't in GSM, but it is in the welsh alphabet so will still be sent + mocker.patch( + "app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"] + ) msg = "a é ī o u 🍇 foo\tbar\u200bbaz((misc))…" placeholder = "∆∆∆abc" gsm_message = "?ódz Housing Service: a é i o u ? foo barbaz???abc..." @@ -609,6 +612,10 @@ def __update_notification(notification_to_update, research_mode, expected_status def test_should_update_billable_units_and_status_according_to_research_mode_and_key_type( sample_template, mocker, research_mode, key_type, billable_units, expected_status ): + + mocker.patch( + "app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"] + ) notification = create_notification( template=sample_template, billable_units=0, @@ -771,6 +778,10 @@ def test_send_email_to_provider_uses_reply_to_from_notification( def test_send_sms_to_provider_should_use_normalised_to(mocker, client, sample_template): + + mocker.patch( + "app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"] + ) send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( template=sample_template, to_field="+12028675309", normalised_to="2028675309" @@ -826,6 +837,10 @@ def test_send_email_to_provider_should_user_normalised_to( def test_send_sms_to_provider_should_return_template_if_found_in_redis( mocker, client, sample_template ): + + mocker.patch( + "app.delivery.send_to_providers.get_sender_numbers", return_value=["testing"] + ) from app.schemas import service_schema, template_schema service_dict = service_schema.dump(sample_template.service) From 635c17008e19d8442e6f7c0633f63d2382b14cba Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 31 Jul 2024 14:47:10 -0700 Subject: [PATCH 19/56] fix tests --- tests/app/delivery/test_send_to_providers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/app/delivery/test_send_to_providers.py b/tests/app/delivery/test_send_to_providers.py index ade2563cb..7f16a799a 100644 --- a/tests/app/delivery/test_send_to_providers.py +++ b/tests/app/delivery/test_send_to_providers.py @@ -330,6 +330,7 @@ def test_should_send_sms_with_downgraded_content(notify_db_session, mocker): template=template, ) db_notification.personalisation = {"misc": placeholder} + db_notification.reply_to_text = 'testing' mocker.patch("app.aws_sns_client.send_sms") @@ -621,6 +622,7 @@ def test_should_update_billable_units_and_status_according_to_research_mode_and_ billable_units=0, status=NotificationStatus.CREATED, key_type=key_type, + reply_to_text='testing', ) mocker.patch("app.aws_sns_client.send_sms") mocker.patch( @@ -784,7 +786,7 @@ def test_send_sms_to_provider_should_use_normalised_to(mocker, client, sample_te ) send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+12028675309", normalised_to="2028675309" + template=sample_template, to_field="+12028675309", normalised_to="2028675309", reply_to_text='testing' ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3") @@ -860,7 +862,7 @@ def test_send_sms_to_provider_should_return_template_if_found_in_redis( send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+447700900855", normalised_to="447700900855" + template=sample_template, to_field="+447700900855", normalised_to="447700900855", reply_to_text='testing' ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3") From bd75e30f96729d955bc884248b24d387722228c1 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 08:19:33 -0700 Subject: [PATCH 20/56] add test --- tests/app/test_commands.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/app/test_commands.py b/tests/app/test_commands.py index 7eee00bbf..7b4885660 100644 --- a/tests/app/test_commands.py +++ b/tests/app/test_commands.py @@ -8,6 +8,7 @@ bulk_invite_user_to_service, create_new_service, create_test_user, + download_csv_file_by_name, fix_billable_units, insert_inbound_numbers_from_file, populate_annual_billing_with_defaults, @@ -427,6 +428,22 @@ def test_promote_user_to_platform_admin( assert user.platform_admin is True +def test_download_csv_file_by_name( + notify_api, sample_platform_admin +): + assert sample_platform_admin.platform_admin is True + + result = notify_api.test_cli_runner().invoke( + download_csv_file_by_name, + [ + "NonExistentName", + ], + ) + + print(result) + assert result == '404' + + def test_promote_user_to_platform_admin_no_result_found( notify_db_session, notify_api, sample_user ): From 4299b46f8a110878e05502aca493311fcd5d6c0c Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 09:23:26 -0700 Subject: [PATCH 21/56] fix test --- app/aws/s3.py | 11 ++++++++--- tests/app/test_commands.py | 9 ++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/aws/s3.py b/app/aws/s3.py index 7886b8f3a..189c6b4a9 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -104,15 +104,20 @@ def download_from_s3( region_name=region, ) s3 = session.client("s3", config=AWS_CLIENT_CONFIG) + result = None try: - s3.download_file(bucket_name, s3_key, local_filename) + result = s3.download_file(bucket_name, s3_key, local_filename) print(f"File downloaded successfully to {local_filename}") - except botocore.exceptions.NoCredentialsError: + except botocore.exceptions.NoCredentialsError as nce: print("Credentials not found") - except botocore.exceptions.PartialCredentialsError: + raise Exception(nce) + except botocore.exceptions.PartialCredentialsError as pce: print("Incomplete credentials provided") + raise Exception(pce) except Exception as e: print(f"An error occurred {e}") + raise Exception(e) + return result def get_s3_object(bucket_name, file_location, access_key, secret_key, region): diff --git a/tests/app/test_commands.py b/tests/app/test_commands.py index 7b4885660..817f2e4bf 100644 --- a/tests/app/test_commands.py +++ b/tests/app/test_commands.py @@ -428,9 +428,7 @@ def test_promote_user_to_platform_admin( assert user.platform_admin is True -def test_download_csv_file_by_name( - notify_api, sample_platform_admin -): +def test_download_csv_file_by_name(notify_api, sample_platform_admin): assert sample_platform_admin.platform_admin is True result = notify_api.test_cli_runner().invoke( @@ -440,8 +438,9 @@ def test_download_csv_file_by_name( ], ) - print(result) - assert result == '404' + # if we get a 404, it means that the file is not in s3 (of course) + # but we are making the call to s3, etc. so that part is working + assert "404" in str(result) def test_promote_user_to_platform_admin_no_result_found( From c2659c5320e3594bfbfc4657f92ce25718bef3a8 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 09:28:42 -0700 Subject: [PATCH 22/56] Link to yesterday's video --- terraform/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/terraform/README.md b/terraform/README.md index bbb63424a..223adc451 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -7,6 +7,8 @@ This directory holds the Terraform modules for maintaining Notify.gov's API infr The Admin app repo [has its own terraform directory](https://github.com/GSA/notifications-admin/tree/main/terraform) but a lot of the below instructions apply to both apps. +:tv: [Video introduction](https://drive.google.com/file/d/13SR3M8IowYBa4Wp_YEcuAURZ74EcCYoc/) to Notify infrastructure + ## Retrieving existing bucket credentials :green_book: New developers start here! From 7344fbf78b57c82d2ef2cb9c4714681410f6c280 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 09:34:53 -0700 Subject: [PATCH 23/56] Initial setup instructions no longer needed --- terraform/README.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index 223adc451..4ec3d1a39 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -33,43 +33,6 @@ Assuming [initial setup](#initial-setup) is complete — which it should be These credentials will allow Terraform to access the AWS/Cloud.gov bucket in which developers share Terraform state files. Now you are ready to develop Terraform using the [Workflow for deployed environments](#workflow-for-deployed-environments). -## Initial setup - -These instructions were used for deploying the project for the first time, years ago. We should not have to perform these steps again. They are provided here for reference. - -1. Manually run the bootstrap module following instructions under [Terraform State Credentials](#terraform-state-credentials) -1. Setup CI/CD Pipeline to run Terraform - 1. Copy bootstrap credentials to your CI/CD secrets using the instructions in the base README - 1. Create a cloud.gov SpaceDeployer by following the instructions under [SpaceDeployers](#spacedeployers) - 1. Copy SpaceDeployer credentials to your CI/CD secrets using the instructions in the base README -1. Manually Running Terraform - 1. Follow instructions under [Workflow for deployed environments](#workflow-for-deployed-environments) to create your infrastructure - -### Terraform state credentials - -The bootstrap module is used to create an s3 bucket for later terraform runs to store their state in. (If the bucket is already created, you should [Use bootstrap credentials](#use-bootstrap-credentials)) - -#### Bootstrapping the state storage s3 buckets for the first time - -1. Within the `bootstrap` directory, run `terraform init` -1. Run `./run.sh plan` to verify that the changes are what you expect -1. Run `./run.sh apply` to set up the bucket -1. Follow instructions under [Use bootstrap credentials](#use-bootstrap-credentials) -1. Ensure that `import.sh` includes a line and correct IDs for any resources created -1. Run `./teardown_creds.sh` to remove the space deployer account used to create the s3 bucket -1. Copy `bucket` from `bucket_credentials` output to the backend block of `staging/providers.tf` and `production/providers.tf` - -#### To make changes to the bootstrap module - -*This should not be necessary in most cases* - -1. Run `terraform init` -1. If you don't have terraform state locally: - 1. run `./import.sh` - 1. optionally run `./run.sh apply` to include the existing outputs in the state file -1. Make your changes -1. Continue from step 2 of the boostrapping instructions - ## SpaceDeployers A [SpaceDeployer](https://cloud.gov/docs/services/cloud-gov-service-account/) account is required to run terraform or From b5014bd0ec0ae5844acea47bcb1086c0a284d06f Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 09:37:49 -0700 Subject: [PATCH 24/56] ugh --- app/aws/s3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/aws/s3.py b/app/aws/s3.py index 189c6b4a9..760e4dedf 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -116,7 +116,8 @@ def download_from_s3( raise Exception(pce) except Exception as e: print(f"An error occurred {e}") - raise Exception(e) + text = f"EXCEPTION {e} local_filename {local_filename}" + raise Exception(text) return result From 73ba76fd2af3946a96ebb0c55323694d1e966ba8 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 09:38:01 -0700 Subject: [PATCH 25/56] Move SpaceDeployers section down --- terraform/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index 4ec3d1a39..3f2414410 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -33,15 +33,6 @@ Assuming [initial setup](#initial-setup) is complete — which it should be These credentials will allow Terraform to access the AWS/Cloud.gov bucket in which developers share Terraform state files. Now you are ready to develop Terraform using the [Workflow for deployed environments](#workflow-for-deployed-environments). -## SpaceDeployers - -A [SpaceDeployer](https://cloud.gov/docs/services/cloud-gov-service-account/) account is required to run terraform or -deploy the application from the CI/CD pipeline. Create a new account by running: - -`./create_service_account.sh -s -u ` - -SpaceDeployers are also needed to run Terraform locally — they fill user and password input variables (via `deployers` within `main.tf`) that some of our Terraform modules require when they start running. Using a SpaceDeployer account locally is covered in [the next section](#workflow-for-deployed-environments). - ## Workflow for deployed environments These are the steps for developing Terraform code for our deployed environment modules (`sandbox`, `demo`, `staging` and `production`) locally on your laptop. Or for setting up a new deployment environment, or otherwise for running Terraform manually in any module that uses remote state. You don't need to do all this to run code in the `development` module, because it is not a deployed environment and it does not use remote state. @@ -111,6 +102,15 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent Optionally, you can also `rm secrets.auto.tfvars` +## SpaceDeployers + +A [SpaceDeployer](https://cloud.gov/docs/services/cloud-gov-service-account/) account is required to run terraform or +deploy the application from the CI/CD pipeline. Create a new account by running: + +`./create_service_account.sh -s -u ` + +SpaceDeployers are also needed to run Terraform locally — they fill user and password input variables (via `deployers` within `main.tf`) that some of our Terraform modules require when they start running. Using a SpaceDeployer account locally is covered in [the next section](#workflow-for-deployed-environments). + ## Structure The `terraform` directory contains sub-directories (`staging`, `production`, etc.) named for deployment environments. Each of these is a *module*, which is just Terraform's word for a directory with some .tf files in it. Each module governs the infrastructure of the environment for which it is named. This directory structure forms "[bulkheads](https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa)" which isolate Terraform commands to a single environment, limiting accidental damage. From d8238852ee5e32d0a097dd44ee0ad9291cedd204 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 10:26:23 -0700 Subject: [PATCH 26/56] Experiment with relative link, image --- terraform/README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index 3f2414410..b3feb3e53 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -1,5 +1,7 @@ # Terraform + + This directory holds the Terraform modules for maintaining Notify.gov's API infrastructure. You might want to: * [Set up](#retrieving-existing-bucket-credentials) the Sandbox and develop Terraform, * [Learn](#structure) about the directory structure, or @@ -75,7 +77,7 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent This will show you any pending changes that Terraform is ready to make. - :pencil: Now is the time to write any HCL code you are planning to write, re-running `terraform plan` to confirm that the code works as you develop. Keep in mind that any changes to the codebase that you commit will be run by the CI/CD pipeline. + :pencil: Now is the time to write any HCL code (aka Terraform code) you are planning to write, re-running `terraform plan` to confirm that the code works as you develop. Keep in mind that any changes to the codebase that you commit will be run by the CI/CD pipeline. 1. **Only if it is safe to do so**, apply your changes. @@ -102,6 +104,13 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent Optionally, you can also `rm secrets.auto.tfvars` +## Maintenance + +### Version upgrade checklist + +* Cloud Foundry Terraform plugin in every module, [here for example](sandbox/providers.tf#L6) + + ## SpaceDeployers A [SpaceDeployer](https://cloud.gov/docs/services/cloud-gov-service-account/) account is required to run terraform or @@ -109,7 +118,7 @@ deploy the application from the CI/CD pipeline. Create a new account by running: `./create_service_account.sh -s -u ` -SpaceDeployers are also needed to run Terraform locally — they fill user and password input variables (via `deployers` within `main.tf`) that some of our Terraform modules require when they start running. Using a SpaceDeployer account locally is covered in [the next section](#workflow-for-deployed-environments). +SpaceDeployers are also needed to run Terraform locally — they fill user and password input variables (via `deployers` within `main.tf`) that some of our Terraform modules require when they start running. Using a SpaceDeployer account locally is covered in [Workflow for deployed environments](#workflow-for-deployed-environments). ## Structure From 2dd3ebc6570f56c5832161485b171019ac5db9ae Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 10:38:58 -0700 Subject: [PATCH 27/56] fix test --- .ds.baseline | 4 ++-- app/commands.py | 7 ++++--- tests/app/service/test_rest.py | 6 +----- tests/app/test_commands.py | 17 ++++++++--------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.ds.baseline b/.ds.baseline index bf8b9631a..8b6703173 100644 --- a/.ds.baseline +++ b/.ds.baseline @@ -305,7 +305,7 @@ "filename": "tests/app/service/test_rest.py", "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "is_verified": false, - "line_number": 1274, + "line_number": 1275, "is_secret": false } ], @@ -384,5 +384,5 @@ } ] }, - "generated_at": "2024-07-22T21:27:35Z" + "generated_at": "2024-08-01T17:38:39Z" } diff --git a/app/commands.py b/app/commands.py index 9e1a26081..fe59537fb 100644 --- a/app/commands.py +++ b/app/commands.py @@ -592,14 +592,15 @@ def process_row_from_job(job_id, job_row_number): @notify_command(name="download-csv-file-by-name") -@click.argument("csv_filename") +@click.option("-f", "--csv_filename", required=True, help="S3 file location") def download_csv_file_by_name(csv_filename): - # poetry run flask command download-csv-file-by-name - # cf run-task notify-api-production --command "flask command download-csv-file-by-name " + # poetry run flask command download-csv-file-by-name -f + # cf run-task notify-api-production --command "flask command download-csv-file-by-name -f " bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"] access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"] secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] + s3.download_from_s3( bucket_name, csv_filename, "download.csv", access_key, secret, region ) diff --git a/tests/app/service/test_rest.py b/tests/app/service/test_rest.py index 8a97046e0..0cdae7de4 100644 --- a/tests/app/service/test_rest.py +++ b/tests/app/service/test_rest.py @@ -1770,9 +1770,6 @@ def test_get_all_notifications_for_service_in_order_with_post_request( assert response.status_code == 200 -@pytest.mark.skip( - reason="We can't search on recipient if recipient is not kept in the db" -) def test_get_all_notifications_for_service_filters_notifications_when_using_post_request( client, notify_db_session ): @@ -1808,7 +1805,6 @@ def test_get_all_notifications_for_service_filters_notifications_when_using_post "page": 1, "template_type": [TemplateType.SMS], "status": [NotificationStatus.CREATED, NotificationStatus.SENDING], - "to": "0855", } response = client.post( @@ -1818,7 +1814,7 @@ def test_get_all_notifications_for_service_filters_notifications_when_using_post ) resp = json.loads(response.get_data(as_text=True)) - assert len(resp["notifications"]) == 1 + assert len(resp["notifications"]) == 2 assert resp["notifications"][0]["to"] == "1" assert resp["notifications"][0]["status"] == returned_notification.status assert response.status_code == 200 diff --git a/tests/app/test_commands.py b/tests/app/test_commands.py index 817f2e4bf..46dd2b0c1 100644 --- a/tests/app/test_commands.py +++ b/tests/app/test_commands.py @@ -428,23 +428,22 @@ def test_promote_user_to_platform_admin( assert user.platform_admin is True -def test_download_csv_file_by_name(notify_api, sample_platform_admin): - assert sample_platform_admin.platform_admin is True - - result = notify_api.test_cli_runner().invoke( +def test_download_csv_file_by_name(notify_api, mocker): + mock_download = mocker.patch("app.commands.s3.download_from_s3") + notify_api.test_cli_runner().invoke( download_csv_file_by_name, [ + "-f", "NonExistentName", ], ) - - # if we get a 404, it means that the file is not in s3 (of course) - # but we are making the call to s3, etc. so that part is working - assert "404" in str(result) + mock_download.assert_called_once() def test_promote_user_to_platform_admin_no_result_found( - notify_db_session, notify_api, sample_user + notify_db_session, + notify_api, + sample_user, ): assert sample_user.platform_admin is False From ac577eff625f0ac52fc90ca651af4c25bee354d4 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 11:05:37 -0700 Subject: [PATCH 28/56] Add items to the version upgrade checklist --- terraform/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index b3feb3e53..cb1605ae2 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -1,6 +1,6 @@ # Terraform - +illustration of space exploration This directory holds the Terraform modules for maintaining Notify.gov's API infrastructure. You might want to: * [Set up](#retrieving-existing-bucket-credentials) the Sandbox and develop Terraform, @@ -108,7 +108,11 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent ### Version upgrade checklist -* Cloud Foundry Terraform plugin in every module, [here for example](sandbox/providers.tf#L6) +* Cloud Foundry Terraform plugin in every module in the API and Admin apps, [here for example](sandbox/providers.tf#L6). +* The [terraform-cloudgov module](https://github.com/GSA-TTS/terraform-cloudgov/), the version of which is referred to serveral times in most modules, [here for example](sandbox/main.tf#16). +* Cloud Service Broker (CSB) version in [the SMS](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-sms.sh) and [the SMTP](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-smtp.sh) download scripts of the usnotify-ssb repo. +* SMS and SMTP brokerpak versions, also in the download scripts of the usnotify-ssb repo, along with with the [SMTP brokerpak project](https://github.com/GSA-TTS/datagov-brokerpak-smtp) itself. +* The version of Redis used in deployed environment modules, [here for example](sandbox/main.tf#33). To upgrade, the resource must be destroyed and replaced. The versions supported are limited by Cloud.gov. ## SpaceDeployers From 0fff92b0b084426f3eff28e7c0f8849dc5c39f78 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 11:07:51 -0700 Subject: [PATCH 29/56] Add Maintenance to the table of contents --- terraform/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/README.md b/terraform/README.md index cb1605ae2..e9ee0c37d 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -4,6 +4,7 @@ This directory holds the Terraform modules for maintaining Notify.gov's API infrastructure. You might want to: * [Set up](#retrieving-existing-bucket-credentials) the Sandbox and develop Terraform, +* [Maintain](#maintenance) software versions or CI/CD, * [Learn](#structure) about the directory structure, or * [Troubleshoot](#troubleshooting) error messages From 0f0e550e68c6b870371ecab90c05115b0aca21d9 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 11:17:32 -0700 Subject: [PATCH 30/56] Put SpaceDeployers section within Maintenance --- terraform/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index e9ee0c37d..90160066e 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -116,10 +116,10 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent * The version of Redis used in deployed environment modules, [here for example](sandbox/main.tf#33). To upgrade, the resource must be destroyed and replaced. The versions supported are limited by Cloud.gov. -## SpaceDeployers +### SpaceDeployers A [SpaceDeployer](https://cloud.gov/docs/services/cloud-gov-service-account/) account is required to run terraform or -deploy the application from the CI/CD pipeline. Create a new account by running: +deploy the application from the CI/CD pipeline. During CI/CD maintenance you might need to create a new account: `./create_service_account.sh -s -u ` From c8a7e6a5ff8921e0562ebe342e5651004c12f689 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 11:31:54 -0700 Subject: [PATCH 31/56] Add intro to the upgrade checklist, and tf version note --- terraform/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index 90160066e..c9cbf285f 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -109,12 +109,13 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent ### Version upgrade checklist +These version numbers are hardcoded in Terraform or shell scripts. We need to periodically check them for needed updates. Our [video introduction](https://drive.google.com/file/d/13SR3M8IowYBa4Wp_YEcuAURZ74EcCYoc/) also talks about some of these. * Cloud Foundry Terraform plugin in every module in the API and Admin apps, [here for example](sandbox/providers.tf#L6). * The [terraform-cloudgov module](https://github.com/GSA-TTS/terraform-cloudgov/), the version of which is referred to serveral times in most modules, [here for example](sandbox/main.tf#16). * Cloud Service Broker (CSB) version in [the SMS](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-sms.sh) and [the SMTP](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-smtp.sh) download scripts of the usnotify-ssb repo. -* SMS and SMTP brokerpak versions, also in the download scripts of the usnotify-ssb repo, along with with the [SMTP brokerpak project](https://github.com/GSA-TTS/datagov-brokerpak-smtp) itself. +* SMS and SMTP brokerpak versions, also in the download scripts of the usnotify-ssb repo. (And we may have to help maintain the [SMTP brokerpak project](https://github.com/GSA-TTS/datagov-brokerpak-smtp) itself.) * The version of Redis used in deployed environment modules, [here for example](sandbox/main.tf#33). To upgrade, the resource must be destroyed and replaced. The versions supported are limited by Cloud.gov. - +* A required minimum version of Terraform is noted in every providers.tf file, [here for example](sandbox/providers.tf#L2). It would be best to keep it in sync with the version used by our CI/CD deployment pipeline. But, it does not need to be updated with every new Terraform release. ### SpaceDeployers From d8153eb3ad805e35f4964ec723516876f7afe33e Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 11:36:02 -0700 Subject: [PATCH 32/56] Move the video link below the upgrade checklist --- terraform/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/terraform/README.md b/terraform/README.md index c9cbf285f..e9ffe4d13 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -109,7 +109,8 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent ### Version upgrade checklist -These version numbers are hardcoded in Terraform or shell scripts. We need to periodically check them for needed updates. Our [video introduction](https://drive.google.com/file/d/13SR3M8IowYBa4Wp_YEcuAURZ74EcCYoc/) also talks about some of these. +These version numbers are hardcoded in Terraform or shell scripts. We should periodically check them for upgrades. + * Cloud Foundry Terraform plugin in every module in the API and Admin apps, [here for example](sandbox/providers.tf#L6). * The [terraform-cloudgov module](https://github.com/GSA-TTS/terraform-cloudgov/), the version of which is referred to serveral times in most modules, [here for example](sandbox/main.tf#16). * Cloud Service Broker (CSB) version in [the SMS](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-sms.sh) and [the SMTP](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-smtp.sh) download scripts of the usnotify-ssb repo. @@ -117,6 +118,8 @@ These version numbers are hardcoded in Terraform or shell scripts. We need to pe * The version of Redis used in deployed environment modules, [here for example](sandbox/main.tf#33). To upgrade, the resource must be destroyed and replaced. The versions supported are limited by Cloud.gov. * A required minimum version of Terraform is noted in every providers.tf file, [here for example](sandbox/providers.tf#L2). It would be best to keep it in sync with the version used by our CI/CD deployment pipeline. But, it does not need to be updated with every new Terraform release. +:tv: Some of these version upgrades are discussed in our [video introduction](https://drive.google.com/file/d/13SR3M8IowYBa4Wp_YEcuAURZ74EcCYoc/). + ### SpaceDeployers A [SpaceDeployer](https://cloud.gov/docs/services/cloud-gov-service-account/) account is required to run terraform or From 56b7d025937b94235e68e774380aefe671b8e972 Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Thu, 1 Aug 2024 11:40:06 -0700 Subject: [PATCH 33/56] Fix link line numbers --- terraform/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/README.md b/terraform/README.md index e9ffe4d13..24e9a55f3 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -112,10 +112,10 @@ These steps assume shared [Terraform state credentials](#terraform-state-credent These version numbers are hardcoded in Terraform or shell scripts. We should periodically check them for upgrades. * Cloud Foundry Terraform plugin in every module in the API and Admin apps, [here for example](sandbox/providers.tf#L6). -* The [terraform-cloudgov module](https://github.com/GSA-TTS/terraform-cloudgov/), the version of which is referred to serveral times in most modules, [here for example](sandbox/main.tf#16). +* The [terraform-cloudgov module](https://github.com/GSA-TTS/terraform-cloudgov/), the version of which is referred to serveral times in most modules, [here for example](sandbox/main.tf#L16). * Cloud Service Broker (CSB) version in [the SMS](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-sms.sh) and [the SMTP](https://github.com/GSA/usnotify-ssb/blob/main/app-setup-smtp.sh) download scripts of the usnotify-ssb repo. * SMS and SMTP brokerpak versions, also in the download scripts of the usnotify-ssb repo. (And we may have to help maintain the [SMTP brokerpak project](https://github.com/GSA-TTS/datagov-brokerpak-smtp) itself.) -* The version of Redis used in deployed environment modules, [here for example](sandbox/main.tf#33). To upgrade, the resource must be destroyed and replaced. The versions supported are limited by Cloud.gov. +* The version of Redis used in deployed environment modules, [here for example](sandbox/main.tf#L33). To upgrade, the resource must be destroyed and replaced. The versions supported are limited by Cloud.gov. * A required minimum version of Terraform is noted in every providers.tf file, [here for example](sandbox/providers.tf#L2). It would be best to keep it in sync with the version used by our CI/CD deployment pipeline. But, it does not need to be updated with every new Terraform release. :tv: Some of these version upgrades are discussed in our [video introduction](https://drive.google.com/file/d/13SR3M8IowYBa4Wp_YEcuAURZ74EcCYoc/). From e7ef25af010b80470c4f93a4d18017ebcd873d80 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 13:00:49 -0700 Subject: [PATCH 34/56] fix dump user info --- app/commands.py | 5 ++++- tests/app/delivery/test_send_to_providers.py | 14 ++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/commands.py b/app/commands.py index c2a2d70e7..2e21c0518 100644 --- a/app/commands.py +++ b/app/commands.py @@ -664,7 +664,10 @@ def populate_annual_billing_with_the_previous_years_allowance(year): def dump_user_info(user_email_address): user = get_user_by_email(user_email_address) content = user.serialize() - click.echo(content) + with open("user_download.json", "wb") as f: + f.write(json.dumps(content).encode("utf8")) + f.close() + print("Successfully downloaded user info to user_download.json") @notify_command(name="populate-annual-billing-with-defaults") diff --git a/tests/app/delivery/test_send_to_providers.py b/tests/app/delivery/test_send_to_providers.py index 7f16a799a..63ab31ec7 100644 --- a/tests/app/delivery/test_send_to_providers.py +++ b/tests/app/delivery/test_send_to_providers.py @@ -330,7 +330,7 @@ def test_should_send_sms_with_downgraded_content(notify_db_session, mocker): template=template, ) db_notification.personalisation = {"misc": placeholder} - db_notification.reply_to_text = 'testing' + db_notification.reply_to_text = "testing" mocker.patch("app.aws_sns_client.send_sms") @@ -622,7 +622,7 @@ def test_should_update_billable_units_and_status_according_to_research_mode_and_ billable_units=0, status=NotificationStatus.CREATED, key_type=key_type, - reply_to_text='testing', + reply_to_text="testing", ) mocker.patch("app.aws_sns_client.send_sms") mocker.patch( @@ -786,7 +786,10 @@ def test_send_sms_to_provider_should_use_normalised_to(mocker, client, sample_te ) send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+12028675309", normalised_to="2028675309", reply_to_text='testing' + template=sample_template, + to_field="+12028675309", + normalised_to="2028675309", + reply_to_text="testing", ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3") @@ -862,7 +865,10 @@ def test_send_sms_to_provider_should_return_template_if_found_in_redis( send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+447700900855", normalised_to="447700900855", reply_to_text='testing' + template=sample_template, + to_field="+447700900855", + normalised_to="447700900855", + reply_to_text="testing", ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3") From 0eb347354b43cb21941a57b2faaef8bb6a583b62 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 14:36:59 -0700 Subject: [PATCH 35/56] fix stack trace --- notifications_utils/request_helper.py | 28 ++++++++++++-------- tests/app/delivery/test_send_to_providers.py | 14 +++++++--- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index 6c9edc8a7..35f51f42c 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -62,22 +62,28 @@ def __init__(self, app): self._app = app def __call__(self, environ, start_response): - req = NotifyRequest(environ) + try: + req = NotifyRequest(environ) - def rewrite_response_headers(status, headers, exc_info=None): - lower_existing_header_names = frozenset( - name.lower() for name, value in headers - ) + def rewrite_response_headers(status, headers, exc_info=None): + lower_existing_header_names = frozenset( + name.lower() for name, value in headers + ) - if TRACE_ID_HEADER.lower() not in lower_existing_header_names: - headers.append((TRACE_ID_HEADER, str(req.trace_id))) + if TRACE_ID_HEADER.lower() not in lower_existing_header_names: + headers.append((TRACE_ID_HEADER, str(req.trace_id))) - if SPAN_ID_HEADER.lower() not in lower_existing_header_names: - headers.append((SPAN_ID_HEADER, str(req.span_id))) + if SPAN_ID_HEADER.lower() not in lower_existing_header_names: + headers.append((SPAN_ID_HEADER, str(req.span_id))) - return start_response(status, headers, exc_info) + return start_response(status, headers, exc_info) - return self._app(environ, rewrite_response_headers) + return self._app(environ, rewrite_response_headers) + except BaseException as be: # noqa + if "AuthError" in str(be): + current_app.logger.error(be) + else: + raise be def init_app(app): diff --git a/tests/app/delivery/test_send_to_providers.py b/tests/app/delivery/test_send_to_providers.py index 7f16a799a..63ab31ec7 100644 --- a/tests/app/delivery/test_send_to_providers.py +++ b/tests/app/delivery/test_send_to_providers.py @@ -330,7 +330,7 @@ def test_should_send_sms_with_downgraded_content(notify_db_session, mocker): template=template, ) db_notification.personalisation = {"misc": placeholder} - db_notification.reply_to_text = 'testing' + db_notification.reply_to_text = "testing" mocker.patch("app.aws_sns_client.send_sms") @@ -622,7 +622,7 @@ def test_should_update_billable_units_and_status_according_to_research_mode_and_ billable_units=0, status=NotificationStatus.CREATED, key_type=key_type, - reply_to_text='testing', + reply_to_text="testing", ) mocker.patch("app.aws_sns_client.send_sms") mocker.patch( @@ -786,7 +786,10 @@ def test_send_sms_to_provider_should_use_normalised_to(mocker, client, sample_te ) send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+12028675309", normalised_to="2028675309", reply_to_text='testing' + template=sample_template, + to_field="+12028675309", + normalised_to="2028675309", + reply_to_text="testing", ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3") @@ -862,7 +865,10 @@ def test_send_sms_to_provider_should_return_template_if_found_in_redis( send_mock = mocker.patch("app.aws_sns_client.send_sms") notification = create_notification( - template=sample_template, to_field="+447700900855", normalised_to="447700900855", reply_to_text='testing' + template=sample_template, + to_field="+447700900855", + normalised_to="447700900855", + reply_to_text="testing", ) mock_s3 = mocker.patch("app.delivery.send_to_providers.get_phone_number_from_s3") From dd05268cdbd95facf6b4622b75a64c9c1162371f Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 2 Aug 2024 08:06:06 -0700 Subject: [PATCH 36/56] fix notify-api-1394 as well --- notifications_utils/request_helper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index 35f51f42c..6d570fe06 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -82,6 +82,8 @@ def rewrite_response_headers(status, headers, exc_info=None): except BaseException as be: # noqa if "AuthError" in str(be): current_app.logger.error(be) + elif "AttributeError" in str(be): + current_app.logger.error(be) else: raise be From a3ddb35fe76252fd95dc8754a1e10b72c8a1d3fb Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 2 Aug 2024 08:06:41 -0700 Subject: [PATCH 37/56] comments --- notifications_utils/request_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index 6d570fe06..9ac35dfcf 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -80,9 +80,9 @@ def rewrite_response_headers(status, headers, exc_info=None): return self._app(environ, rewrite_response_headers) except BaseException as be: # noqa - if "AuthError" in str(be): + if "AuthError" in str(be): #notify-api-1135 current_app.logger.error(be) - elif "AttributeError" in str(be): + elif "AttributeError" in str(be): #notify-api-1394 current_app.logger.error(be) else: raise be From 2917c73be7ec735a4cbbd0693a6fab2949289abd Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 2 Aug 2024 08:33:45 -0700 Subject: [PATCH 38/56] fix flake 8 --- notifications_utils/request_helper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index 9ac35dfcf..eb7a2061f 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -80,9 +80,9 @@ def rewrite_response_headers(status, headers, exc_info=None): return self._app(environ, rewrite_response_headers) except BaseException as be: # noqa - if "AuthError" in str(be): #notify-api-1135 + if "AuthError" in str(be): # notify-api-1135 current_app.logger.error(be) - elif "AttributeError" in str(be): #notify-api-1394 + elif "AttributeError" in str(be): # notify-api-1394 current_app.logger.error(be) else: raise be From 0dbb5dbcc1fcacbd539121dbe1982547319346a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:33:46 +0000 Subject: [PATCH 39/56] Bump botocore from 1.34.150 to 1.34.154 Bumps [botocore](https://github.com/boto/botocore) from 1.34.150 to 1.34.154. - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.150...1.34.154) --- updated-dependencies: - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 22 +++++++++++++--------- pyproject.toml | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/poetry.lock b/poetry.lock index 33d0907b2..6d4bd20c0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -204,17 +204,17 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "awscli" -version = "1.33.32" +version = "1.33.36" description = "Universal Command Line Environment for AWS." optional = false python-versions = ">=3.8" files = [ - {file = "awscli-1.33.32-py3-none-any.whl", hash = "sha256:94e0e348b4e98d949d01f3c9bba817ef9c0da4aabea53a5d966445618339c7dd"}, - {file = "awscli-1.33.32.tar.gz", hash = "sha256:90137622dcd7695939d64f57172901376d8ca5eb995c12e5fce50f55316c5b62"}, + {file = "awscli-1.33.36-py3-none-any.whl", hash = "sha256:b4d79946aff15f83a653d41573610c55a2f2311f7387e409074dea1d2f432037"}, + {file = "awscli-1.33.36.tar.gz", hash = "sha256:52de9dd8fb3600d8d99db7ce400d058413ce69634a476582af8e2301936f0af7"}, ] [package.dependencies] -botocore = "1.34.150" +botocore = "1.34.154" colorama = ">=0.2.5,<0.4.7" docutils = ">=0.10,<0.17" PyYAML = ">=3.10,<6.1" @@ -422,13 +422,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.150" +version = "1.34.154" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.34.150-py3-none-any.whl", hash = "sha256:b988d47f4d502df85befce11a48002421e4e6ea4289997b5e0261bac5fa76ce6"}, - {file = "botocore-1.34.150.tar.gz", hash = "sha256:4d23387e0f076d87b637a2a35c0ff2b8daca16eace36b63ce27f65630c6b375a"}, + {file = "botocore-1.34.154-py3-none-any.whl", hash = "sha256:4eef4b1bb809b382ba9dc9c88f5fcc4a133f221a1acb693ee6bee4de9f325979"}, + {file = "botocore-1.34.154.tar.gz", hash = "sha256:64d9b4c85a504d77cb56dabb2ad717cd8e1717424a88edb458b01d1e5797262a"}, ] [package.dependencies] @@ -2093,9 +2093,13 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2484,7 +2488,6 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3467,6 +3470,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -4739,4 +4743,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "4ef9a352a137fe091b1084b06959b9b674c30635771abc23010d2ba560f6bfd6" +content-hash = "3ef243b66ad1952b29dafb605b31f18ec5512073565c9241b05a06c47df279e0" diff --git a/pyproject.toml b/pyproject.toml index 3bfff266b..9261ae6d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ alembic = "==1.13.2" amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" boto3 = "^1.34.150" -botocore = "^1.34.150" +botocore = "^1.34.154" cachetools = "==5.4.0" celery = {version = "==5.4.0", extras = ["redis"]} certifi = ">=2022.12.7" From f50374608391928eea7e0e5304254c8da7eeab88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:33:48 +0000 Subject: [PATCH 40/56] Bump redis from 5.0.7 to 5.0.8 Bumps [redis](https://github.com/redis/redis-py) from 5.0.7 to 5.0.8. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v5.0.7...v5.0.8) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6d4bd20c0..fdaac364f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3630,17 +3630,17 @@ full = ["numpy"] [[package]] name = "redis" -version = "5.0.7" +version = "5.0.8" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.7" files = [ - {file = "redis-5.0.7-py3-none-any.whl", hash = "sha256:0e479e24da960c690be5d9b96d21f7b918a98c0cf49af3b6fafaa0753f93a0db"}, - {file = "redis-5.0.7.tar.gz", hash = "sha256:8f611490b93c8109b50adc317b31bfd84fff31def3475b92e7e80bf39f48175b"}, + {file = "redis-5.0.8-py3-none-any.whl", hash = "sha256:56134ee08ea909106090934adc36f65c9bcbbaecea5b21ba704ba6fb561f8eb4"}, + {file = "redis-5.0.8.tar.gz", hash = "sha256:0c5b10d387568dfe0698c6fad6615750c24170e548ca2deac10c649d463e9870"}, ] [package.extras] -hiredis = ["hiredis (>=1.0.0)"] +hiredis = ["hiredis (>1.0.0)"] ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] [[package]] @@ -4743,4 +4743,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "3ef243b66ad1952b29dafb605b31f18ec5512073565c9241b05a06c47df279e0" +content-hash = "8c2b194b00fa7c91ae6f1c3c62343e2643fc82598ca2c165e62cf9f8e77539d6" diff --git a/pyproject.toml b/pyproject.toml index 9261ae6d9..a1323a4f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ urllib3 = "^2.2.2" webencodings = "^0.5.1" itsdangerous = "^2.2.0" jinja2 = "^3.1.4" -redis = "^5.0.7" +redis = "^5.0.8" requests = "^2.32.3" From cf4c7722c0c7a7a920d3f6019497f9a6662bfb48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:45:03 +0000 Subject: [PATCH 41/56] Bump phonenumbers from 8.13.40 to 8.13.42 Bumps [phonenumbers](https://github.com/daviddrysdale/python-phonenumbers) from 8.13.40 to 8.13.42. - [Commits](https://github.com/daviddrysdale/python-phonenumbers/compare/v8.13.40...v8.13.42) --- updated-dependencies: - dependency-name: phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index fdaac364f..b5108c604 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2821,13 +2821,13 @@ ptyprocess = ">=0.5" [[package]] name = "phonenumbers" -version = "8.13.40" +version = "8.13.42" description = "Python version of Google's common library for parsing, formatting, storing and validating international phone numbers." optional = false python-versions = "*" files = [ - {file = "phonenumbers-8.13.40-py2.py3-none-any.whl", hash = "sha256:9582752c20a1da5ec4449f7f97542bf8a793c8e2fec0ab57f767177bb8fc0b1d"}, - {file = "phonenumbers-8.13.40.tar.gz", hash = "sha256:f137c2848b8e83dd064b71881b65680584417efa202177fd330e2f7ff6c68113"}, + {file = "phonenumbers-8.13.42-py2.py3-none-any.whl", hash = "sha256:18acc22ee03116d27b26e990f53806a1770a3e05f05e1620bc09ad187f889456"}, + {file = "phonenumbers-8.13.42.tar.gz", hash = "sha256:7137904f2db3b991701e853174ce8e1cb8f540b8bfdf27617540de04c0b7bed5"}, ] [[package]] @@ -4743,4 +4743,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "8c2b194b00fa7c91ae6f1c3c62343e2643fc82598ca2c165e62cf9f8e77539d6" +content-hash = "89b99841ebd4bd735104048c8f8f0a35bfedb700a7a5648ecabe713816e25579" diff --git a/pyproject.toml b/pyproject.toml index a1323a4f0..9f9b39ce7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ geojson = "^3.1.0" govuk-bank-holidays = "^0.14" numpy = "^1.26.4" ordered-set = "^4.1.0" -phonenumbers = "^8.13.40" +phonenumbers = "^8.13.42" python-json-logger = "^2.0.7" pytz = "^2024.1" regex = "^2024.7.24" From 304b270112415e8cdbd3baf6f7c107a6d6487cf7 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 6 Aug 2024 12:57:40 -0700 Subject: [PATCH 42/56] fix data format --- app/user/rest.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/user/rest.py b/app/user/rest.py index 52335dce1..cde968065 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -629,7 +629,18 @@ def get_all_users(): @user_blueprint.route("/report-all-users", methods=["GET"]) def report_all_users(): users = dao_report_users() - return jsonify(data=users.serialize()), 200 + download_users = [] + for user in users: + new_user = { + "name": user[0], + "email_address": user[1], + "mobile_number": user[2], + "service": user[3], + } + download_users.append(new_user) + print(f"download_users {download_users}") + dump = json.dumps(download_users) + return jsonify(data=dump), 200 @user_blueprint.route("//organizations-and-services", methods=["GET"]) From 3de8a27a1a62dcd4d4cf6831e189f31307237462 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 6 Aug 2024 13:05:31 -0700 Subject: [PATCH 43/56] add test --- tests/app/user/test_rest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/app/user/test_rest.py b/tests/app/user/test_rest.py index 07dcc3570..f8482e446 100644 --- a/tests/app/user/test_rest.py +++ b/tests/app/user/test_rest.py @@ -1125,3 +1125,17 @@ def test_complete_login_after_webauthn_authentication_attempt_raises_400_if_sche _data={"successful": "True"}, _expected_status=400, ) + + +def test_report_all_users(admin_request, mocker): + mocker.patch( + "app.user.rest.dao_report_users", + return_value=[("name", "email", "phone", "service")], + ) + response = admin_request.get( + "user.report_all_users", + _expected_status=200, + ) + assert response == { + "data": '[{"name": "name", "email_address": "email", "mobile_number": "phone", "service": "service"}]' + } From 38b49da0d3400f0a23e04f735b97fe9625fb4a49 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 7 Aug 2024 12:41:35 -0700 Subject: [PATCH 44/56] add MethodNotAllowed --- notifications_utils/request_helper.py | 2 ++ poetry.lock | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index eb7a2061f..93590fdaa 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -84,6 +84,8 @@ def rewrite_response_headers(status, headers, exc_info=None): current_app.logger.error(be) elif "AttributeError" in str(be): # notify-api-1394 current_app.logger.error(be) + elif "MethodNotAllowed" in str(be): # notify-admin-1392 + current_app.logger.error(be) else: raise be diff --git a/poetry.lock b/poetry.lock index b5108c604..cc661a9a1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2093,13 +2093,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2488,6 +2484,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3470,7 +3467,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 37ba16d019353bd9a12d564e2413d8c154316317 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 7 Aug 2024 13:15:36 -0700 Subject: [PATCH 45/56] fix format --- notifications_utils/request_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index 93590fdaa..1dd9a9ae1 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -84,7 +84,7 @@ def rewrite_response_headers(status, headers, exc_info=None): current_app.logger.error(be) elif "AttributeError" in str(be): # notify-api-1394 current_app.logger.error(be) - elif "MethodNotAllowed" in str(be): # notify-admin-1392 + elif "MethodNotAllowed" in str(be): # notify-admin-1392 current_app.logger.error(be) else: raise be From 034684bbb0b357bfc65765e698ea7204e84ca502 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 8 Aug 2024 10:57:37 -0700 Subject: [PATCH 46/56] code review feedback --- app/user/rest.py | 5 ++--- tests/app/user/test_rest.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/user/rest.py b/app/user/rest.py index cde968065..faaca4664 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -638,9 +638,8 @@ def report_all_users(): "service": user[3], } download_users.append(new_user) - print(f"download_users {download_users}") - dump = json.dumps(download_users) - return jsonify(data=dump), 200 + + return jsonify(data=download_users, status=200, mime_type="application/json"), 200 @user_blueprint.route("//organizations-and-services", methods=["GET"]) diff --git a/tests/app/user/test_rest.py b/tests/app/user/test_rest.py index f8482e446..4e064ca8e 100644 --- a/tests/app/user/test_rest.py +++ b/tests/app/user/test_rest.py @@ -1137,5 +1137,14 @@ def test_report_all_users(admin_request, mocker): _expected_status=200, ) assert response == { - "data": '[{"name": "name", "email_address": "email", "mobile_number": "phone", "service": "service"}]' + "data": [ + { + "name": "name", + "email_address": "email", + "mobile_number": "phone", + "service": "service", + } + ], + "mime_type": "application/json", + "status": 200, } From 06e1157d85d81e4cd7bb576a005fd0d9523d4972 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:07:30 +0000 Subject: [PATCH 47/56] Bump pyyaml from 6.0.1 to 6.0.2 Bumps [pyyaml](https://github.com/yaml/pyyaml) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/6.0.2/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/6.0.1...6.0.2) --- updated-dependencies: - dependency-name: pyyaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 114 ++++++++++++++++++++++++++----------------------- pyproject.toml | 2 +- 2 files changed, 61 insertions(+), 55 deletions(-) diff --git a/poetry.lock b/poetry.lock index cc661a9a1..2c46e73c4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2093,9 +2093,13 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2484,7 +2488,6 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3444,61 +3447,64 @@ files = [ [[package]] name = "pyyaml" -version = "6.0.1" +version = "6.0.2" description = "YAML parser and emitter for Python" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "PyYAML-6.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a"}, - {file = "PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fd66fc5d0da6d9815ba2cebeb4205f95818ff4b79c3ebe268e75d961704af52f"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"}, - {file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"}, - {file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"}, - {file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"}, - {file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"}, - {file = "PyYAML-6.0.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"}, - {file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"}, - {file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"}, - {file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"}, - {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, - {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, - {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, - {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, - {file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"}, - {file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"}, - {file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win32.whl", hash = "sha256:fca0e3a251908a499833aa292323f32437106001d436eca0e6e7833256674585"}, - {file = "PyYAML-6.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa"}, - {file = "PyYAML-6.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3"}, - {file = "PyYAML-6.0.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:baa90d3f661d43131ca170712d903e6295d1f7a0f595074f151c0aed377c9b9c"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win32.whl", hash = "sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba"}, - {file = "PyYAML-6.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867"}, - {file = "PyYAML-6.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1d4c7e777c441b20e32f52bd377e0c409713e8bb1386e1099c2415f26e479595"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"}, - {file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"}, - {file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"}, - {file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"}, - {file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"}, - {file = "PyYAML-6.0.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"}, - {file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"}, - {file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"}, - {file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"}, - {file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"}, - {file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a9a2848a5b7feac301353437eb7d5957887edbf81d56e903999a75a3d743086"}, + {file = "PyYAML-6.0.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:29717114e51c84ddfba879543fb232a6ed60086602313ca38cce623c1d62cfbf"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8824b5a04a04a047e72eea5cec3bc266db09e35de6bdfe34c9436ac5ee27d237"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c36280e6fb8385e520936c3cb3b8042851904eba0e58d277dca80a5cfed590b"}, + {file = "PyYAML-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec031d5d2feb36d1d1a24380e4db6d43695f3748343d99434e6f5f9156aaa2ed"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:936d68689298c36b53b29f23c6dbb74de12b4ac12ca6cfe0e047bedceea56180"}, + {file = "PyYAML-6.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:23502f431948090f597378482b4812b0caae32c22213aecf3b55325e049a6c68"}, + {file = "PyYAML-6.0.2-cp310-cp310-win32.whl", hash = "sha256:2e99c6826ffa974fe6e27cdb5ed0021786b03fc98e5ee3c5bfe1fd5015f42b99"}, + {file = "PyYAML-6.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:a4d3091415f010369ae4ed1fc6b79def9416358877534caf6a0fdd2146c87a3e"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cc1c1159b3d456576af7a3e4d1ba7e6924cb39de8f67111c735f6fc832082774"}, + {file = "PyYAML-6.0.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1e2120ef853f59c7419231f3bf4e7021f1b936f6ebd222406c3b60212205d2ee"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d225db5a45f21e78dd9358e58a98702a0302f2659a3c6cd320564b75b86f47c"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5ac9328ec4831237bec75defaf839f7d4564be1e6b25ac710bd1a96321cc8317"}, + {file = "PyYAML-6.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ad2a3decf9aaba3d29c8f537ac4b243e36bef957511b4766cb0057d32b0be85"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ff3824dc5261f50c9b0dfb3be22b4567a6f938ccce4587b38952d85fd9e9afe4"}, + {file = "PyYAML-6.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:797b4f722ffa07cc8d62053e4cff1486fa6dc094105d13fea7b1de7d8bf71c9e"}, + {file = "PyYAML-6.0.2-cp311-cp311-win32.whl", hash = "sha256:11d8f3dd2b9c1207dcaf2ee0bbbfd5991f571186ec9cc78427ba5bd32afae4b5"}, + {file = "PyYAML-6.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:e10ce637b18caea04431ce14fabcf5c64a1c61ec9c56b071a4b7ca131ca52d44"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:c70c95198c015b85feafc136515252a261a84561b7b1d51e3384e0655ddf25ab"}, + {file = "PyYAML-6.0.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ce826d6ef20b1bc864f0a68340c8b3287705cae2f8b4b1d932177dcc76721725"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f71ea527786de97d1a0cc0eacd1defc0985dcf6b3f17bb77dcfc8c34bec4dc5"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9b22676e8097e9e22e36d6b7bda33190d0d400f345f23d4065d48f4ca7ae0425"}, + {file = "PyYAML-6.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80bab7bfc629882493af4aa31a4cfa43a4c57c83813253626916b8c7ada83476"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:0833f8694549e586547b576dcfaba4a6b55b9e96098b36cdc7ebefe667dfed48"}, + {file = "PyYAML-6.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8b9c7197f7cb2738065c481a0461e50ad02f18c78cd75775628afb4d7137fb3b"}, + {file = "PyYAML-6.0.2-cp312-cp312-win32.whl", hash = "sha256:ef6107725bd54b262d6dedcc2af448a266975032bc85ef0172c5f059da6325b4"}, + {file = "PyYAML-6.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:7e7401d0de89a9a855c839bc697c079a4af81cf878373abd7dc625847d25cbd8"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba"}, + {file = "PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484"}, + {file = "PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc"}, + {file = "PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652"}, + {file = "PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183"}, + {file = "PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563"}, + {file = "PyYAML-6.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:24471b829b3bf607e04e88d79542a9d48bb037c2267d7927a874e6c205ca7e9a"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7fded462629cfa4b685c5416b949ebad6cec74af5e2d42905d41e257e0869f5"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d84a1718ee396f54f3a086ea0a66d8e552b2ab2017ef8b420e92edbc841c352d"}, + {file = "PyYAML-6.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9056c1ecd25795207ad294bcf39f2db3d845767be0ea6e6a34d856f006006083"}, + {file = "PyYAML-6.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:82d09873e40955485746739bcb8b4586983670466c23382c19cffecbf1fd8706"}, + {file = "PyYAML-6.0.2-cp38-cp38-win32.whl", hash = "sha256:43fa96a3ca0d6b1812e01ced1044a003533c47f6ee8aca31724f78e93ccc089a"}, + {file = "PyYAML-6.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:01179a4a8559ab5de078078f37e5c1a30d76bb88519906844fd7bdea1b7729ff"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:688ba32a1cffef67fd2e9398a2efebaea461578b0923624778664cc1c914db5d"}, + {file = "PyYAML-6.0.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a8786accb172bd8afb8be14490a16625cbc387036876ab6ba70912730faf8e1f"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8e03406cac8513435335dbab54c0d385e4a49e4945d2909a581c83647ca0290"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f753120cb8181e736c57ef7636e83f31b9c0d1722c516f7e86cf15b7aa57ff12"}, + {file = "PyYAML-6.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b1fdb9dc17f5a7677423d508ab4f243a726dea51fa5e70992e59a7411c89d19"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0b69e4ce7a131fe56b7e4d770c67429700908fc0752af059838b1cfb41960e4e"}, + {file = "PyYAML-6.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a9f8c2e67970f13b16084e04f134610fd1d374bf477b17ec1599185cf611d725"}, + {file = "PyYAML-6.0.2-cp39-cp39-win32.whl", hash = "sha256:6395c297d42274772abc367baaa79683958044e5d3835486c16da75d2a694631"}, + {file = "PyYAML-6.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:39693e1f8320ae4f43943590b49779ffb98acb81f788220ea932a6b6c51004d8"}, + {file = "pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e"}, ] [[package]] @@ -4739,4 +4745,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "89b99841ebd4bd735104048c8f8f0a35bfedb700a7a5648ecabe713816e25579" +content-hash = "e8579f4f013b85d2683cd08737865e8a3db6eb32f7ad54468562b01a073a9310" diff --git a/pyproject.toml b/pyproject.toml index 9f9b39ce7..5c08237f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,7 @@ jmespath = "^1.0.1" markupsafe = "^2.1.5" pycparser = "^2.22" python-dateutil = "^2.9.0.post0" -pyyaml = "^6.0.1" +pyyaml = "^6.0.2" s3transfer = "^0.10.2" six = "^1.16.0" urllib3 = "^2.2.2" From 3c251c401666f24dcab38ca2fcf5fc163c224cdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:21:31 +0000 Subject: [PATCH 48/56] Bump black from 24.4.2 to 24.8.0 Bumps [black](https://github.com/psf/black) from 24.4.2 to 24.8.0. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/24.4.2...24.8.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 48 ++++++++++++++++++++++++------------------------ pyproject.toml | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/poetry.lock b/poetry.lock index 2c46e73c4..f7f337f51 100644 --- a/poetry.lock +++ b/poetry.lock @@ -319,33 +319,33 @@ files = [ [[package]] name = "black" -version = "24.4.2" +version = "24.8.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" files = [ - {file = "black-24.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dd1b5a14e417189db4c7b64a6540f31730713d173f0b63e55fabd52d61d8fdce"}, - {file = "black-24.4.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8e537d281831ad0e71007dcdcbe50a71470b978c453fa41ce77186bbe0ed6021"}, - {file = "black-24.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaea3008c281f1038edb473c1aa8ed8143a5535ff18f978a318f10302b254063"}, - {file = "black-24.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:7768a0dbf16a39aa5e9a3ded568bb545c8c2727396d063bbaf847df05b08cd96"}, - {file = "black-24.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:257d724c2c9b1660f353b36c802ccece186a30accc7742c176d29c146df6e474"}, - {file = "black-24.4.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:bdde6f877a18f24844e381d45e9947a49e97933573ac9d4345399be37621e26c"}, - {file = "black-24.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e151054aa00bad1f4e1f04919542885f89f5f7d086b8a59e5000e6c616896ffb"}, - {file = "black-24.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:7e122b1c4fb252fd85df3ca93578732b4749d9be076593076ef4d07a0233c3e1"}, - {file = "black-24.4.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:accf49e151c8ed2c0cdc528691838afd217c50412534e876a19270fea1e28e2d"}, - {file = "black-24.4.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:88c57dc656038f1ab9f92b3eb5335ee9b021412feaa46330d5eba4e51fe49b04"}, - {file = "black-24.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be8bef99eb46d5021bf053114442914baeb3649a89dc5f3a555c88737e5e98fc"}, - {file = "black-24.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:415e686e87dbbe6f4cd5ef0fbf764af7b89f9057b97c908742b6008cc554b9c0"}, - {file = "black-24.4.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bf10f7310db693bb62692609b397e8d67257c55f949abde4c67f9cc574492cc7"}, - {file = "black-24.4.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:98e123f1d5cfd42f886624d84464f7756f60ff6eab89ae845210631714f6db94"}, - {file = "black-24.4.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48a85f2cb5e6799a9ef05347b476cce6c182d6c71ee36925a6c194d074336ef8"}, - {file = "black-24.4.2-cp38-cp38-win_amd64.whl", hash = "sha256:b1530ae42e9d6d5b670a34db49a94115a64596bc77710b1d05e9801e62ca0a7c"}, - {file = "black-24.4.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:37aae07b029fa0174d39daf02748b379399b909652a806e5708199bd93899da1"}, - {file = "black-24.4.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:da33a1a5e49c4122ccdfd56cd021ff1ebc4a1ec4e2d01594fef9b6f267a9e741"}, - {file = "black-24.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef703f83fc32e131e9bcc0a5094cfe85599e7109f896fe8bc96cc402f3eb4b6e"}, - {file = "black-24.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:b9176b9832e84308818a99a561e90aa479e73c523b3f77afd07913380ae2eab7"}, - {file = "black-24.4.2-py3-none-any.whl", hash = "sha256:d36ed1124bb81b32f8614555b34cc4259c3fbc7eec17870e8ff8ded335b58d8c"}, - {file = "black-24.4.2.tar.gz", hash = "sha256:c872b53057f000085da66a19c55d68f6f8ddcac2642392ad3a355878406fbd4d"}, + {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, + {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, + {file = "black-24.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42"}, + {file = "black-24.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a"}, + {file = "black-24.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1"}, + {file = "black-24.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af"}, + {file = "black-24.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4"}, + {file = "black-24.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af"}, + {file = "black-24.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368"}, + {file = "black-24.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed"}, + {file = "black-24.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018"}, + {file = "black-24.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2"}, + {file = "black-24.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd"}, + {file = "black-24.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2"}, + {file = "black-24.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e"}, + {file = "black-24.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920"}, + {file = "black-24.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c"}, + {file = "black-24.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e"}, + {file = "black-24.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47"}, + {file = "black-24.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb"}, + {file = "black-24.8.0-py3-none-any.whl", hash = "sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed"}, + {file = "black-24.8.0.tar.gz", hash = "sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f"}, ] [package.dependencies] @@ -4745,4 +4745,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "e8579f4f013b85d2683cd08737865e8a3db6eb32f7ad54468562b01a073a9310" +content-hash = "77251d748c2566185209a8719a1c07286c03150d9f6cab9e67960912169ca59a" diff --git a/pyproject.toml b/pyproject.toml index 5c08237f1..01a182070 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -83,7 +83,7 @@ requests = "^2.32.3" [tool.poetry.group.dev.dependencies] awscli = "^1.33.32" bandit = "*" -black = "^24.3.0" +black = "^24.8.0" cloudfoundry-client = "*" exceptiongroup = "==1.2.2" flake8 = "^7.1.0" From 1234c459346f71d95c97d7881903160f24712b7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 19:37:56 +0000 Subject: [PATCH 49/56] Bump botocore from 1.34.154 to 1.34.159 Bumps [botocore](https://github.com/boto/botocore) from 1.34.154 to 1.34.159. - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.154...1.34.159) --- updated-dependencies: - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 18 +++++++++--------- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/poetry.lock b/poetry.lock index f7f337f51..7842eb263 100644 --- a/poetry.lock +++ b/poetry.lock @@ -204,17 +204,17 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "awscli" -version = "1.33.36" +version = "1.33.41" description = "Universal Command Line Environment for AWS." optional = false python-versions = ">=3.8" files = [ - {file = "awscli-1.33.36-py3-none-any.whl", hash = "sha256:b4d79946aff15f83a653d41573610c55a2f2311f7387e409074dea1d2f432037"}, - {file = "awscli-1.33.36.tar.gz", hash = "sha256:52de9dd8fb3600d8d99db7ce400d058413ce69634a476582af8e2301936f0af7"}, + {file = "awscli-1.33.41-py3-none-any.whl", hash = "sha256:882845efba962293375a1392cfe87e3a0e900693154b825bc2d698336ee8e1cd"}, + {file = "awscli-1.33.41.tar.gz", hash = "sha256:1968ce38e5c60fdbe9cf39c5b7fcd73dd75fc3c6d3c1068490004a88cc13f988"}, ] [package.dependencies] -botocore = "1.34.154" +botocore = "1.34.159" colorama = ">=0.2.5,<0.4.7" docutils = ">=0.10,<0.17" PyYAML = ">=3.10,<6.1" @@ -422,13 +422,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.154" +version = "1.34.159" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.34.154-py3-none-any.whl", hash = "sha256:4eef4b1bb809b382ba9dc9c88f5fcc4a133f221a1acb693ee6bee4de9f325979"}, - {file = "botocore-1.34.154.tar.gz", hash = "sha256:64d9b4c85a504d77cb56dabb2ad717cd8e1717424a88edb458b01d1e5797262a"}, + {file = "botocore-1.34.159-py3-none-any.whl", hash = "sha256:7633062491457419a49f5860c014251ae85689f78266a3ce020c2c8688a76b97"}, + {file = "botocore-1.34.159.tar.gz", hash = "sha256:dc28806eb21e3c8d690c422530dff8b4b242ac033cbe98f160a9d37796c09cb1"}, ] [package.dependencies] @@ -437,7 +437,7 @@ python-dateutil = ">=2.1,<3.0.0" urllib3 = {version = ">=1.25.4,<2.2.0 || >2.2.0,<3", markers = "python_version >= \"3.10\""} [package.extras] -crt = ["awscrt (==0.20.11)"] +crt = ["awscrt (==0.21.2)"] [[package]] name = "build" @@ -4745,4 +4745,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "77251d748c2566185209a8719a1c07286c03150d9f6cab9e67960912169ca59a" +content-hash = "41efbf6c8903708285130ce79dad6b5f8361e98357d8883495d3c647ec0f4146" diff --git a/pyproject.toml b/pyproject.toml index 01a182070..bee953dfb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ alembic = "==1.13.2" amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" boto3 = "^1.34.150" -botocore = "^1.34.154" +botocore = "^1.34.159" cachetools = "==5.4.0" celery = {version = "==5.4.0", extras = ["redis"]} certifi = ">=2022.12.7" From 8a01275adad9a476348fba0c81e13c5093fb0418 Mon Sep 17 00:00:00 2001 From: ecayer <3640935+ecayer@users.noreply.github.com> Date: Tue, 13 Aug 2024 14:44:20 -0700 Subject: [PATCH 50/56] Update all.md Updated phone number list. --- docs/all.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/all.md b/docs/all.md index 8ea57a932..fa3f6de03 100644 --- a/docs/all.md +++ b/docs/all.md @@ -1264,9 +1264,13 @@ Once you have a number, it must be set in the app in one of two ways: * +18447891134 - Montgomery County / Ride On * +18888402596 - Norfolk / DHS * +18555317292 - Washington State / DHS -* +18889046435 +* +18889046435 - State Department / Consular Affairs * +18447342791 * +18447525067 +* +18336917230 +* +18335951552 +* +18333792033 +* +18338010522 For a full list of phone numbers in trial and production, team members can access a [tracking list here](https://docs.google.com/spreadsheets/d/1lq3Wi_up7EkcKvmwO3oTw30m7kVt1iXvdS3KAp0smh4/edit#gid=0). From b9eec694239ee2947c9df55286292e5222c922b2 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 13 Aug 2024 14:51:51 -0700 Subject: [PATCH 51/56] add retry with backoff --- app/aws/s3.py | 35 +++++++++++++++++++++++++++++------ app/config.py | 14 +++++++++++++- app/service/rest.py | 10 ---------- poetry.lock | 5 +---- 4 files changed, 43 insertions(+), 21 deletions(-) diff --git a/app/aws/s3.py b/app/aws/s3.py index 760e4dedf..a0c3aad2c 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -1,4 +1,5 @@ import re +import time import botocore from boto3 import Session @@ -107,15 +108,15 @@ def download_from_s3( result = None try: result = s3.download_file(bucket_name, s3_key, local_filename) - print(f"File downloaded successfully to {local_filename}") + current_app.logger.info(f"File downloaded successfully to {local_filename}") except botocore.exceptions.NoCredentialsError as nce: - print("Credentials not found") + current_app.logger.error("Credentials not found") raise Exception(nce) except botocore.exceptions.PartialCredentialsError as pce: - print("Incomplete credentials provided") + current_app.logger.error("Incomplete credentials provided") raise Exception(pce) except Exception as e: - print(f"An error occurred {e}") + current_app.logger.error(f"An error occurred {e}") text = f"EXCEPTION {e} local_filename {local_filename}" raise Exception(text) return result @@ -171,8 +172,29 @@ def get_job_and_metadata_from_s3(service_id, job_id): def get_job_from_s3(service_id, job_id): - obj = get_s3_object(*get_job_location(service_id, job_id)) - return obj.get()["Body"].read().decode("utf-8") + retries = 0 + max_retries = 5 + backoff_factor = 1 + while retries < max_retries: + + try: + obj = get_s3_object(*get_job_location(service_id, job_id)) + return obj.get()["Body"].read().decode("utf-8") + except botocore.exceptions.ClientError as e: + if e.response["Error"]["Code"] in [ + "Throttling", + "RequestTimeout", + "SlowDown", + ]: + retries += 1 + sleep_time = backoff_factor * (2**retries) # Exponential backoff + time.sleep(sleep_time) + continue + except Exception as e: + current_app.logger.error(f"Failed to get object from bucket {e}") + raise + + raise Exception(f"Failed to get object after 5 attempts") def incr_jobs_cache_misses(): @@ -241,6 +263,7 @@ def get_phone_number_from_s3(service_id, job_id, job_row_number): # So this is a little recycling mechanism to reduce the number of downloads. job = JOBS.get(job_id) if job is None: + current_app.logger.info(f"job {job_id} was not in the cache") job = get_job_from_s3(service_id, job_id) JOBS[job_id] = job incr_jobs_cache_misses() diff --git a/app/config.py b/app/config.py index 65ef6b2d3..a8c8fd9de 100644 --- a/app/config.py +++ b/app/config.py @@ -1,5 +1,5 @@ import json -from datetime import timedelta +from datetime import datetime, timedelta from os import getenv, path from celery.schedules import crontab @@ -165,6 +165,8 @@ class Config(object): # we only need real email in Live environment (production) DVLA_EMAIL_ADDRESSES = json.loads(getenv("DVLA_EMAIL_ADDRESSES", "[]")) + current_minute = (datetime.now().minute + 1) % 60 + CELERY = { "broker_url": REDIS_URL, "broker_transport_options": { @@ -254,6 +256,16 @@ class Config(object): "schedule": crontab(minute="*/30"), "options": {"queue": QueueNames.PERIODIC}, }, + "regenerate-job-cache-on-startup": { + "task": "regenerate-job-cache", + "schedule": crontab( + minute=current_minute + ), # Runs once at the next minute + "options": { + "queue": QueueNames.PERIODIC, + "expires": 60, + }, # Ensure it doesn't run if missed + }, "cleanup-unfinished-jobs": { "task": "cleanup-unfinished-jobs", "schedule": crontab(hour=4, minute=5), diff --git a/app/service/rest.py b/app/service/rest.py index 687cf5a23..b61ea0394 100644 --- a/app/service/rest.py +++ b/app/service/rest.py @@ -511,11 +511,6 @@ def get_all_notifications_for_service(service_id): ) except ClientError as ex: if ex.response["Error"]["Code"] == "NoSuchKey": - s = notification.service_id - j = notification.job_id - current_app.logger.warning( - f"No personalisation found for s3 file location service: service-{s}-notify/{j}.csv" - ) notification.personalisation = "" else: raise ex @@ -531,11 +526,6 @@ def get_all_notifications_for_service(service_id): notification.normalised_to = recipient except ClientError as ex: if ex.response["Error"]["Code"] == "NoSuchKey": - s = notification.service_id - j = notification.job_id - current_app.logger.warning( - f"No phone number found for s3 file location service: service-{s}-notify/{j}.csv" - ) notification.to = "" notification.normalised_to = "" else: diff --git a/poetry.lock b/poetry.lock index 7842eb263..178795e6f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2093,13 +2093,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2488,6 +2484,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] From 76c02a15071d39921f2ef56769d88a3301ae5032 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 13 Aug 2024 14:55:55 -0700 Subject: [PATCH 52/56] fix flake8 --- app/aws/s3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/aws/s3.py b/app/aws/s3.py index a0c3aad2c..2b7feaf15 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -194,7 +194,7 @@ def get_job_from_s3(service_id, job_id): current_app.logger.error(f"Failed to get object from bucket {e}") raise - raise Exception(f"Failed to get object after 5 attempts") + raise Exception("Failed to get object after 5 attempts") def incr_jobs_cache_misses(): From db9197e7a685e834d0ffd016141af6c619fe4294 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 13 Aug 2024 15:32:43 -0700 Subject: [PATCH 53/56] ugh secrets --- .ds.baseline | 4 ++-- tests/app/aws/test_s3.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.ds.baseline b/.ds.baseline index 8b6703173..20143d6cd 100644 --- a/.ds.baseline +++ b/.ds.baseline @@ -209,7 +209,7 @@ "filename": "tests/app/aws/test_s3.py", "hashed_secret": "67a74306b06d0c01624fe0d0249a570f4d093747", "is_verified": false, - "line_number": 24, + "line_number": 25, "is_secret": false } ], @@ -384,5 +384,5 @@ } ] }, - "generated_at": "2024-08-01T17:38:39Z" + "generated_at": "2024-08-13T22:32:28Z" } diff --git a/tests/app/aws/test_s3.py b/tests/app/aws/test_s3.py index c009c369c..7ff3eac01 100644 --- a/tests/app/aws/test_s3.py +++ b/tests/app/aws/test_s3.py @@ -6,6 +6,7 @@ from app.aws.s3 import ( file_exists, + get_job_from_s3, get_personalisation_from_s3, get_phone_number_from_s3, get_s3_file, @@ -86,6 +87,21 @@ def test_get_phone_number_from_s3( phone_number = get_phone_number_from_s3("service_id", job_id, job_row_number) assert phone_number == expected_phone_number +def mock_s3_get_object_slowdown(*args, **kwargs): + error_response = { + 'Error': { + 'Code': 'SlowDown', + 'Message': 'Reduce your request rate', + } + } + raise ClientError(error_response, 'GetObject') + +def test_get_job_from_s3_exponential_backoff(mocker): + get_s3_object = mocker.patch("app.aws.s3.get_s3_object", side_effect=mock_s3_get_object_slowdown) + with pytest.raises(Exception) as exc_info: + job = get_job_from_s3("service_id", "job_id") + assert 'Failed to get object after 5 attempts' in str(exc_info) + @pytest.mark.parametrize( "job, job_id, job_row_number, expected_personalisation", From 7258105c916f434463b9be7d9de249b608d3177c Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 13 Aug 2024 15:45:39 -0700 Subject: [PATCH 54/56] fix flake 8 --- tests/app/aws/test_s3.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/app/aws/test_s3.py b/tests/app/aws/test_s3.py index 7ff3eac01..d625f6b06 100644 --- a/tests/app/aws/test_s3.py +++ b/tests/app/aws/test_s3.py @@ -87,20 +87,22 @@ def test_get_phone_number_from_s3( phone_number = get_phone_number_from_s3("service_id", job_id, job_row_number) assert phone_number == expected_phone_number + def mock_s3_get_object_slowdown(*args, **kwargs): error_response = { - 'Error': { - 'Code': 'SlowDown', - 'Message': 'Reduce your request rate', + "Error": { + "Code": "SlowDown", + "Message": "Reduce your request rate", } } - raise ClientError(error_response, 'GetObject') + raise ClientError(error_response, "GetObject") + def test_get_job_from_s3_exponential_backoff(mocker): - get_s3_object = mocker.patch("app.aws.s3.get_s3_object", side_effect=mock_s3_get_object_slowdown) + mocker.patch("app.aws.s3.get_s3_object", side_effect=mock_s3_get_object_slowdown) with pytest.raises(Exception) as exc_info: - job = get_job_from_s3("service_id", "job_id") - assert 'Failed to get object after 5 attempts' in str(exc_info) + get_job_from_s3("service_id", "job_id") + assert "Failed to get object after 5 attempts" in str(exc_info) @pytest.mark.parametrize( From 6938d8f618e15a0cf95bdded96ac85e652218dca Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 14 Aug 2024 10:29:30 -0700 Subject: [PATCH 55/56] fix sort on download all users --- app/dao/users_dao.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/dao/users_dao.py b/app/dao/users_dao.py index e541f4052..a07d55d4e 100644 --- a/app/dao/users_dao.py +++ b/app/dao/users_dao.py @@ -253,6 +253,6 @@ def dao_report_users(): inner join user_to_service on users.id=user_to_service.user_id inner join services on services.id=user_to_service.service_id where services.name not like '_archived%' - order by services.name asc, users.name asc + order by users.name asc """ return db.session.execute(text(sql)) From 2dcbf2729e4815056166eb3d3fea9cd6c3f2acc1 Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Wed, 14 Aug 2024 15:35:02 -0400 Subject: [PATCH 56/56] Adjust staging and demo worker instance settings This changeset adds a bit more memory to the staging worker instance, and it bumps the number of worker instances to 2 in staging and demo. Signed-off-by: Carlo Costino --- deploy-config/demo.yml | 2 +- deploy-config/staging.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy-config/demo.yml b/deploy-config/demo.yml index 38e238c30..600ea55b4 100644 --- a/deploy-config/demo.yml +++ b/deploy-config/demo.yml @@ -1,7 +1,7 @@ env: demo web_instances: 2 web_memory: 1G -worker_instances: 1 +worker_instances: 2 worker_memory: 512M scheduler_memory: 256M public_api_route: notify-api-demo.app.cloud.gov diff --git a/deploy-config/staging.yml b/deploy-config/staging.yml index c338e7bb1..34ae91c3c 100644 --- a/deploy-config/staging.yml +++ b/deploy-config/staging.yml @@ -1,8 +1,8 @@ env: staging web_instances: 2 web_memory: 1G -worker_instances: 1 -worker_memory: 512M +worker_instances: 2 +worker_memory: 1G scheduler_memory: 256M public_api_route: notify-api-staging.app.cloud.gov admin_base_url: https://notify-staging.app.cloud.gov