From 7c684948cb60e6264d931a0ccf301f9c6bb3e38c Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 12 Dec 2023 11:04:46 -0500 Subject: [PATCH 01/38] Adding the markdown file for the data dictionary --- docs/data-dictionary.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 docs/data-dictionary.md diff --git a/docs/data-dictionary.md b/docs/data-dictionary.md new file mode 100644 index 000000000..d9aadf3ed --- /dev/null +++ b/docs/data-dictionary.md @@ -0,0 +1,12 @@ +# notify.gov Data Dictionary + +This document serves as a comprehensive guide to the data structure of notify.gov. It outlines the key data elements, their types, and relationships within the system. From user information to message details, this data dictionary is a valuable resource for understanding and maintaining the underlying data model of this application. Use this guide to ensure consistency, clarity, and effective management of the data that powers our messaging functionality. + +## Table: Dashboard + +| Field | Type | Length | Description | +|--------------|-----------|--------|------------------------------------| +| ProductID | Integer | | Unique identifier for a product. | +| Name | Varchar | 100 | Name of the product. | +| Price | Decimal | | Price of the product. | +| CategoryID | Integer | | Foreign key to product category. | From d5b98679be9186931deb292fef67410ed7b61563 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Tue, 12 Dec 2023 12:30:47 -0500 Subject: [PATCH 02/38] More realistic data --- docs/data-dictionary.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/data-dictionary.md b/docs/data-dictionary.md index d9aadf3ed..392fae5c9 100644 --- a/docs/data-dictionary.md +++ b/docs/data-dictionary.md @@ -2,11 +2,16 @@ This document serves as a comprehensive guide to the data structure of notify.gov. It outlines the key data elements, their types, and relationships within the system. From user information to message details, this data dictionary is a valuable resource for understanding and maintaining the underlying data model of this application. Use this guide to ensure consistency, clarity, and effective management of the data that powers our messaging functionality. +# Table: Global + +| Field | Type | Length | Description | +|-------------------------------------|-----------|--------|------------------------------------------------------------------| +| service_id | Integer | | Service ID - reference for most data related to a service | + + ## Table: Dashboard -| Field | Type | Length | Description | -|--------------|-----------|--------|------------------------------------| -| ProductID | Integer | | Unique identifier for a product. | -| Name | Varchar | 100 | Name of the product. | -| Price | Decimal | | Price of the product. | -| CategoryID | Integer | | Foreign key to product category. | +| Field | Type | Length | Description | +|-------------------------------------|-----------|--------|--------------------------------------------| +| global_message_limit | Integer | | Message limit set by platform admin | +| daily_global_messages_remaining | Integer | | Remaining messages in database | From abce798f5b119069479d40f7946d5b5eca9a3159 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 4 Mar 2024 10:32:19 -0800 Subject: [PATCH 03/38] remove celery from notifications-utils (notify-api-130) --- app/__init__.py | 79 +++++++++++++++++++++++++++++++++++++++++++++++-- poetry.lock | 9 +++--- pyproject.toml | 2 +- 3 files changed, 82 insertions(+), 8 deletions(-) diff --git a/app/__init__.py b/app/__init__.py index 5a364f151..9184c4815 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -3,15 +3,16 @@ import secrets import string import time import uuid +from contextlib import contextmanager from time import monotonic -from celery import current_task +from celery import Celery, Task, current_task from flask import current_app, g, has_request_context, jsonify, make_response, request +from flask.ctx import has_app_context from flask_marshmallow import Marshmallow from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy from notifications_utils import logging, request_helper -from notifications_utils.celery import NotifyCelery from notifications_utils.clients.encryption.encryption_client import Encryption from notifications_utils.clients.redis.redis_client import RedisClient from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient @@ -27,6 +28,25 @@ from app.clients.email.aws_ses_stub import AwsSesStubClient from app.clients.sms.aws_sns import AwsSnsClient +class NotifyCelery(Celery): + def init_app(self, app): + self.task_cls = make_task(app) + + # Configure Celery app with options from the main app config. + self.config_from_object(app.config["CELERY"]) + + def send_task(self, name, args=None, kwargs=None, **other_kwargs): + other_kwargs["headers"] = other_kwargs.get("headers") or {} + + if has_request_context() and hasattr(request, "request_id"): + other_kwargs["headers"]["notify_request_id"] = request.request_id + + elif has_app_context() and "request_id" in g: + other_kwargs["headers"]["notify_request_id"] = g.request_id + + return super().send_task(name, args, kwargs, **other_kwargs) + + class SQLAlchemy(_SQLAlchemy): """We need to subclass SQLAlchemy in order to override create_engine options""" @@ -366,3 +386,58 @@ def setup_sqlalchemy_events(app): @event.listens_for(db.engine, "checkin") def checkin(dbapi_connection, connection_record): # noqa pass + + +def make_task(app): + class NotifyTask(Task): + abstract = True + start = None + + @property + def queue_name(self): + delivery_info = self.request.delivery_info or {} + return delivery_info.get("routing_key", "none") + + @property + def request_id(self): + # Note that each header is a direct attribute of the + # task context (aka "request"). + return self.request.get("notify_request_id") + + @contextmanager + def app_context(self): + with app.app_context(): + # Add 'request_id' to 'g' so that it gets logged. + g.request_id = self.request_id + yield + + def on_success(self, retval, task_id, args, kwargs): # noqa + # enables request id tracing for these logs + with self.app_context(): + elapsed_time = time.monotonic() - self.start + + app.logger.info( + "Celery task {task_name} (queue: {queue_name}) took {time}".format( + task_name=self.name, + queue_name=self.queue_name, + time="{0:.4f}".format(elapsed_time), + ) + ) + + def on_failure(self, exc, task_id, args, kwargs, einfo): # noqa + # enables request id tracing for these logs + with self.app_context(): + app.logger.exception( + "Celery task {task_name} (queue: {queue_name}) failed".format( + task_name=self.name, + queue_name=self.queue_name, + ) + ) + + def __call__(self, *args, **kwargs): + # ensure task has flask context to access config, logger, etc + with self.app_context(): + self.start = time.monotonic() + return super().__call__(*args, **kwargs) + + return NotifyTask diff --git a/poetry.lock b/poetry.lock index 8f8b2f11f..2030fc693 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiohttp" @@ -2670,8 +2670,8 @@ werkzeug = "^3.0.1" [package.source] type = "git" url = "https://github.com/GSA/notifications-utils.git" -reference = "HEAD" -resolved_reference = "df8ece836cad303c5d161edf485cf9bbdc666688" +reference = "053fe30" +resolved_reference = "053fe304a1bbc1ae6559869b1fd0a2c3f83981ea" [[package]] name = "numpy" @@ -3479,7 +3479,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"}, @@ -4771,4 +4770,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "ccfd855abf7309cf520ea5ca02e77fc9d8ab911819ea9690298fa0549a9d7c42" +content-hash = "1041afd9fe9642567640966a7f7b1129f8f084f169419d8f2c7db9071672eb57" diff --git a/pyproject.toml b/pyproject.toml index 970059f5a..a87fefe96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ marshmallow = "==3.20.2" marshmallow-sqlalchemy = "==0.30.0" newrelic = "*" notifications-python-client = "==9.0.0" -notifications-utils = {git = "https://github.com/GSA/notifications-utils.git"} +notifications-utils = {git = "https://github.com/GSA/notifications-utils.git", rev="053fe30"} oscrypto = "==1.3.0" packaging = "==23.2" poetry-dotenv-plugin = "==0.2.0" From b8c5a241a347c190800b8e50623e8082bd68c329 Mon Sep 17 00:00:00 2001 From: samathad2023 Date: Fri, 8 Mar 2024 15:09:30 -0800 Subject: [PATCH 04/38] updates needs for python version upgrade --- poetry.lock | 315 ++++++++++++++++++++----------------------------- pyproject.toml | 4 +- 2 files changed, 127 insertions(+), 192 deletions(-) diff --git a/poetry.lock b/poetry.lock index 00e656a4a..a8799c834 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiohttp" @@ -87,7 +87,6 @@ files = [ [package.dependencies] aiosignal = ">=1.1.2" -async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} attrs = ">=17.3.0" frozenlist = ">=1.1.1" multidict = ">=4.5,<7.0" @@ -354,8 +353,6 @@ mypy-extensions = ">=0.4.3" packaging = ">=22.0" pathspec = ">=0.9.0" platformdirs = ">=2" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} -typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -436,10 +433,7 @@ files = [ [package.dependencies] jmespath = ">=0.7.1,<2.0.0" python-dateutil = ">=2.1,<3.0.0" -urllib3 = [ - {version = ">=1.25.4,<1.27", markers = "python_version < \"3.10\""}, - {version = ">=1.25.4,<2.1", markers = "python_version >= \"3.10\""}, -] +urllib3 = {version = ">=1.25.4,<2.1", markers = "python_version >= \"3.10\""} [package.extras] crt = ["awscrt (==0.19.12)"] @@ -457,10 +451,8 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "os_name == \"nt\""} -importlib-metadata = {version = ">=4.6", markers = "python_full_version < \"3.10.2\""} packaging = ">=19.0" pyproject_hooks = "*" -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} [package.extras] docs = ["furo (>=2023.08.17)", "sphinx (>=7.0,<8.0)", "sphinx-argparse-cli (>=1.5)", "sphinx-autodoc-typehints (>=1.10)", "sphinx-issues (>=3.0.0)"] @@ -928,9 +920,6 @@ files = [ {file = "coverage-7.4.3.tar.gz", hash = "sha256:276f6077a5c61447a48d133ed13e759c09e62aff0dc84274a68dc18660104d52"}, ] -[package.dependencies] -tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} - [package.extras] toml = ["tomli"] @@ -1001,13 +990,13 @@ test-randomorder = ["pytest-randomly"] [[package]] name = "cyclonedx-python-lib" -version = "6.4.2" +version = "6.4.3" description = "Python library for CycloneDX" optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "cyclonedx_python_lib-6.4.2-py3-none-any.whl", hash = "sha256:47ed05c7a82d0aa355f09a7fd0048e13f1440b6a96b603dc26d02ba782e6274e"}, - {file = "cyclonedx_python_lib-6.4.2.tar.gz", hash = "sha256:b857972c6a7317faa66ec4ed4b6040dae7fca82e40eddfbeaa7f0f37f9a7cac7"}, + {file = "cyclonedx_python_lib-6.4.3-py3-none-any.whl", hash = "sha256:bc9f29073f4ed23b68ba01e342496cd2d1d5232d88b63abdc69f5072f472f8de"}, + {file = "cyclonedx_python_lib-6.4.3.tar.gz", hash = "sha256:3d9450e500ca6f7cf9625e7bff700599dcca70e4a2180705b61917c59743506e"}, ] [package.dependencies] @@ -1340,7 +1329,6 @@ files = [ [package.dependencies] blinker = ">=1.6.2" click = ">=8.1.3" -importlib-metadata = {version = ">=3.6.0", markers = "python_version < \"3.10\""} itsdangerous = ">=2.1.2" Jinja2 = ">=3.1.2" Werkzeug = ">=2.3.7" @@ -1728,25 +1716,6 @@ files = [ {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, ] -[[package]] -name = "importlib-metadata" -version = "7.0.1" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "importlib_metadata-7.0.1-py3-none-any.whl", hash = "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e"}, - {file = "importlib_metadata-7.0.1.tar.gz", hash = "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"}, -] - -[package.dependencies] -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] - [[package]] name = "iniconfig" version = "2.0.0" @@ -1967,7 +1936,6 @@ files = [ ] [package.dependencies] -importlib-metadata = {version = ">=4.11.4", markers = "python_version < \"3.12\""} "jaraco.classes" = "*" jeepney = {version = ">=0.4.2", markers = "sys_platform == \"linux\""} pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} @@ -1991,7 +1959,6 @@ files = [ [package.dependencies] amqp = ">=5.1.1,<6.0.0" -typing-extensions = {version = "*", markers = "python_version < \"3.10\""} vine = "*" [package.extras] @@ -2636,7 +2603,7 @@ name = "notifications-utils" version = "0.2.9" description = "" optional = false -python-versions = ">=3.9,<3.12" +python-versions = "^3.12.2" files = [] develop = false @@ -2663,7 +2630,7 @@ jmespath = "^1.0.1" markupsafe = "^2.1.2" mistune = "==0.8.4" numpy = "^1.24.2" -orderedset = "^2.0.3" +ordered-set = "^4.1.0" phonenumbers = "^8.13.8" pycparser = "^2.21" python-dateutil = "^2.8.2" @@ -2684,8 +2651,8 @@ werkzeug = "^3.0.1" [package.source] type = "git" url = "https://github.com/GSA/notifications-utils.git" -reference = "HEAD" -resolved_reference = "46af64b4f2540e44b3dda4a49cff04008dfe1ee8" +reference = "c45507d" +resolved_reference = "c45507d87b868d778c3075af4d0d2090a72b5310" [[package]] name = "numpy" @@ -2747,15 +2714,19 @@ files = [ requests = ">=2.5.0" [[package]] -name = "orderedset" -version = "2.0.3" -description = "An Ordered Set implementation in Cython." +name = "ordered-set" +version = "4.1.0" +description = "An OrderedSet is a custom MutableSet that remembers its order, so that every" optional = false -python-versions = "*" +python-versions = ">=3.7" files = [ - {file = "orderedset-2.0.3.tar.gz", hash = "sha256:b2f5ccfb5a86e7b3b3ddf18b29779cc18b24653abf9d6da4bebecf33780a6e29"}, + {file = "ordered-set-4.1.0.tar.gz", hash = "sha256:694a8e44c87657c59292ede72891eb91d34131f6531463aab3009191c77364a8"}, + {file = "ordered_set-4.1.0-py3-none-any.whl", hash = "sha256:046e1132c71fcf3330438a539928932caf51ddbc582496833e23de611de14562"}, ] +[package.extras] +dev = ["black", "mypy", "pytest"] + [[package]] name = "oscrypto" version = "1.3.0" @@ -2919,17 +2890,17 @@ testing = ["aboutcode-toolkit (>=6.0.0)", "black", "pytest (>=6,!=7.0.0)", "pyte [[package]] name = "pkginfo" -version = "1.9.6" +version = "1.10.0" description = "Query metadata from sdists / bdists / installed packages." optional = false python-versions = ">=3.6" files = [ - {file = "pkginfo-1.9.6-py3-none-any.whl", hash = "sha256:4b7a555a6d5a22169fcc9cf7bfd78d296b0361adad412a346c1226849af5e546"}, - {file = "pkginfo-1.9.6.tar.gz", hash = "sha256:8fd5896e8718a4372f0ea9cc9d96f6417c9b986e23a4d116dda26b62cc29d046"}, + {file = "pkginfo-1.10.0-py3-none-any.whl", hash = "sha256:889a6da2ed7ffc58ab5b900d888ddce90bce912f2d2de1dc1c26f4cb9fe65097"}, + {file = "pkginfo-1.10.0.tar.gz", hash = "sha256:5df73835398d10db79f8eecd5cd86b1f6d29317589ea70796994d49399af6297"}, ] [package.extras] -testing = ["pytest", "pytest-cov"] +testing = ["pytest", "pytest-cov", "wheel"] [[package]] name = "platformdirs" @@ -2963,13 +2934,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "poetry" -version = "1.8.1" +version = "1.8.2" description = "Python dependency management and packaging made easy." optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "poetry-1.8.1-py3-none-any.whl", hash = "sha256:cf133946661025822672422769567980f8e489ed5b6fc170d1025a4d6c9aac29"}, - {file = "poetry-1.8.1.tar.gz", hash = "sha256:23519cc45eb3cf48e899145bc762425a141e3afd52ecc53ec443ca635122327f"}, + {file = "poetry-1.8.2-py3-none-any.whl", hash = "sha256:b42b400d9a803af6e788a30a6f3e9998020b77860e28df20647eb10b6f414910"}, + {file = "poetry-1.8.2.tar.gz", hash = "sha256:49cceb3838104647c3e1021f3a4f13c6053704cc18d33f849a90fe687a29cb73"}, ] [package.dependencies] @@ -2979,7 +2950,6 @@ cleo = ">=2.1.0,<3.0.0" crashtest = ">=0.4.1,<0.5.0" dulwich = ">=0.21.2,<0.22.0" fastjsonschema = ">=2.18.0,<3.0.0" -importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} installer = ">=0.7.0,<0.8.0" keyring = ">=24.0.0,<25.0.0" packaging = ">=23.1" @@ -2992,7 +2962,6 @@ pyproject-hooks = ">=1.0.0,<2.0.0" requests = ">=2.26,<3.0" requests-toolbelt = ">=1.0.0,<2.0.0" shellingham = ">=1.5,<2.0" -tomli = {version = ">=2.0.1,<3.0.0", markers = "python_version < \"3.11\""} tomlkit = ">=0.11.4,<1.0.0" trove-classifiers = ">=2022.5.19" virtualenv = ">=20.23.0,<21.0.0" @@ -3286,13 +3255,13 @@ tests = ["coverage[toml] (==5.0.4)", "pytest (>=6.0.0,<7.0.0)"] [[package]] name = "pyparsing" -version = "3.1.1" +version = "3.1.2" description = "pyparsing module - Classes and methods to define and execute parsing grammars" optional = false python-versions = ">=3.6.8" files = [ - {file = "pyparsing-3.1.1-py3-none-any.whl", hash = "sha256:32c7c0b711493c72ff18a981d24f28aaf9c1fb7ed5e9667c9e84e3db623bdbfb"}, - {file = "pyparsing-3.1.1.tar.gz", hash = "sha256:ede28a1a32462f5a9705e07aea48001a08f7cf81a021585011deba701581a0db"}, + {file = "pyparsing-3.1.2-py3-none-any.whl", hash = "sha256:f9db75911801ed778fe61bb643079ff86601aca99fcae6345aa67292038fb742"}, + {file = "pyparsing-3.1.2.tar.gz", hash = "sha256:a1bac0ce561155ecc3ed78ca94d3c9378656ad4c94c1270de543f621420f94ad"}, ] [package.extras] @@ -3309,9 +3278,6 @@ files = [ {file = "pyproject_hooks-1.0.0.tar.gz", hash = "sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5"}, ] -[package.dependencies] -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} - [[package]] name = "pytest" version = "7.4.4" @@ -3325,11 +3291,9 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] @@ -3365,7 +3329,6 @@ files = [ [package.dependencies] pytest = ">=7.4.3" -tomli = {version = ">=2.0.1", markers = "python_version < \"3.11\""} [package.extras] test = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "pytest-mock (>=3.12)"] @@ -3493,6 +3456,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"}, @@ -3547,101 +3511,101 @@ toml = ["tomli (>=2.0.1)"] [[package]] name = "rapidfuzz" -version = "3.6.1" +version = "3.6.2" description = "rapid fuzzy string matching" optional = false python-versions = ">=3.8" files = [ - {file = "rapidfuzz-3.6.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ac434fc71edda30d45db4a92ba5e7a42c7405e1a54cb4ec01d03cc668c6dcd40"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:2a791168e119cfddf4b5a40470620c872812042f0621e6a293983a2d52372db0"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5a2f3e9df346145c2be94e4d9eeffb82fab0cbfee85bd4a06810e834fe7c03fa"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23de71e7f05518b0bbeef55d67b5dbce3bcd3e2c81e7e533051a2e9401354eb0"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d056e342989248d2bdd67f1955bb7c3b0ecfa239d8f67a8dfe6477b30872c607"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:01835d02acd5d95c1071e1da1bb27fe213c84a013b899aba96380ca9962364bc"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ed0f712e0bb5fea327e92aec8a937afd07ba8de4c529735d82e4c4124c10d5a0"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:96cd19934f76a1264e8ecfed9d9f5291fde04ecb667faef5f33bdbfd95fe2d1f"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e06c4242a1354cf9d48ee01f6f4e6e19c511d50bb1e8d7d20bcadbb83a2aea90"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:d73dcfe789d37c6c8b108bf1e203e027714a239e50ad55572ced3c004424ed3b"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:06e98ff000e2619e7cfe552d086815671ed09b6899408c2c1b5103658261f6f3"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:08b6fb47dd889c69fbc0b915d782aaed43e025df6979b6b7f92084ba55edd526"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:a1788ebb5f5b655a15777e654ea433d198f593230277e74d51a2a1e29a986283"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-win32.whl", hash = "sha256:c65f92881753aa1098c77818e2b04a95048f30edbe9c3094dc3707d67df4598b"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-win_amd64.whl", hash = "sha256:4243a9c35667a349788461aae6471efde8d8800175b7db5148a6ab929628047f"}, - {file = "rapidfuzz-3.6.1-cp310-cp310-win_arm64.whl", hash = "sha256:f59d19078cc332dbdf3b7b210852ba1f5db8c0a2cd8cc4c0ed84cc00c76e6802"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:fbc07e2e4ac696497c5f66ec35c21ddab3fc7a406640bffed64c26ab2f7ce6d6"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:40cced1a8852652813f30fb5d4b8f9b237112a0bbaeebb0f4cc3611502556764"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:82300e5f8945d601c2daaaac139d5524d7c1fdf719aa799a9439927739917460"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edf97c321fd641fea2793abce0e48fa4f91f3c202092672f8b5b4e781960b891"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7420e801b00dee4a344ae2ee10e837d603461eb180e41d063699fb7efe08faf0"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:060bd7277dc794279fa95522af355034a29c90b42adcb7aa1da358fc839cdb11"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7e3375e4f2bfec77f907680328e4cd16cc64e137c84b1886d547ab340ba6928"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a490cd645ef9d8524090551016f05f052e416c8adb2d8b85d35c9baa9d0428ab"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:2e03038bfa66d2d7cffa05d81c2f18fd6acbb25e7e3c068d52bb7469e07ff382"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:2b19795b26b979c845dba407fe79d66975d520947b74a8ab6cee1d22686f7967"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:064c1d66c40b3a0f488db1f319a6e75616b2e5fe5430a59f93a9a5e40a656d15"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:3c772d04fb0ebeece3109d91f6122b1503023086a9591a0b63d6ee7326bd73d9"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:841eafba6913c4dfd53045835545ba01a41e9644e60920c65b89c8f7e60c00a9"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-win32.whl", hash = "sha256:266dd630f12696ea7119f31d8b8e4959ef45ee2cbedae54417d71ae6f47b9848"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-win_amd64.whl", hash = "sha256:d79aec8aeee02ab55d0ddb33cea3ecd7b69813a48e423c966a26d7aab025cdfe"}, - {file = "rapidfuzz-3.6.1-cp311-cp311-win_arm64.whl", hash = "sha256:484759b5dbc5559e76fefaa9170147d1254468f555fd9649aea3bad46162a88b"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:b2ef4c0fd3256e357b70591ffb9e8ed1d439fb1f481ba03016e751a55261d7c1"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:588c4b20fa2fae79d60a4e438cf7133d6773915df3cc0a7f1351da19eb90f720"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:7142ee354e9c06e29a2636b9bbcb592bb00600a88f02aa5e70e4f230347b373e"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1dfc557c0454ad22382373ec1b7df530b4bbd974335efe97a04caec936f2956a"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:03f73b381bdeccb331a12c3c60f1e41943931461cdb52987f2ecf46bfc22f50d"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b0ccc2ec1781c7e5370d96aef0573dd1f97335343e4982bdb3a44c133e27786"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:da3e8c9f7e64bb17faefda085ff6862ecb3ad8b79b0f618a6cf4452028aa2222"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fde9b14302a31af7bdafbf5cfbb100201ba21519be2b9dedcf4f1048e4fbe65d"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:c1a23eee225dfb21c07f25c9fcf23eb055d0056b48e740fe241cbb4b22284379"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e49b9575d16c56c696bc7b06a06bf0c3d4ef01e89137b3ddd4e2ce709af9fe06"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:0a9fc714b8c290261669f22808913aad49553b686115ad0ee999d1cb3df0cd66"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:a3ee4f8f076aa92184e80308fc1a079ac356b99c39408fa422bbd00145be9854"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:f056ba42fd2f32e06b2c2ba2443594873cfccc0c90c8b6327904fc2ddf6d5799"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-win32.whl", hash = "sha256:5d82b9651e3d34b23e4e8e201ecd3477c2baa17b638979deeabbb585bcb8ba74"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-win_amd64.whl", hash = "sha256:dad55a514868dae4543ca48c4e1fc0fac704ead038dafedf8f1fc0cc263746c1"}, - {file = "rapidfuzz-3.6.1-cp312-cp312-win_arm64.whl", hash = "sha256:3c84294f4470fcabd7830795d754d808133329e0a81d62fcc2e65886164be83b"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e19d519386e9db4a5335a4b29f25b8183a1c3f78cecb4c9c3112e7f86470e37f"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01eb03cd880a294d1bf1a583fdd00b87169b9cc9c9f52587411506658c864d73"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:be368573255f8fbb0125a78330a1a40c65e9ba3c5ad129a426ff4289099bfb41"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b3e5af946f419c30f5cb98b69d40997fe8580efe78fc83c2f0f25b60d0e56efb"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f382f7ffe384ce34345e1c0b2065451267d3453cadde78946fbd99a59f0cc23c"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be156f51f3a4f369e758505ed4ae64ea88900dcb2f89d5aabb5752676d3f3d7e"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1936d134b6c513fbe934aeb668b0fee1ffd4729a3c9d8d373f3e404fbb0ce8a0"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12ff8eaf4a9399eb2bebd838f16e2d1ded0955230283b07376d68947bbc2d33d"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:ae598a172e3a95df3383634589660d6b170cc1336fe7578115c584a99e0ba64d"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cd4ba4c18b149da11e7f1b3584813159f189dc20833709de5f3df8b1342a9759"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:0402f1629e91a4b2e4aee68043a30191e5e1b7cd2aa8dacf50b1a1bcf6b7d3ab"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:1e12319c6b304cd4c32d5db00b7a1e36bdc66179c44c5707f6faa5a889a317c0"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0bbfae35ce4de4c574b386c43c78a0be176eeddfdae148cb2136f4605bebab89"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-win32.whl", hash = "sha256:7fec74c234d3097612ea80f2a80c60720eec34947066d33d34dc07a3092e8105"}, - {file = "rapidfuzz-3.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:a553cc1a80d97459d587529cc43a4c7c5ecf835f572b671107692fe9eddf3e24"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:757dfd7392ec6346bd004f8826afb3bf01d18a723c97cbe9958c733ab1a51791"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:2963f4a3f763870a16ee076796be31a4a0958fbae133dbc43fc55c3968564cf5"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d2f0274595cc5b2b929c80d4e71b35041104b577e118cf789b3fe0a77b37a4c5"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f211e366e026de110a4246801d43a907cd1a10948082f47e8a4e6da76fef52"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a59472b43879012b90989603aa5a6937a869a72723b1bf2ff1a0d1edee2cc8e6"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a03863714fa6936f90caa7b4b50ea59ea32bb498cc91f74dc25485b3f8fccfe9"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5dd95b6b7bfb1584f806db89e1e0c8dbb9d25a30a4683880c195cc7f197eaf0c"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7183157edf0c982c0b8592686535c8b3e107f13904b36d85219c77be5cefd0d8"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ad9d74ef7c619b5b0577e909582a1928d93e07d271af18ba43e428dc3512c2a1"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b53137d81e770c82189e07a8f32722d9e4260f13a0aec9914029206ead38cac3"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:49b9ed2472394d306d5dc967a7de48b0aab599016aa4477127b20c2ed982dbf9"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:dec307b57ec2d5054d77d03ee4f654afcd2c18aee00c48014cb70bfed79597d6"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4381023fa1ff32fd5076f5d8321249a9aa62128eb3f21d7ee6a55373e672b261"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-win32.whl", hash = "sha256:8d7a072f10ee57c8413c8ab9593086d42aaff6ee65df4aa6663eecdb7c398dca"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:ebcfb5bfd0a733514352cfc94224faad8791e576a80ffe2fd40b2177bf0e7198"}, - {file = "rapidfuzz-3.6.1-cp39-cp39-win_arm64.whl", hash = "sha256:1c47d592e447738744905c18dda47ed155620204714e6df20eb1941bb1ba315e"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:eef8b346ab331bec12bbc83ac75641249e6167fab3d84d8f5ca37fd8e6c7a08c"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53251e256017e2b87f7000aee0353ba42392c442ae0bafd0f6b948593d3f68c6"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6dede83a6b903e3ebcd7e8137e7ff46907ce9316e9d7e7f917d7e7cdc570ee05"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e4da90e4c2b444d0a171d7444ea10152e07e95972bb40b834a13bdd6de1110c"}, - {file = "rapidfuzz-3.6.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:ca3dfcf74f2b6962f411c33dd95b0adf3901266e770da6281bc96bb5a8b20de9"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:bcc957c0a8bde8007f1a8a413a632a1a409890f31f73fe764ef4eac55f59ca87"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:692c9a50bea7a8537442834f9bc6b7d29d8729a5b6379df17c31b6ab4df948c2"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76c23ceaea27e790ddd35ef88b84cf9d721806ca366199a76fd47cfc0457a81b"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2b155e67fff215c09f130555002e42f7517d0ea72cbd58050abb83cb7c880cec"}, - {file = "rapidfuzz-3.6.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3028ee8ecc48250607fa8a0adce37b56275ec3b1acaccd84aee1f68487c8557b"}, - {file = "rapidfuzz-3.6.1.tar.gz", hash = "sha256:35660bee3ce1204872574fa041c7ad7ec5175b3053a4cb6e181463fc07013de7"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a5637e6bf11b15b5aff6ee818c76bdec99ad208511b78985e6209ba648a6e3ee"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:380586664f2f63807050ddb95e7702888b4f0b425abf17655940c411f39287ad"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3168ff565d4b8c239cf11fb604dd2507d30e9bcaac76a4077c0ac23cf2c866ed"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:be69f7fd46b5c6467fe5e2fd4cff3816b0c03048eed8a4becb9a73e6000960e7"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cbd5894f23fdf5697499cf759523639838ac822bd1600e343fdce7313baa02ae"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:85a5b6e026393fe39fb61146b9c17c5af66fffbe1410e992c4bb06d9ec327bd3"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ab269adfc64480f209e99f253391a10735edd5c09046e04899adab5fb132f20e"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:35aeac852bca06023d6bbd50c1fc504ca5a9a3613d5e75a140f0be7601fa34ef"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e706f302c6a3ae0d74edd0d6ace46aee1ae07c563b436ccf5ff04db2b3571e60"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bec353f022011e6e5cd28ccb8700fbd2a33918197af0d4e0abb3c3f4845cc864"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ef3925daaa93eed20401012e219f569ff0c039ed5bf4ce2d3737b4f75d441622"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:6ee98d88ae9ccc77ff61992ed33b2496478def5dc0da55c9a9aa06fcb725a352"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:423c7c588b09d618601097b7a0017dfcb91132a2076bef29023c5f3cd2dc3de1"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-win32.whl", hash = "sha256:c17c5efee347a40a6f4c1eec59e3d7d1e22f7613a97f8b8a07733ef723483a04"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-win_amd64.whl", hash = "sha256:4209816626d8d6ff8ae7dc248061c6059e618b70c6e6f6e4d7444ae3740b2b85"}, + {file = "rapidfuzz-3.6.2-cp310-cp310-win_arm64.whl", hash = "sha256:1c54d3c85e522d3ac9ee39415f183c8fa184c4f87e7e5a37938f15a6d50e853a"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:e06f6d270112f5db001f1cba5a97e1a48aee3d3dbdcbea3ec027c230462dbf9b"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:080cb71b50cb6aff11d1c6aeb157f273e2da0b2bdb3f9d7b01257e49e69a8576"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a7895e04a22d6515bc91a850e0831f2405547605aa311d1ffec51e4818abc3c1"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd82f9838519136b7083dd1e3149ee80344521f3dc37f744f227505ff0883efb"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a945567c2b0b6e069454c9782d5234b0b6795718adf7a9f868bd3144afa6a023"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:673ba2c343644805acdae1cb949c6a4de71aa2f62a998978551ebea59603af3f"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9d457c89bac1471442002e70551e8268e639b3870b4a4521eae363c07253be87"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:495c0d8e14e6f12520eb7fc71b9ba9fcaafb47fc23a654e6e89b6c7985ec0020"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6d67b649bf3e1b1722d04eca44d37919aef88305ce7ad05564502d013cf550fd"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:e48dde8ca83d11daa00900cf6a5d281a1297aef9b7bfa73801af6e8822be5019"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:824cc381cf81cbf8d158f6935664ec2a69e6ac3b1d39fa201988bf81a257f775"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:1dfe4c24957474ce0ac75d886387e30e292b4be39228a6d71f76de414dc187db"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:d57b98013b802621bbc8b12a46bfc9d36ac552ab51ca207f7ce167ad46adabeb"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-win32.whl", hash = "sha256:9a07dffac439223b4f1025dbfc68f4445a3460a859309c9858c2a3fa29617cdc"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-win_amd64.whl", hash = "sha256:95a49c6b8bf1229743ae585dd5b7d57f0d15a7eb6e826866d5c9965ba958503c"}, + {file = "rapidfuzz-3.6.2-cp311-cp311-win_arm64.whl", hash = "sha256:af7c19ec86e11488539380d3db1755be5d561a3c0e7b04ff9d07abd7f9a8e9d8"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:de8adc12161bf282c60f12dc9233bb31632f71d446a010fe7469a69b8153427f"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:337e357f693130c4c6be740652542b260e36f622c59e01fa33d58f1d2750c930"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:6468f8bc8c3c50604f43631550ef9cfec873515dba5023ca34d461be94669fc8"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:74c6773b11445b5e5cf93ca383171cd0ac0cdeafea11a7b2a5688f8bf8d813e6"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e1507fc5769aa109dda4de3a15f822a0f6a03e18d627bd0ba3ddbb253cf70e07"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:617949a70150e6fffdaed19253dd49f7a53528411dc8bf7663d499ba21e0f61e"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f8b77779174b1b40aa70827692571ab457061897846255ad7d5d559e2edb1932"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:80e51b22a7da83f9c87a97e92df07ed0612c74c35496590255f4b5d5b4212dfe"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:3ae7c86914cb6673e97e187ba431b9c4cf4177d9ae77f8a1e5b2ba9a5628839e"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ddc380ffaa90f204cc9ddcb779114b9ab6f015246d549de9d47871a97ef9f18a"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:3c1dc078ef371fce09f9f3eec2ca4eaa2a8cd412ec53941015b4f39f14d34407"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:9a74102fc5a2534fe91f7507838623e1f3a149d8e05648389c42bb42e14b1c3f"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:48e1eaea8fcd522fca7f04f0480663f0f0cfb77957092cce60a93f4462864996"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-win32.whl", hash = "sha256:66b008bf2972740cd2dda5d382eb8bdb87265cd88198e71c7797bdc0d1f79d20"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-win_amd64.whl", hash = "sha256:87ac3a87f2251ae2e95fc9478ca5c759de6d141d04c84d3fec9f9cdcfc167b33"}, + {file = "rapidfuzz-3.6.2-cp312-cp312-win_arm64.whl", hash = "sha256:b593cc51aed887e93b78c2f94dfae9008be2b23d17afd3b1f1d3eb3913b58f26"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:7d830bc7a9b586a374147ec60b08b1f9ae5996b43f75cc514f37faef3866b519"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dbee7f5ff11872b76505cbd87c814abc823e8757f11c69062eb3b25130a283da"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:28c011fb31f2c3f82f503aedd6097d3d3854e574e327a119a3b7eb2cf90b79ca"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cda81d0e0ce0c13abfa46b24e10c1e85f9c6acb628f0a9a948f5779f9c2076a2"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c279928651ce0e9e5220dcb25a00cc53b65e592a0861336a38299bcdca3a596"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:35bd4bc9c40e6994c5d6edea4b9319388b4d9711c13c66d543bb4c37624b4184"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d07899506a5a8760448d9df036d528b55a554bf571714173635c79eef4a86e58"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eb2e51d01b9c6d6954a3e055c57a80d4685b4fc82719db5519fc153566bcd6bb"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:153d065e353371cc0aeff32b99999a5758266a64e958d1364189367c1c9f6814"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4edcceebb85ebfa49a3ddcde20ad891d36c08dc0fd592efdab0e7d313a4e36af"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3549123fca5bb817341025f98e8e49ca99f84596c7c4f92b658f8e5836040d4a"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:84c1032ae42628465b7a5cc35249906061e18a8193c9c27cbd2db54e9823a9a6"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:9bcc91ebd8fc69a6bd3b5711c8250f5f4e70606b4da75ef415f57ad209978205"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-win32.whl", hash = "sha256:f3a70f341c4c111bad910d2df69c78577a98af140319a996af24c9385939335d"}, + {file = "rapidfuzz-3.6.2-cp38-cp38-win_amd64.whl", hash = "sha256:354ad5fe655beb7b279390cb58334903931c5452ecbad1b1666ffb06786498e2"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1b86b93d93020c2b3edc1665d75c8855784845fc0a739b312c26c3a4bf0c80d5"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:28243086ed0e50808bb56632e5442c457241646aeafafd501ac87901f40a3237"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ed52461ae5a9ea4c400d38e2649c74a413f1a6d8fb8308b66f1fbd122514732f"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2a46220f86a5f9cb016af31525e0d0865cad437d02239aa0d8aed2ab8bff1f1c"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:81a630ed2fc3ec5fc7400eb66bab1f87e282b4d47f0abe3e48c6634dfa13b5e4"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d8e5a437b9089df6242a718d9c31ab1742989e9400a0977af012ef483b63b4c2"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:16270b5529de83b7bae7457e952e4d9cf3fbf029a837dd32d415bb9e0eb8e599"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5378c04102c7f084cde30a100154fa6d7e2baf0d51a6bdd2f912545559c1fb35"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7f18397c8d6a65fc0b288d2fc29bc7baeea6ba91eeb95163a3cd98f23cd3bc85"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2acd2514defce81e6ff4bbff50252d5e7df8e85a731442c4b83e44c86cf1c916"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:1df2faf80201952e252413b6fac6f3e146080dcebb87bb1bb722508e67558ed8"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:6440ed0b3007c1c9286b0b88fe2ab2d9e83edd60cd62293b3dfabb732b4e8a30"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4fcfa23b5553b27f4016df77c53172ea743454cf12c28cfa7c35a309a2be93b3"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-win32.whl", hash = "sha256:2d580d937146e803c8e5e1b87916cab8d6f84013b6392713e201efcda335c7d8"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-win_amd64.whl", hash = "sha256:fe2a68be734e8e88af23385c68d6467e15818b6b1df1cbfebf7bff577226c957"}, + {file = "rapidfuzz-3.6.2-cp39-cp39-win_arm64.whl", hash = "sha256:6478f7803efebf5f644d0b758439c5b25728550fdfbb19783d150004c46a75a9"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:36ce7b68a7b90b787cdd73480a68d2f1ca63c31a3a9d5a79a8736f978e1e9344"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53597fd72a9340bcdd80d3620f4957c2b92f9b569313b969a3abdaffd193aae6"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d4f6de745fe6ce46a422d353ee10599013631d7d714a36d025f164b2d4e8c000"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:62df2136068e2515ed8beb01756381ff62c29384d785e3bf46e3111d4ea3ba1e"}, + {file = "rapidfuzz-3.6.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:7382c90170f60c846c81a07ddd80bb2e8c43c8383754486fa37f67391a571897"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:f31314fd2e2f3dc3e519e6f93669462ce7953df2def1c344aa8f5345976d0eb2"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:012221629d54d3bee954148247f711eb86d4d390b589ebfe03172ea0b37a7531"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d41dd59a70decfce6595315367a2fea2af660d92a9d144acc6479030501014d7"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7f9fa14136a5b0cba1ec42531f7c3e0b0d3edb7fd6bc5e5ae7b498541f3855ab"}, + {file = "rapidfuzz-3.6.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:259364199cbfeca33b1af369fc7951f71717aa285184a3fa5a7b1772da1b89db"}, + {file = "rapidfuzz-3.6.2.tar.gz", hash = "sha256:cf911e792ab0c431694c9bf2648afabfd92099103f2e31492893e078ddca5e1a"}, ] [package.extras] @@ -4289,17 +4253,6 @@ files = [ {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, ] -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, -] - [[package]] name = "tomlkit" version = "0.12.4" @@ -4313,13 +4266,13 @@ files = [ [[package]] name = "trove-classifiers" -version = "2024.2.23" +version = "2024.3.3" description = "Canonical source for classifiers on PyPI (pypi.org)." optional = false python-versions = "*" files = [ - {file = "trove-classifiers-2024.2.23.tar.gz", hash = "sha256:8385160a12aac69c93fff058fb613472ed773a24a27eb3cd4b144cfbdd79f38c"}, - {file = "trove_classifiers-2024.2.23-py3-none-any.whl", hash = "sha256:3094534b8021dc1822aadb1d11d4c7b62a854d464d19458fd0a49d6fe2b68b77"}, + {file = "trove-classifiers-2024.3.3.tar.gz", hash = "sha256:df7edff9c67ff86b733628998330b180e81d125b1e096536d83ac0fd79673fdc"}, + {file = "trove_classifiers-2024.3.3-py3-none-any.whl", hash = "sha256:3a84096861b385ec422c79995d1f6435dde47a9b63adaa3c886e53232ba7e6e0"}, ] [[package]] @@ -4427,9 +4380,6 @@ files = [ {file = "vulture-2.11.tar.gz", hash = "sha256:f0fbb60bce6511aad87ee0736c502456737490a82d919a44e6d92262cb35f1c2"}, ] -[package.dependencies] -tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} - [[package]] name = "wcwidth" version = "0.2.13" @@ -4766,22 +4716,7 @@ files = [ idna = ">=2.0" multidict = ">=4.0" -[[package]] -name = "zipp" -version = "3.17.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.8" -files = [ - {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, - {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] - [metadata] lock-version = "2.0" -python-versions = ">=3.9,<3.12" -content-hash = "ed0a2c9f32e010a33a24e243a58550c4849d10ee8205f6c459ecdde57d3509ac" +python-versions = "^3.12.2" +content-hash = "a07cfff84115f019d1026bed53e31a2583b7d2dcdab884c490f141cc2263e677" diff --git a/pyproject.toml b/pyproject.toml index 4b8ab01ef..594c56801 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ readme = "README.md" [tool.poetry.dependencies] -python = ">=3.9,<3.12" +python = "^3.12.2" alembic = "==1.13.1" amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" @@ -40,7 +40,7 @@ marshmallow = "==3.20.2" marshmallow-sqlalchemy = "==0.30.0" newrelic = "*" notifications-python-client = "==9.0.0" -notifications-utils = {git = "https://github.com/GSA/notifications-utils.git"} +notifications-utils = {git = "https://github.com/GSA/notifications-utils.git", rev="c45507d"} oscrypto = "==1.3.0" packaging = "==23.2" poetry-dotenv-plugin = "==0.2.0" From db06484ebfad03062a2d67dbb703ec27b181543a Mon Sep 17 00:00:00 2001 From: samathad2023 Date: Mon, 11 Mar 2024 11:39:13 -0700 Subject: [PATCH 05/38] yml updates --- .github/actions/setup-project/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-project/action.yml b/.github/actions/setup-project/action.yml index 7e92c1546..ac16ab41e 100644 --- a/.github/actions/setup-project/action.yml +++ b/.github/actions/setup-project/action.yml @@ -9,10 +9,10 @@ runs: sudo apt-get update \ && sudo apt-get install -y --no-install-recommends \ libcurl4-openssl-dev - - name: Set up Python 3.9 - uses: actions/setup-python@v3 + - name: Set up Python 3.12 + uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "3.12" - name: Install poetry shell: bash run: pip install --upgrade poetry From d3a87b9ffb40fe8fe94770c1bc175fa78b7390e7 Mon Sep 17 00:00:00 2001 From: samathad2023 Date: Tue, 12 Mar 2024 10:28:31 -0700 Subject: [PATCH 06/38] fix for test_validators --- tests/app/notifications/test_validators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/app/notifications/test_validators.py b/tests/app/notifications/test_validators.py index f2d9cabb8..0678b6535 100644 --- a/tests/app/notifications/test_validators.py +++ b/tests/app/notifications/test_validators.py @@ -498,7 +498,7 @@ def test_check_service_over_api_rate_limit_when_exceed_rate_limit_request_fails_ with pytest.raises(RateLimitError) as e: check_service_over_api_rate_limit(serialised_service, serialised_api_key) - assert app.redis_store.exceeded_rate_limit.called_with( + app.redis_store.exceeded_rate_limit.assert_called_with( f"{sample_service.id}-{api_key.key_type}", sample_service.rate_limit, 60, @@ -527,7 +527,7 @@ def test_check_service_over_api_rate_limit_when_rate_limit_has_not_exceeded_limi )[0] check_service_over_api_rate_limit(serialised_service, serialised_api_key) - assert app.redis_store.exceeded_rate_limit.called_with( + app.redis_store.exceeded_rate_limit.assert_called_with( f"{sample_service.id}-{api_key.key_type}", 3000, 60, From a8640a65b6f73c89866d75b1918e41ca6c1577c1 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 13 Mar 2024 10:52:55 -0700 Subject: [PATCH 07/38] fix email notifications missing personalisation (notify-api-853) --- app/organization/rest.py | 9 +++++++++ app/user/rest.py | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/app/organization/rest.py b/app/organization/rest.py index 7ca9eec8a..8da757cbc 100644 --- a/app/organization/rest.py +++ b/app/organization/rest.py @@ -1,6 +1,9 @@ +import json + from flask import Blueprint, abort, current_app, jsonify, request from sqlalchemy.exc import IntegrityError +from app import redis_store from app.config import QueueNames from app.dao.annual_billing_dao import set_default_free_allowance_for_service from app.dao.dao_utils import transaction @@ -210,6 +213,12 @@ def send_notifications_on_mou_signed(organization_id): reply_to_text=notify_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) personalisation = { diff --git a/app/user/rest.py b/app/user/rest.py index 09ffa17c6..2cbbb9b25 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -140,6 +140,11 @@ def update_user_attribute(user_id): ) 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(data=user_to_update.serialize()), 200 @@ -361,6 +366,12 @@ def create_2fa_code( # Assume that we never want to observe the Notify service's research mode # setting for this notification - we still need to be able to log into the # admin even if we're doing user research using this service: + + redis_store.set( + f"email-personalisation-{saved_notification.id}", + json.dumps(personalisation), + ex=60 * 60, + ) send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) @@ -394,6 +405,11 @@ def send_user_confirm_new_email(user_id): ) 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 @@ -487,6 +503,12 @@ def send_already_registered_email(user_id): current_app.logger.info("Sending notification to queue") + redis_store.set( + f"email-personalisation-{saved_notification.id}", + json.dumps(personalisation), + ex=60 * 60, + ) + send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) current_app.logger.info("Sent notification to queue") @@ -614,6 +636,11 @@ def send_user_reset_password(): ) 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 From e0ed44763f32ab3e4713b8115ac645cf0ce37ae1 Mon Sep 17 00:00:00 2001 From: samathad2023 Date: Wed, 13 Mar 2024 14:21:25 -0700 Subject: [PATCH 08/38] removed dependencies strenum --- app/enums.py | 2 +- poetry.lock | 120 +++++++++++++++++++++---------------------------- pyproject.toml | 1 - 3 files changed, 52 insertions(+), 71 deletions(-) diff --git a/app/enums.py b/app/enums.py index 709fdf323..d135b0c47 100644 --- a/app/enums.py +++ b/app/enums.py @@ -1,4 +1,4 @@ -from strenum import StrEnum # type: ignore [import-not-found] +from enum import StrEnum # type: ignore [import-not-found] # In 3.11 this is in the enum library. We will not need this external library any more. # The line will simply change from importing from strenum to importing from enum. diff --git a/poetry.lock b/poetry.lock index a8799c834..2924a94c1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -223,13 +223,13 @@ s3transfer = ">=0.7.0,<0.8.0" [[package]] name = "bandit" -version = "1.7.7" +version = "1.7.8" description = "Security oriented static analyser for python code." optional = false python-versions = ">=3.8" files = [ - {file = "bandit-1.7.7-py3-none-any.whl", hash = "sha256:17e60786a7ea3c9ec84569fd5aee09936d116cb0cb43151023258340dbffb7ed"}, - {file = "bandit-1.7.7.tar.gz", hash = "sha256:527906bec6088cb499aae31bc962864b4e77569e9d529ee51df3a93b4b8ab28a"}, + {file = "bandit-1.7.8-py3-none-any.whl", hash = "sha256:509f7af645bc0cd8fd4587abc1a038fc795636671ee8204d502b933aee44f381"}, + {file = "bandit-1.7.8.tar.gz", hash = "sha256:36de50f720856ab24a24dbaa5fee2c66050ed97c1477e0a1159deab1775eab6b"}, ] [package.dependencies] @@ -240,6 +240,7 @@ stevedore = ">=1.20.0" [package.extras] baseline = ["GitPython (>=3.1.30)"] +sarif = ["jschema-to-python (>=1.2.3)", "sarif-om (>=1.0.4)"] test = ["beautifulsoup4 (>=4.8.0)", "coverage (>=4.5.4)", "fixtures (>=3.0.0)", "flake8 (>=4.0.0)", "pylint (==1.9.4)", "stestr (>=2.5.0)", "testscenarios (>=0.5.0)", "testtools (>=2.3.0)"] toml = ["tomli (>=1.1.0)"] yaml = ["PyYAML"] @@ -2530,40 +2531,40 @@ files = [ [[package]] name = "newrelic" -version = "9.7.0" +version = "9.7.1" description = "New Relic Python Agent" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*" files = [ - {file = "newrelic-9.7.0-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:bf9485a5c9efaa30c645683eab427ce8b41164213bc003f7e7ad31772eb1f481"}, - {file = "newrelic-9.7.0-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:333ec033d13646f2221fdaf3822d3b8360d1935d1baea6879c1ae7f0d5020217"}, - {file = "newrelic-9.7.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:c005bfb53c7090652839e9b38a3ec2462fe4e125fe976e2b9fcd778efa1c4a12"}, - {file = "newrelic-9.7.0-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:be2a7697b8407cea2ebe962ec990935dff300d9c4f78d3d7335b9dc280d33c53"}, - {file = "newrelic-9.7.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4adf292b529771536b417f46f84c497413f467f1ae7534009404580e259cb1b1"}, - {file = "newrelic-9.7.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d3656b546aced2c6a4443e5e76f89e17a1672d69dfe47940119c688ab4426a76"}, - {file = "newrelic-9.7.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:91e2ad1da28c76d67344daca7ddd6166a5e190f7031f9a5bd683db17542f91ef"}, - {file = "newrelic-9.7.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b180f099aabff875f83364b6314b9954e29dfca753ccc1d353a8135c1430f9a6"}, - {file = "newrelic-9.7.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:27e851365bf5e5f8e7ca21e63d01bd2ce9327afc18417e071a3d50590f2747a8"}, - {file = "newrelic-9.7.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:563342155edbed8276ddef9e2e15a61a31953ff9f42015a426f94660adf104cb"}, - {file = "newrelic-9.7.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0344e718ddc4ffe78a1441c6313a6af2f9aa3001e93a8a5197caac091f8bc9b3"}, - {file = "newrelic-9.7.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e57d78ef1291710968e872412a8d7c765f077de0aaf225aaab216c552ee1775a"}, - {file = "newrelic-9.7.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4bd32c76427782a3cf6994cab1217a1da79327d5b9cb2bad11917df5eb55dc0d"}, - {file = "newrelic-9.7.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:172732a71d4ff053c1c724a8dfbb8b1efc24c398c25e78f7aaf7966551d3fb09"}, - {file = "newrelic-9.7.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:288ed42949fd4a5d535507cb15b8f602111244663eceab1716a0a77e529ee2b6"}, - {file = "newrelic-9.7.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4966e4be00eab203903796a4b5aa864d866ba45d17bf823d71a932f99330ceee"}, - {file = "newrelic-9.7.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8958e575f7ada2ed8937dafff297790aeb960499b08d209b76a8a3c72f0841fc"}, - {file = "newrelic-9.7.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a687a521950da96b7daa553d1ab6371aebc5bfd1f3cb4ceb5d6dc859b0956602"}, - {file = "newrelic-9.7.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:eb94aabd4b575f4fa2068343781614cc249630c8bcbc07f115affeb1311736cd"}, - {file = "newrelic-9.7.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:4cefc2b264122e9f99db557ec9f1c5b287f4b95229957f7f78269cc462d47065"}, - {file = "newrelic-9.7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:59f2c94a2e256f00b344efc909eb1f058cd411e9a95a6ad1d7adf957223a747d"}, - {file = "newrelic-9.7.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb3e40be0f1ba2b2d1ad070d7913952efb1ceee13e6548d63bb973dcdf2c9d32"}, - {file = "newrelic-9.7.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9c41a571d0889409044bfb22194382731e18fd7962ba6a91ff640b274ca3fc1a"}, - {file = "newrelic-9.7.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:78f604a2622a6795320a6ff54262816aeff86da79400429c34346fc5feecb235"}, - {file = "newrelic-9.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bc5af6e7d7b6f30b03cec4f265b84fa8d370e006332854181214507e2deb421e"}, - {file = "newrelic-9.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e229fb5406a3c0752723bc5444d75dc863456a0305621be4159356f2880488e9"}, - {file = "newrelic-9.7.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:b7733168eae4c718f885f188bcfc265c299f51d43130350b32f86f3754bc809b"}, - {file = "newrelic-9.7.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0fdd25b9969a4c85a53a1dc2cade462164c6603e85ffe50da732ad4e69347659"}, - {file = "newrelic-9.7.0.tar.gz", hash = "sha256:e731ac5b66dbeda1e990ba41cecda8ea865c69f72b0267574d6b1727113f7de2"}, + {file = "newrelic-9.7.1-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:1c1d24be69d5316af7be99d6c87686d900e708bc421ca55977cb021fd29de0bd"}, + {file = "newrelic-9.7.1-cp27-cp27m-manylinux2010_x86_64.whl", hash = "sha256:8dba147f13457bd22b4509bfa700ce12bfcb8294f8b9abd4c66d4e90f90cefc2"}, + {file = "newrelic-9.7.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bbbd24bd0054a978b5d6c1be7794289c760b20d44fea526e3fb1078d060a6fe7"}, + {file = "newrelic-9.7.1-cp27-cp27mu-manylinux2010_x86_64.whl", hash = "sha256:7d7f79bd828ab56446b0be941a6acb0af287ad97fe4ac5052c59ad0518f5456d"}, + {file = "newrelic-9.7.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fed29c65100966472bef1603c479b3b60be47078810a0d1c407e5ee133e606d7"}, + {file = "newrelic-9.7.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d85b7d08e7fe130951de1f2225e69c321ece620da18bbc4385905c72e0aa51b"}, + {file = "newrelic-9.7.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:102f6e8e65e6fa5044a0d433066a46ce5b382f96335576dfa16217c1855ebc2b"}, + {file = "newrelic-9.7.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0798e85b738a24843da9aa0e4175b42441d9b10af6b17ee8de137cf83d5bb222"}, + {file = "newrelic-9.7.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:28343d596de29b7b0adcbcd2b872a1657d85c2467482792d8190814faec46c80"}, + {file = "newrelic-9.7.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2a41340ce1d58bcc4dda39784d244e8a42c11b150665d8bec0527ea88bf02f53"}, + {file = "newrelic-9.7.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:7c62934b8ae447bda4273a2dc4c3a65b0c7dc995af611b5003e75a34faa926f2"}, + {file = "newrelic-9.7.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:783c560439a08715eb00c79be64cd9471ce843f07b194592d15978909a8c85ad"}, + {file = "newrelic-9.7.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8d61c374e4d698ee36eab80e33c485054514bd6f57c25cd8e2c9f0a40f159ebc"}, + {file = "newrelic-9.7.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:08a062f6b0483de744b3085e70b88ccb7599ba4f242977bf1cbb602ed4385980"}, + {file = "newrelic-9.7.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:e06c7991367e848c4f8e08e7197b0a71c145a8e32c5f92158ed64b4f6d5b4a22"}, + {file = "newrelic-9.7.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:166e365a6334d6b591a6af91e07dd191f043fb10893474ad1b60ed0b99a78f4e"}, + {file = "newrelic-9.7.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feb83b708350947846fd898debb1538ab5e0458ff56627f01e2174e73c0fe079"}, + {file = "newrelic-9.7.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dfd572a79e1848b67307be25e15f0804b9e9fc30a0d669a0fad668f3678a8869"}, + {file = "newrelic-9.7.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ed776ced21ebf57379cb38885485460ffd7df29cca9666197876d2045849b927"}, + {file = "newrelic-9.7.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:b4f741be5f34e17caa57c72924045776a865efd5f9deab6ebb3b7c4f1190273b"}, + {file = "newrelic-9.7.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:647a5f4ff3514e7e2acbbc884319499b0ae90ec4ec93e83e7f41474cf8666e0e"}, + {file = "newrelic-9.7.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8faecb1fce2a25201f5496ad96181933e60b4b833f99dc143a84d5d2494a46f6"}, + {file = "newrelic-9.7.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:56a6b322b228ee0b3afbb59d686fad0c58b6b284fc6bb3227e7746ca0d458858"}, + {file = "newrelic-9.7.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6361b3be951e3520ea2b138ca56783b03f8a6c85085885fcf597d1ee28c59153"}, + {file = "newrelic-9.7.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82076bf4e84a1378ccd1c699e8890a8f469c3ebeec110ae5c4f03cfab25cd09b"}, + {file = "newrelic-9.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53273e8fbea3df48265b15ce3a5aee8e7950036a8463e973ef949d79072b5d74"}, + {file = "newrelic-9.7.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:365ec3b3795f43a70895652dff4ece28c11ecf0337aabf8da762b746cfda4c2e"}, + {file = "newrelic-9.7.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d143adbc38df9a576a34220d18f564208ddf88f691a1aaaf7b78c7fc653f2428"}, + {file = "newrelic-9.7.1.tar.gz", hash = "sha256:5824e599b972b5931caa13f5f34eb60df4cf3c7048604d0efe34b9ad41923739"}, ] [package.extras] @@ -2743,13 +2744,13 @@ asn1crypto = ">=1.5.1" [[package]] name = "packageurl-python" -version = "0.14.0" +version = "0.15.0" description = "A purl aka. Package URL parser and builder" optional = false python-versions = ">=3.7" files = [ - {file = "packageurl-python-0.14.0.tar.gz", hash = "sha256:ff09147cddaae9e5c59ffcb12df8ec0e1b774b45099399f28c36b1a3dfdf52e2"}, - {file = "packageurl_python-0.14.0-py3-none-any.whl", hash = "sha256:cf5e55cdcd61e6de858f47c4986aa87ba493bfa56ba58de11103dfdc2c00e4e1"}, + {file = "packageurl-python-0.15.0.tar.gz", hash = "sha256:f219b2ce6348185a27bd6a72e6fdc9f984e6c9fa157effa7cb93e341c49cdcc2"}, + {file = "packageurl_python-0.15.0-py3-none-any.whl", hash = "sha256:cdc6bd42dc30c4fc7f8f0ccb721fc31f8c33985dbffccb6e6be4c72874de48ca"}, ] [package.extras] @@ -2807,13 +2808,13 @@ ptyprocess = ">=0.5" [[package]] name = "phonenumbers" -version = "8.13.31" +version = "8.13.32" 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.31-py2.py3-none-any.whl", hash = "sha256:e45d0bc852516a3a6594bcec0ae47b825421a8adcfcf5f114ad148f1523d8646"}, - {file = "phonenumbers-8.13.31.tar.gz", hash = "sha256:2742071c9d0af09274c8a5b2a26d9a36acbf2ea5cb62943cc2ceadb5c0c87641"}, + {file = "phonenumbers-8.13.32-py2.py3-none-any.whl", hash = "sha256:ff8cd0a786fad230d454f35998984c21e501723e22df3fa61e65dbeef0919ced"}, + {file = "phonenumbers-8.13.32.tar.gz", hash = "sha256:947a7e645ee6b77dfdd47d47e2ab5a240f46556bf26d101424cc0bb76c1ca200"}, ] [[package]] @@ -3613,18 +3614,15 @@ full = ["numpy"] [[package]] name = "redis" -version = "5.0.2" +version = "5.0.3" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.7" files = [ - {file = "redis-5.0.2-py3-none-any.whl", hash = "sha256:4caa8e1fcb6f3c0ef28dba99535101d80934b7d4cd541bbb47f4a3826ee472d1"}, - {file = "redis-5.0.2.tar.gz", hash = "sha256:3f82cc80d350e93042c8e6e7a5d0596e4dd68715babffba79492733e1f367037"}, + {file = "redis-5.0.3-py3-none-any.whl", hash = "sha256:5da9b8fe9e1254293756c16c008e8620b3d15fcc6dde6babde9541850e72a32d"}, + {file = "redis-5.0.3.tar.gz", hash = "sha256:4973bae7444c0fbed64a06b87446f79361cb7e4ec1538c022d696ed7a5015580"}, ] -[package.dependencies] -async-timeout = ">=4.0.3" - [package.extras] hiredis = ["hiredis (>=1.0.0)"] ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] @@ -4018,18 +4016,18 @@ jeepney = ">=0.6" [[package]] name = "setuptools" -version = "69.1.1" +version = "69.2.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "setuptools-69.1.1-py3-none-any.whl", hash = "sha256:02fa291a0471b3a18b2b2481ed902af520c69e8ae0919c13da936542754b4c56"}, - {file = "setuptools-69.1.1.tar.gz", hash = "sha256:5c0806c7d9af348e6dd3777b4f4dbb42c7ad85b190104837488eab9a7c945cf8"}, + {file = "setuptools-69.2.0-py3-none-any.whl", hash = "sha256:c21c49fb1042386df081cb5d86759792ab89efca84cf114889191cd09aacc80c"}, + {file = "setuptools-69.2.0.tar.gz", hash = "sha256:0ff4183f8f42cd8fa3acea16c45205521a4ef28f73c6391d8a25e92893134f2e"}, ] [package.extras] docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] +testing = ["build[virtualenv]", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.9)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mypy (==1.9)", "packaging (>=23.2)", "pip (>=19.1)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-ruff (>=0.2.1)", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] testing-integration = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "packaging (>=23.2)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] [[package]] @@ -4226,22 +4224,6 @@ files = [ [package.dependencies] pbr = ">=2.0.0,<2.1.0 || >2.1.0" -[[package]] -name = "strenum" -version = "0.4.15" -description = "An Enum that inherits from str." -optional = false -python-versions = "*" -files = [ - {file = "StrEnum-0.4.15-py3-none-any.whl", hash = "sha256:a30cda4af7cc6b5bf52c8055bc4bf4b2b6b14a93b574626da33df53cf7740659"}, - {file = "StrEnum-0.4.15.tar.gz", hash = "sha256:878fb5ab705442070e4dd1929bb5e2249511c0bcf2b0eeacf3bcd80875c82eff"}, -] - -[package.extras] -docs = ["myst-parser[linkify]", "sphinx", "sphinx-rtd-theme"] -release = ["twine"] -test = ["pylint", "pytest", "pytest-black", "pytest-cov", "pytest-pylint"] - [[package]] name = "toml" version = "0.10.2" @@ -4277,13 +4259,13 @@ files = [ [[package]] name = "types-python-dateutil" -version = "2.8.19.20240106" +version = "2.8.19.20240311" description = "Typing stubs for python-dateutil" optional = false python-versions = ">=3.8" files = [ - {file = "types-python-dateutil-2.8.19.20240106.tar.gz", hash = "sha256:1f8db221c3b98e6ca02ea83a58371b22c374f42ae5bbdf186db9c9a76581459f"}, - {file = "types_python_dateutil-2.8.19.20240106-py3-none-any.whl", hash = "sha256:efbbdc54590d0f16152fa103c9879c7d4a00e82078f6e2cf01769042165acaa2"}, + {file = "types-python-dateutil-2.8.19.20240311.tar.gz", hash = "sha256:51178227bbd4cbec35dc9adffbf59d832f20e09842d7dcb8c73b169b8780b7cb"}, + {file = "types_python_dateutil-2.8.19.20240311-py3-none-any.whl", hash = "sha256:ef813da0809aca76472ca88807addbeea98b19339aebe56159ae2f4b4f70857a"}, ] [[package]] @@ -4719,4 +4701,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "a07cfff84115f019d1026bed53e31a2583b7d2dcdab884c490f141cc2263e677" +content-hash = "bd8b07465b6fd9735dec263d9c1f7a5cef947c12e3974ba5d6117eab4345bcb6" diff --git a/pyproject.toml b/pyproject.toml index 594c56801..7318dd6e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,6 @@ pyjwt = "==2.8.0" python-dotenv = "==1.0.0" sqlalchemy = "==1.4.40" werkzeug = "^3.0.1" -strenum = "^0.4.15" faker = "^23.3.0" From 01df74160997839b2fe77b022c2dfe9c6f5ee56c Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Wed, 13 Mar 2024 16:20:39 -0600 Subject: [PATCH 09/38] Add simulated numbers to allow list in trial mode --- app/service/utils.py | 4 ++++ tests/app/notifications/test_validators.py | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/app/service/utils.py b/app/service/utils.py index 2e22b5309..ac0613096 100644 --- a/app/service/utils.py +++ b/app/service/utils.py @@ -1,5 +1,6 @@ import itertools +from flask import current_app from notifications_utils.recipients import allowed_to_send_to from app.dao.services_dao import dao_fetch_service_by_id @@ -45,6 +46,9 @@ def service_allowed_to_send_to( member.recipient for member in service.guest_list if allow_guest_list_recipients ] + # As per discussion we have decided to allow official simulated + # numbers to go out in trial mode for development purposes. + guest_list_members.extend(current_app.config["SIMULATED_SMS_NUMBERS"]) if (key_type == KeyType.NORMAL and service.restricted) or ( key_type == KeyType.TEAM ): diff --git a/tests/app/notifications/test_validators.py b/tests/app/notifications/test_validators.py index f2d9cabb8..e16d5838e 100644 --- a/tests/app/notifications/test_validators.py +++ b/tests/app/notifications/test_validators.py @@ -34,6 +34,7 @@ from app.serialised_models import ( SerialisedService, SerialisedTemplate, ) +from app.service.utils import service_allowed_to_send_to from app.utils import get_template_instance from app.v2.errors import BadRequestError, RateLimitError, TotalRequestsError from tests.app.db import ( @@ -802,3 +803,21 @@ def test_check_service_over_total_message_limit(mocker, sample_service): sample_service, ) assert service_stats == 0 + + +def test_service_allowed_to_send_to_simulated_numbers(): + trial_mode_service = create_service(service_name="trial mode", restricted=True) + can_send = service_allowed_to_send_to( + "+14254147755", + trial_mode_service, + KeyType.NORMAL, + allow_guest_list_recipients=True, + ) + can_not_send = service_allowed_to_send_to( + "+15555555555", + trial_mode_service, + KeyType.NORMAL, + allow_guest_list_recipients=True, + ) + assert can_send is True + assert can_not_send is False From cf25933cd096d55e7f840e89138c08a514d0a4a0 Mon Sep 17 00:00:00 2001 From: samathad2023 Date: Thu, 14 Mar 2024 11:11:17 -0700 Subject: [PATCH 10/38] remove comments from enums --- app/enums.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/enums.py b/app/enums.py index d135b0c47..a0dfbb467 100644 --- a/app/enums.py +++ b/app/enums.py @@ -1,8 +1,4 @@ -from enum import StrEnum # type: ignore [import-not-found] - -# In 3.11 this is in the enum library. We will not need this external library any more. -# The line will simply change from importing from strenum to importing from enum. -# And the strenum library can then be removed from poetry. +from enum import StrEnum class TemplateType(StrEnum): From c7ff5e44c64c0d9fc15e11ac8ffda215e33c4f17 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 14 Mar 2024 11:27:26 -0700 Subject: [PATCH 11/38] duh --- poetry.lock | 20 ++++++++++---------- pyproject.toml | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/poetry.lock b/poetry.lock index 91c32b2b9..1dbab6175 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2657,11 +2657,11 @@ flask = "^2.3.2" flask-redis = "^0.4.0" geojson = "^3.0.1" govuk-bank-holidays = "^0.13" -idna = "^3.4" +idna = "^3.6" itsdangerous = "^2.1.2" jinja2 = "^3.1.3" jmespath = "^1.0.1" -markupsafe = "^2.1.2" +markupsafe = "^2.1.5" mistune = "==0.8.4" numpy = "^1.24.2" orderedset = "^2.0.3" @@ -2671,7 +2671,7 @@ python-dateutil = "^2.8.2" python-json-logger = "^2.0.7" pytz = "^2023.3" pyyaml = "^6.0" -redis = "^5.0.1" +redis = "^5.0.3" regex = "^2023.10.3" requests = "^2.31.0" s3transfer = "^0.7.0" @@ -2685,8 +2685,8 @@ werkzeug = "^3.0.1" [package.source] type = "git" url = "https://github.com/GSA/notifications-utils.git" -reference = "053fe30" -resolved_reference = "053fe304a1bbc1ae6559869b1fd0a2c3f83981ea" +reference = "HEAD" +resolved_reference = "e421fb1936d4bb92294a11fb78fc81b77d3577b2" [[package]] name = "numpy" @@ -3650,17 +3650,17 @@ full = ["numpy"] [[package]] name = "redis" -version = "5.0.2" +version = "5.0.3" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.7" files = [ - {file = "redis-5.0.2-py3-none-any.whl", hash = "sha256:4caa8e1fcb6f3c0ef28dba99535101d80934b7d4cd541bbb47f4a3826ee472d1"}, - {file = "redis-5.0.2.tar.gz", hash = "sha256:3f82cc80d350e93042c8e6e7a5d0596e4dd68715babffba79492733e1f367037"}, + {file = "redis-5.0.3-py3-none-any.whl", hash = "sha256:5da9b8fe9e1254293756c16c008e8620b3d15fcc6dde6babde9541850e72a32d"}, + {file = "redis-5.0.3.tar.gz", hash = "sha256:4973bae7444c0fbed64a06b87446f79361cb7e4ec1538c022d696ed7a5015580"}, ] [package.dependencies] -async-timeout = ">=4.0.3" +async-timeout = {version = ">=4.0.3", markers = "python_full_version < \"3.11.3\""} [package.extras] hiredis = ["hiredis (>=1.0.0)"] @@ -4785,4 +4785,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "dfa333e33a5f72123b0f8f37d76478d89569a5395c31b052eb867bb9ac40a1b7" +content-hash = "ed0a2c9f32e010a33a24e243a58550c4849d10ee8205f6c459ecdde57d3509ac" diff --git a/pyproject.toml b/pyproject.toml index 3a02d9b5f..4b8ab01ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ marshmallow = "==3.20.2" marshmallow-sqlalchemy = "==0.30.0" newrelic = "*" notifications-python-client = "==9.0.0" -notifications-utils = {git = "https://github.com/GSA/notifications-utils.git", rev="053fe30"} +notifications-utils = {git = "https://github.com/GSA/notifications-utils.git"} oscrypto = "==1.3.0" packaging = "==23.2" poetry-dotenv-plugin = "==0.2.0" From da3c3f250847424d62e52fc28386d2528cd68cce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 19:15:37 +0000 Subject: [PATCH 12/38] Bump moto from 4.2.13 to 5.0.3 Bumps [moto](https://github.com/getmoto/moto) from 4.2.13 to 5.0.3. - [Release notes](https://github.com/getmoto/moto/releases) - [Changelog](https://github.com/getmoto/moto/blob/master/CHANGELOG.md) - [Commits](https://github.com/getmoto/moto/compare/4.2.13...5.0.3) --- updated-dependencies: - dependency-name: moto dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- poetry.lock | 48 +++++++++++++++++++++--------------------------- pyproject.toml | 2 +- 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/poetry.lock b/poetry.lock index 1dbab6175..7566ed1fb 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.7.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -2339,50 +2339,44 @@ files = [ [[package]] name = "moto" -version = "4.2.13" +version = "5.0.3" description = "" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "moto-4.2.13-py2.py3-none-any.whl", hash = "sha256:93e0fd13b624bd79115494f833308c3641b2be0fc9f4f18aa9264aa01f6168e0"}, - {file = "moto-4.2.13.tar.gz", hash = "sha256:01aef6a489a725c8d725bd3dc6f70ff1bedaee3e2641752e4b471ff0ede4b4d7"}, + {file = "moto-5.0.3-py2.py3-none-any.whl", hash = "sha256:261d312d1d69c2afccb450a0566666d7b75d76ed6a7d00aac278a9633b073ff0"}, + {file = "moto-5.0.3.tar.gz", hash = "sha256:070ac2edf89ad7aee28534481ce68e2f344c8a6a8fefec5427eea0d599bfdbdb"}, ] [package.dependencies] boto3 = ">=1.9.201" -botocore = ">=1.12.201" +botocore = ">=1.14.0" cryptography = ">=3.3.1" Jinja2 = ">=2.10.1" python-dateutil = ">=2.1,<3.0.0" requests = ">=2.5" -responses = ">=0.13.0" +responses = ">=0.15.0" werkzeug = ">=0.5,<2.2.0 || >2.2.0,<2.2.1 || >2.2.1" xmltodict = "*" [package.extras] -all = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] -apigateway = ["PyYAML (>=5.1)", "ecdsa (!=0.15)", "openapi-spec-validator (>=0.5.0)", "python-jose[cryptography] (>=3.1.0,<4.0.0)"] -apigatewayv2 = ["PyYAML (>=5.1)"] +all = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.1)", "pyparsing (>=3.0.7)", "setuptools"] +apigateway = ["PyYAML (>=5.1)", "joserfc (>=0.9.0)", "openapi-spec-validator (>=0.5.0)"] +apigatewayv2 = ["PyYAML (>=5.1)", "openapi-spec-validator (>=0.5.0)"] appsync = ["graphql-core"] awslambda = ["docker (>=3.0.0)"] batch = ["docker (>=3.0.0)"] -cloudformation = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] -cognitoidp = ["ecdsa (!=0.15)", "python-jose[cryptography] (>=3.1.0,<4.0.0)"] -ds = ["sshpubkeys (>=3.1.0)"] -dynamodb = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.0)"] -dynamodbstreams = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.0)"] -ebs = ["sshpubkeys (>=3.1.0)"] -ec2 = ["sshpubkeys (>=3.1.0)"] -efs = ["sshpubkeys (>=3.1.0)"] -eks = ["sshpubkeys (>=3.1.0)"] +cloudformation = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.1)", "pyparsing (>=3.0.7)", "setuptools"] +cognitoidp = ["joserfc (>=0.9.0)"] +dynamodb = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.1)"] +dynamodbstreams = ["docker (>=3.0.0)", "py-partiql-parser (==0.5.1)"] glue = ["pyparsing (>=3.0.7)"] iotdata = ["jsondiff (>=1.1.2)"] -proxy = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=2.5.1)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] -resourcegroupstaggingapi = ["PyYAML (>=5.1)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "graphql-core", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "sshpubkeys (>=3.1.0)"] -route53resolver = ["sshpubkeys (>=3.1.0)"] -s3 = ["PyYAML (>=5.1)", "py-partiql-parser (==0.5.0)"] -s3crc32c = ["PyYAML (>=5.1)", "crc32c", "py-partiql-parser (==0.5.0)"] -server = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "ecdsa (!=0.15)", "flask (!=2.2.0,!=2.2.1)", "flask-cors", "graphql-core", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.0)", "pyparsing (>=3.0.7)", "python-jose[cryptography] (>=3.1.0,<4.0.0)", "setuptools", "sshpubkeys (>=3.1.0)"] +proxy = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=2.5.1)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "multipart", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.1)", "pyparsing (>=3.0.7)", "setuptools"] +resourcegroupstaggingapi = ["PyYAML (>=5.1)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.1)", "pyparsing (>=3.0.7)"] +s3 = ["PyYAML (>=5.1)", "py-partiql-parser (==0.5.1)"] +s3crc32c = ["PyYAML (>=5.1)", "crc32c", "py-partiql-parser (==0.5.1)"] +server = ["PyYAML (>=5.1)", "aws-xray-sdk (>=0.93,!=0.96)", "cfn-lint (>=0.40.0)", "docker (>=3.0.0)", "flask (!=2.2.0,!=2.2.1)", "flask-cors", "graphql-core", "joserfc (>=0.9.0)", "jsondiff (>=1.1.2)", "openapi-spec-validator (>=0.5.0)", "py-partiql-parser (==0.5.1)", "pyparsing (>=3.0.7)", "setuptools"] ssm = ["PyYAML (>=5.1)"] xray = ["aws-xray-sdk (>=0.93,!=0.96)", "setuptools"] @@ -2448,7 +2442,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"}, ] @@ -3494,6 +3487,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"}, @@ -4785,4 +4779,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "ed0a2c9f32e010a33a24e243a58550c4849d10ee8205f6c459ecdde57d3509ac" +content-hash = "4f1042e13a7102d29b8580dc80a400907dd596d243318217e5dd28686c3a1f19" diff --git a/pyproject.toml b/pyproject.toml index 4b8ab01ef..434672868 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,7 @@ freezegun = "^1.4.0" honcho = "*" isort = "^5.13.2" jinja2-cli = {version = "==0.8.2", extras = ["yaml"]} -moto = "==4.2.13" +moto = "==5.0.3" pip-audit = "*" pre-commit = "^3.6.0" pytest = "^7.4.4" From 435f23b5f0fcfce47d10dba3c105514fabb4538f Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Thu, 14 Mar 2024 15:15:51 -0400 Subject: [PATCH 13/38] This changeset updates notifications_utils to 0.3.0 to account for other dependency updates. It also accounts for the removal of Celery in utils. Signed-off-by: Carlo Costino --- poetry.lock | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/poetry.lock b/poetry.lock index 1dbab6175..117555c6c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2036,7 +2036,6 @@ description = "Powerful and Pythonic XML processing library combining libxml2/li optional = false python-versions = ">=3.6" files = [ - {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:704f5572ff473a5f897745abebc6df40f22d4133c1e0a1f124e4f2bd3330ff7e"}, {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9d3c0f8567ffe7502d969c2c1b809892dc793b5d0665f602aad19895f8d508da"}, {file = "lxml-5.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5fcfbebdb0c5d8d18b84118842f31965d59ee3e66996ac842e21f957eb76138c"}, {file = "lxml-5.1.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2f37c6d7106a9d6f0708d4e164b707037b7380fcd0b04c5bd9cae1fb46a856fb"}, @@ -2046,7 +2045,6 @@ files = [ {file = "lxml-5.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:82bddf0e72cb2af3cbba7cec1d2fd11fda0de6be8f4492223d4a268713ef2147"}, {file = "lxml-5.1.0-cp310-cp310-win32.whl", hash = "sha256:b66aa6357b265670bb574f050ffceefb98549c721cf28351b748be1ef9577d93"}, {file = "lxml-5.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:4946e7f59b7b6a9e27bef34422f645e9a368cb2be11bf1ef3cafc39a1f6ba68d"}, - {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:14deca1460b4b0f6b01f1ddc9557704e8b365f55c63070463f6c18619ebf964f"}, {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ed8c3d2cd329bf779b7ed38db176738f3f8be637bb395ce9629fc76f78afe3d4"}, {file = "lxml-5.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:436a943c2900bb98123b06437cdd30580a61340fbdb7b28aaf345a459c19046a"}, {file = "lxml-5.1.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acb6b2f96f60f70e7f34efe0c3ea34ca63f19ca63ce90019c6cbca6b676e81fa"}, @@ -2056,7 +2054,6 @@ files = [ {file = "lxml-5.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4c9bda132ad108b387c33fabfea47866af87f4ea6ffb79418004f0521e63204"}, {file = "lxml-5.1.0-cp311-cp311-win32.whl", hash = "sha256:bc64d1b1dab08f679fb89c368f4c05693f58a9faf744c4d390d7ed1d8223869b"}, {file = "lxml-5.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:a5ab722ae5a873d8dcee1f5f45ddd93c34210aed44ff2dc643b5025981908cda"}, - {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9aa543980ab1fbf1720969af1d99095a548ea42e00361e727c58a40832439114"}, {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6f11b77ec0979f7e4dc5ae081325a2946f1fe424148d3945f943ceaede98adb8"}, {file = "lxml-5.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a36c506e5f8aeb40680491d39ed94670487ce6614b9d27cabe45d94cd5d63e1e"}, {file = "lxml-5.1.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f643ffd2669ffd4b5a3e9b41c909b72b2a1d5e4915da90a77e119b8d48ce867a"}, @@ -2082,8 +2079,8 @@ files = [ {file = "lxml-5.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8f52fe6859b9db71ee609b0c0a70fea5f1e71c3462ecf144ca800d3f434f0764"}, {file = "lxml-5.1.0-cp37-cp37m-win32.whl", hash = "sha256:d42e3a3fc18acc88b838efded0e6ec3edf3e328a58c68fbd36a7263a874906c8"}, {file = "lxml-5.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:eac68f96539b32fce2c9b47eb7c25bb2582bdaf1bbb360d25f564ee9e04c542b"}, - {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ae15347a88cf8af0949a9872b57a320d2605ae069bcdf047677318bc0bba45b1"}, {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c26aab6ea9c54d3bed716b8851c8bfc40cb249b8e9880e250d1eddde9f709bf5"}, + {file = "lxml-5.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cfbac9f6149174f76df7e08c2e28b19d74aed90cad60383ad8671d3af7d0502f"}, {file = "lxml-5.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:342e95bddec3a698ac24378d61996b3ee5ba9acfeb253986002ac53c9a5f6f84"}, {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:725e171e0b99a66ec8605ac77fa12239dbe061482ac854d25720e2294652eeaa"}, {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d184e0d5c918cff04cdde9dbdf9600e960161d773666958c9d7b565ccc60c45"}, @@ -2091,7 +2088,6 @@ files = [ {file = "lxml-5.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6d48fc57e7c1e3df57be5ae8614bab6d4e7b60f65c5457915c26892c41afc59e"}, {file = "lxml-5.1.0-cp38-cp38-win32.whl", hash = "sha256:7ec465e6549ed97e9f1e5ed51c657c9ede767bc1c11552f7f4d022c4df4a977a"}, {file = "lxml-5.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:b21b4031b53d25b0858d4e124f2f9131ffc1530431c6d1321805c90da78388d1"}, - {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:52427a7eadc98f9e62cb1368a5079ae826f94f05755d2d567d93ee1bc3ceb354"}, {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6a2a2c724d97c1eb8cf966b16ca2915566a4904b9aad2ed9a09c748ffe14f969"}, {file = "lxml-5.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:843b9c835580d52828d8f69ea4302537337a21e6b4f1ec711a52241ba4a824f3"}, {file = "lxml-5.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9b99f564659cfa704a2dd82d0684207b1aadf7d02d33e54845f9fc78e06b7581"}, @@ -2448,7 +2444,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"}, ] @@ -2634,7 +2629,7 @@ requests = ">=2.0.0" [[package]] name = "notifications-utils" -version = "0.2.9" +version = "0.3.0" description = "" optional = false python-versions = ">=3.9,<3.12" @@ -2686,7 +2681,7 @@ werkzeug = "^3.0.1" type = "git" url = "https://github.com/GSA/notifications-utils.git" reference = "HEAD" -resolved_reference = "e421fb1936d4bb92294a11fb78fc81b77d3577b2" +resolved_reference = "5a623566c7f71db48699cee93415f45317541524" [[package]] name = "numpy" From fee88b86d226c38e9bf1095fdf66448d51634861 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 21:18:07 +0000 Subject: [PATCH 14/38] Bump cachetools from 5.3.2 to 5.3.3 Bumps [cachetools](https://github.com/tkem/cachetools) from 5.3.2 to 5.3.3. - [Changelog](https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst) - [Commits](https://github.com/tkem/cachetools/compare/v5.3.2...v5.3.3) --- updated-dependencies: - dependency-name: cachetools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 14 +++++++++----- pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index f0f3cba1f..02d818868 100644 --- a/poetry.lock +++ b/poetry.lock @@ -491,13 +491,13 @@ redis = ["redis (>=2.10.5)"] [[package]] name = "cachetools" -version = "5.3.2" +version = "5.3.3" description = "Extensible memoizing collections and decorators" optional = false python-versions = ">=3.7" files = [ - {file = "cachetools-5.3.2-py3-none-any.whl", hash = "sha256:861f35a13a451f94e301ce2bec7cac63e881232ccce7ed67fab9b5df4d3beaa1"}, - {file = "cachetools-5.3.2.tar.gz", hash = "sha256:086ee420196f7b2ab9ca2db2520aca326318b68fe5ba8bc4d49cca91add450f2"}, + {file = "cachetools-5.3.3-py3-none-any.whl", hash = "sha256:0abad1021d3f8325b2fc1d2e9c8b9c9d57b04c3932657a72465447332c24d945"}, + {file = "cachetools-5.3.3.tar.gz", hash = "sha256:ba29e2dfa0b8b556606f097407ed1aa62080ee108ab0dc5ec9d6a723a007d105"}, ] [[package]] @@ -2036,6 +2036,7 @@ description = "Powerful and Pythonic XML processing library combining libxml2/li optional = false python-versions = ">=3.6" files = [ + {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:704f5572ff473a5f897745abebc6df40f22d4133c1e0a1f124e4f2bd3330ff7e"}, {file = "lxml-5.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:9d3c0f8567ffe7502d969c2c1b809892dc793b5d0665f602aad19895f8d508da"}, {file = "lxml-5.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5fcfbebdb0c5d8d18b84118842f31965d59ee3e66996ac842e21f957eb76138c"}, {file = "lxml-5.1.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2f37c6d7106a9d6f0708d4e164b707037b7380fcd0b04c5bd9cae1fb46a856fb"}, @@ -2045,6 +2046,7 @@ files = [ {file = "lxml-5.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:82bddf0e72cb2af3cbba7cec1d2fd11fda0de6be8f4492223d4a268713ef2147"}, {file = "lxml-5.1.0-cp310-cp310-win32.whl", hash = "sha256:b66aa6357b265670bb574f050ffceefb98549c721cf28351b748be1ef9577d93"}, {file = "lxml-5.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:4946e7f59b7b6a9e27bef34422f645e9a368cb2be11bf1ef3cafc39a1f6ba68d"}, + {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:14deca1460b4b0f6b01f1ddc9557704e8b365f55c63070463f6c18619ebf964f"}, {file = "lxml-5.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ed8c3d2cd329bf779b7ed38db176738f3f8be637bb395ce9629fc76f78afe3d4"}, {file = "lxml-5.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:436a943c2900bb98123b06437cdd30580a61340fbdb7b28aaf345a459c19046a"}, {file = "lxml-5.1.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:acb6b2f96f60f70e7f34efe0c3ea34ca63f19ca63ce90019c6cbca6b676e81fa"}, @@ -2054,6 +2056,7 @@ files = [ {file = "lxml-5.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4c9bda132ad108b387c33fabfea47866af87f4ea6ffb79418004f0521e63204"}, {file = "lxml-5.1.0-cp311-cp311-win32.whl", hash = "sha256:bc64d1b1dab08f679fb89c368f4c05693f58a9faf744c4d390d7ed1d8223869b"}, {file = "lxml-5.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:a5ab722ae5a873d8dcee1f5f45ddd93c34210aed44ff2dc643b5025981908cda"}, + {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9aa543980ab1fbf1720969af1d99095a548ea42e00361e727c58a40832439114"}, {file = "lxml-5.1.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:6f11b77ec0979f7e4dc5ae081325a2946f1fe424148d3945f943ceaede98adb8"}, {file = "lxml-5.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a36c506e5f8aeb40680491d39ed94670487ce6614b9d27cabe45d94cd5d63e1e"}, {file = "lxml-5.1.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f643ffd2669ffd4b5a3e9b41c909b72b2a1d5e4915da90a77e119b8d48ce867a"}, @@ -2079,8 +2082,8 @@ files = [ {file = "lxml-5.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8f52fe6859b9db71ee609b0c0a70fea5f1e71c3462ecf144ca800d3f434f0764"}, {file = "lxml-5.1.0-cp37-cp37m-win32.whl", hash = "sha256:d42e3a3fc18acc88b838efded0e6ec3edf3e328a58c68fbd36a7263a874906c8"}, {file = "lxml-5.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:eac68f96539b32fce2c9b47eb7c25bb2582bdaf1bbb360d25f564ee9e04c542b"}, + {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ae15347a88cf8af0949a9872b57a320d2605ae069bcdf047677318bc0bba45b1"}, {file = "lxml-5.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c26aab6ea9c54d3bed716b8851c8bfc40cb249b8e9880e250d1eddde9f709bf5"}, - {file = "lxml-5.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cfbac9f6149174f76df7e08c2e28b19d74aed90cad60383ad8671d3af7d0502f"}, {file = "lxml-5.1.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:342e95bddec3a698ac24378d61996b3ee5ba9acfeb253986002ac53c9a5f6f84"}, {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:725e171e0b99a66ec8605ac77fa12239dbe061482ac854d25720e2294652eeaa"}, {file = "lxml-5.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3d184e0d5c918cff04cdde9dbdf9600e960161d773666958c9d7b565ccc60c45"}, @@ -2088,6 +2091,7 @@ files = [ {file = "lxml-5.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6d48fc57e7c1e3df57be5ae8614bab6d4e7b60f65c5457915c26892c41afc59e"}, {file = "lxml-5.1.0-cp38-cp38-win32.whl", hash = "sha256:7ec465e6549ed97e9f1e5ed51c657c9ede767bc1c11552f7f4d022c4df4a977a"}, {file = "lxml-5.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:b21b4031b53d25b0858d4e124f2f9131ffc1530431c6d1321805c90da78388d1"}, + {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:52427a7eadc98f9e62cb1368a5079ae826f94f05755d2d567d93ee1bc3ceb354"}, {file = "lxml-5.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6a2a2c724d97c1eb8cf966b16ca2915566a4904b9aad2ed9a09c748ffe14f969"}, {file = "lxml-5.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:843b9c835580d52828d8f69ea4302537337a21e6b4f1ec711a52241ba4a824f3"}, {file = "lxml-5.1.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9b99f564659cfa704a2dd82d0684207b1aadf7d02d33e54845f9fc78e06b7581"}, @@ -4775,4 +4779,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.12" -content-hash = "4f1042e13a7102d29b8580dc80a400907dd596d243318217e5dd28686c3a1f19" +content-hash = "2d2d43a92e1f61a653f5308d68bee42aea35722f546880f430c2233fd5cf3724" diff --git a/pyproject.toml b/pyproject.toml index 434672868..d64610671 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" boto3 = "^1.29.6" botocore = "^1.32.6" -cachetools = "==5.3.2" +cachetools = "==5.3.3" celery = {version = "==5.3.6", extras = ["redis"]} certifi = ">=2022.12.7" cffi = "==1.16.0" From bf0f002e4fb7193cced16ddeb5b8562ce286e456 Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Fri, 15 Mar 2024 14:26:18 -0400 Subject: [PATCH 15/38] Remove debug lines in CSV processing This changeset removes a couple of debug lines that we had in place from when we switched to processing CSVs for looking at phone numbers. This has now been proven out, and the additional log entries make it difficult to troubleshoot other issues that may arise. Signed-off-by: Carlo Costino --- app/aws/s3.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/aws/s3.py b/app/aws/s3.py index d4c033a63..f80bf6f71 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -114,8 +114,7 @@ def extract_phones(job): job_row = 0 for row in job: row = row.split(",") - current_app.logger.info(f"PHONE INDEX IS NOW {phone_index}") - current_app.logger.info(f"LENGTH OF ROW IS {len(row)}") + if phone_index >= len(row): phones[job_row] = "Unavailable" current_app.logger.error( From 117fa6c1af07582ea22bf474a2e1e7279a3adfa4 Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Fri, 15 Mar 2024 16:16:58 -0400 Subject: [PATCH 16/38] Adjust production worker memory to 1G This changeset adjusts our worker process memory to 1G from 512MB in production. We recently saw memory-related crashes for the Celery worker processes, meaning they did not have enough available to them. This was compounded by an ongoing platform issue with cloud.gov due to Cloud Foundry VMs operating with a Linux kernel that has a memory allocation issue. Fixes for the Linux kernel and Cloud Foundry VMs are in flight and cloud.gov is tracking this closely, but we can help ourselves in the mean time and given the increased usage with pilot partners, it makes sense to adjust this anyway. Signed-off-by: Carlo Costino --- deploy-config/production.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy-config/production.yml b/deploy-config/production.yml index 2152eae42..18ed2a0c3 100644 --- a/deploy-config/production.yml +++ b/deploy-config/production.yml @@ -2,7 +2,7 @@ env: production web_instances: 2 web_memory: 1G worker_instances: 1 -worker_memory: 512M +worker_memory: 1G scheduler_memory: 256M public_api_route: notify-api.app.cloud.gov admin_base_url: https://beta.notify.gov From 5f2508a975104d809dfa0c481b3e0ce800a6e674 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Mon, 18 Mar 2024 11:32:29 -0600 Subject: [PATCH 17/38] Add docs/code comments for message send flow --- app/celery/provider_tasks.py | 9 ++++++++- app/celery/tasks.py | 23 ++++++++++++++++++++++- app/delivery/send_to_providers.py | 6 ++++++ app/job/rest.py | 6 +++++- docs/all.md | 19 ++++++++++++------- 5 files changed, 53 insertions(+), 10 deletions(-) diff --git a/app/celery/provider_tasks.py b/app/celery/provider_tasks.py index 47e4c0bd8..743d37b72 100644 --- a/app/celery/provider_tasks.py +++ b/app/celery/provider_tasks.py @@ -91,6 +91,13 @@ def check_sms_delivery_receipt(self, message_id, notification_id, sent_at): bind=True, name="deliver_sms", max_retries=48, default_retry_delay=300 ) def deliver_sms(self, notification_id): + ''' + This logic will branch off to the final step in delivering + the notification to sns. + Logic is in place for delivery receipts. + Additional logic to help devs output authentication code to + terminal. + ''' try: current_app.logger.info( "Start sending SMS for notification id: {}".format(notification_id) @@ -108,7 +115,7 @@ def deliver_sms(self, notification_id): current_app.logger.warning( ansi_green + f"AUTHENTICATION CODE: {notification.content}" + ansi_reset ) - + # Code branches off to send_to_providers.py message_id = send_to_providers.send_sms_to_provider(notification) # We have to put it in UTC. For other timezones, the delay # will be ignored and it will fire immediately (although this probably only affects developer testing) diff --git a/app/celery/tasks.py b/app/celery/tasks.py index b7cb43c6d..f2bcec884 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -31,6 +31,10 @@ from app.v2.errors import TotalRequestsError @notify_celery.task(name="process-job") def process_job(job_id, sender_id=None): + ''' + We update job status, get the csv data from s3 and begin processing + csv rows. + ''' start = datetime.utcnow() job = dao_get_job_by_id(job_id) current_app.logger.info( @@ -74,6 +78,7 @@ def process_job(job_id, sender_id=None): for row in recipient_csv.get_rows(): process_row(row, template, job, service, sender_id=sender_id) + # End point/Exit point for message send flow. job_complete(job, start=start) @@ -109,6 +114,10 @@ def get_recipient_csv_and_template_and_sender_id(job): def process_row(row, template, job, service, sender_id=None): + ''' + The process will branch off based on notification type, + sms or email. + ''' template_type = template.template_type encrypted = encryption.encrypt( { @@ -121,6 +130,8 @@ def process_row(row, template, job, service, sender_id=None): } ) + # Both save_sms and save_email have the same general + # persist logic. send_fns = {NotificationType.SMS: save_sms, NotificationType.EMAIL: save_email} send_fn = send_fns[template_type] @@ -130,6 +141,7 @@ def process_row(row, template, job, service, sender_id=None): task_kwargs["sender_id"] = sender_id notification_id = create_uuid() + # Kick-off persisting notification in save_sms/save_email. send_fn.apply_async( ( str(service.id), @@ -163,7 +175,14 @@ def __total_sending_limits_for_job_exceeded(service, job, job_id): @notify_celery.task(bind=True, name="save-sms", max_retries=5, default_retry_delay=300) def save_sms(self, service_id, notification_id, encrypted_notification, sender_id=None): + ''' + We are persisting the notification to the db here and + placing notification in queue to send to sns. + ''' notification = encryption.decrypt(encrypted_notification) + # SerialisedService and SerialisedTemplate classes are + # used here to grab the same service and template from the cache + # to improve performance. service = SerialisedService.from_id(service_id) template = SerialisedTemplate.from_id_and_service_id( notification["template"], @@ -177,7 +196,8 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i ).sms_sender else: reply_to_text = template.reply_to_text - + # Return False when trial mode services try sending notifications + # to non-team and non-simulated recipients. if not service_allowed_to_send_to(notification["to"], service, KeyType.NORMAL): current_app.logger.debug( "SMS {} failed as restricted service".format(notification_id) @@ -208,6 +228,7 @@ def save_sms(self, service_id, notification_id, encrypted_notification, sender_i reply_to_text=reply_to_text, ) + # Kick off sns process in provider_tasks.py provider_tasks.deliver_sms.apply_async( [str(saved_notification.id)], queue=QueueNames.SEND_SMS ) diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index 02d657e17..e7ab80fbf 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -22,6 +22,11 @@ from app.serialised_models import SerialisedService, SerialisedTemplate def send_sms_to_provider(notification): + ''' + This is the last step in the message send flow. + We get necessary data for recipient, template, + notification and send it off to the provider. + ''' # we no longer store the personalisation in the db, # need to retrieve from s3 before generating content # However, we are still sending the initial verify code through personalisation @@ -41,6 +46,7 @@ def send_sms_to_provider(notification): return if notification.status == NotificationStatus.CREATED: + # We get the provider here (which is only aws sns) provider = provider_to_use(NotificationType.SMS, notification.international) if not provider: technical_failure(notification=notification) diff --git a/app/job/rest.py b/app/job/rest.py index c53a82296..48a456ec4 100644 --- a/app/job/rest.py +++ b/app/job/rest.py @@ -166,6 +166,10 @@ def get_jobs_by_service(service_id): @job_blueprint.route("", methods=["POST"]) def create_job(service_id): + ''' + Entry point from UI for one-off messages + as well as CSV uploads. + ''' service = dao_fetch_service_by_id(service_id) if not service.active: raise InvalidRequest("Create job is not allowed: service is inactive ", 403) @@ -204,7 +208,7 @@ def create_job(service_id): dao_create_job(job) sender_id = data.get("sender_id") - + # Kick off job in tasks.py if job.job_status == JobStatus.PENDING: process_job.apply_async( [str(job.id)], {"sender_id": sender_id}, queue=QueueNames.JOBS diff --git a/docs/all.md b/docs/all.md index e20f127cb..5a87cba95 100644 --- a/docs/all.md +++ b/docs/all.md @@ -542,19 +542,24 @@ All commands use the `-g` or `--generate` to determine how many instances to loa # How messages are queued and sent +Services used during message-send flow: +1. AWS S3 +2. AWS SNS +3. AWS Cloudwatch +4. Redis +5. PostgreSQL + There are several ways for notifications to come into the API. - Messages sent through the API enter through `app/notifications/post_notifications.py` -- One-off messages sent from the UI enter through `create_one_off_notification` in `app/service/rest.py` -- CSV uploads enter through `app/job/rest.py` +- One-off messages and CSV uploads both enter from the UI through `app/job/rest.py:create_job` -API messages and one-off UI messages come in one at a time, and take slightly-separate routes -that both end up at `persist_notification`, which writes to the database, and `provider_tasks.deliver_sms`, +API messages come in one at a time, and end up at `persist_notification`, which writes to the database, and `provider_tasks.deliver_sms`, which enqueues the sending. -For CSV uploads, the CSV is first stored in S3 and queued as a `Job`. When the job runs, it iterates -through the rows, running `process_job.save_sms` to send notifications through `persist_notification` and -`provider_tasks.deliver_sms`. +One-off messages and batch messages both upload a CSV, which are then first stored in S3 and queued as a `Job`. When the job runs, it iterates +through the rows from `tasks.py:process_row`, running `tasks.py:save_sms` (email notifications branch off through `tasks.py:save_email`) to write to the db with `persist_notification` and begin the process of delivering the notification to the provider +through `provider_tasks.deliver_sms`. The exit point to the provider is in `send_to_providers.py:send_sms`. # Writing public APIs From 6599c284cca4495f89a35b7f1bf351a02d23e0c3 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Mon, 18 Mar 2024 11:45:40 -0600 Subject: [PATCH 18/38] Add docs/code comments for message-send-flow --- app/celery/provider_tasks.py | 4 ++-- app/celery/tasks.py | 12 ++++++------ app/delivery/send_to_providers.py | 4 ++-- app/job/rest.py | 4 ++-- migrations/versions/0410_enums_for_everything.py | 6 ++++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/celery/provider_tasks.py b/app/celery/provider_tasks.py index 743d37b72..e8d120a56 100644 --- a/app/celery/provider_tasks.py +++ b/app/celery/provider_tasks.py @@ -91,13 +91,13 @@ def check_sms_delivery_receipt(self, message_id, notification_id, sent_at): bind=True, name="deliver_sms", max_retries=48, default_retry_delay=300 ) def deliver_sms(self, notification_id): - ''' + """ This logic will branch off to the final step in delivering the notification to sns. Logic is in place for delivery receipts. Additional logic to help devs output authentication code to terminal. - ''' + """ try: current_app.logger.info( "Start sending SMS for notification id: {}".format(notification_id) diff --git a/app/celery/tasks.py b/app/celery/tasks.py index f2bcec884..540e29177 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -31,10 +31,10 @@ from app.v2.errors import TotalRequestsError @notify_celery.task(name="process-job") def process_job(job_id, sender_id=None): - ''' + """ We update job status, get the csv data from s3 and begin processing csv rows. - ''' + """ start = datetime.utcnow() job = dao_get_job_by_id(job_id) current_app.logger.info( @@ -114,10 +114,10 @@ def get_recipient_csv_and_template_and_sender_id(job): def process_row(row, template, job, service, sender_id=None): - ''' + """ The process will branch off based on notification type, sms or email. - ''' + """ template_type = template.template_type encrypted = encryption.encrypt( { @@ -175,10 +175,10 @@ def __total_sending_limits_for_job_exceeded(service, job, job_id): @notify_celery.task(bind=True, name="save-sms", max_retries=5, default_retry_delay=300) def save_sms(self, service_id, notification_id, encrypted_notification, sender_id=None): - ''' + """ We are persisting the notification to the db here and placing notification in queue to send to sns. - ''' + """ notification = encryption.decrypt(encrypted_notification) # SerialisedService and SerialisedTemplate classes are # used here to grab the same service and template from the cache diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index e7ab80fbf..5e9373a60 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -22,11 +22,11 @@ from app.serialised_models import SerialisedService, SerialisedTemplate def send_sms_to_provider(notification): - ''' + """ This is the last step in the message send flow. We get necessary data for recipient, template, notification and send it off to the provider. - ''' + """ # we no longer store the personalisation in the db, # need to retrieve from s3 before generating content # However, we are still sending the initial verify code through personalisation diff --git a/app/job/rest.py b/app/job/rest.py index 48a456ec4..46fe698da 100644 --- a/app/job/rest.py +++ b/app/job/rest.py @@ -166,10 +166,10 @@ def get_jobs_by_service(service_id): @job_blueprint.route("", methods=["POST"]) def create_job(service_id): - ''' + """ Entry point from UI for one-off messages as well as CSV uploads. - ''' + """ service = dao_fetch_service_by_id(service_id) if not service.active: raise InvalidRequest("Create job is not allowed: service is inactive ", 403) diff --git a/migrations/versions/0410_enums_for_everything.py b/migrations/versions/0410_enums_for_everything.py index b6c9042c6..4467e0e9d 100644 --- a/migrations/versions/0410_enums_for_everything.py +++ b/migrations/versions/0410_enums_for_everything.py @@ -469,7 +469,8 @@ def upgrade(): postgresql_using=enum_using("notification_type", NotificationType), ) # Clobbering bad data here. These are values we don't use any more, and anything with them is unnecessary. - op.execute(""" + op.execute( + """ delete from service_permissions where @@ -480,7 +481,8 @@ def upgrade(): 'international_letters', 'broadcast' ); - """) + """ + ) op.alter_column( "service_permissions", "permission", From 93d9ab62e4a2846ae1a358961f4e2de8ff3924ec Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 19 Mar 2024 07:34:23 -0700 Subject: [PATCH 19/38] login.gov first time workflow notify-api-1250 --- app/organization/invite_rest.py | 5 +---- app/service_invite/rest.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/organization/invite_rest.py b/app/organization/invite_rest.py index 41b2b4660..84a9387fd 100644 --- a/app/organization/invite_rest.py +++ b/app/organization/invite_rest.py @@ -58,10 +58,7 @@ def invite_user_to_org(organization_id): else invited_org_user.invited_by.name ), "organization_name": invited_org_user.organization.name, - "url": invited_org_user_url( - invited_org_user.id, - data.get("invite_link_host"), - ), + "url": "https://idp.int.identitysandbox.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop", # noqa } saved_notification = persist_notification( template_id=template.id, diff --git a/app/service_invite/rest.py b/app/service_invite/rest.py index 5743cd396..b7782f440 100644 --- a/app/service_invite/rest.py +++ b/app/service_invite/rest.py @@ -39,7 +39,7 @@ def _create_service_invite(invited_user, invite_link_host): personalisation = { "user_name": invited_user.from_user.name, "service_name": invited_user.service.name, - "url": invited_user_url(invited_user.id, invite_link_host), + "url": "https://idp.int.identitysandbox.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop", # noqa } saved_notification = persist_notification( From aa0b2e49e16252868e7834572d324207ed9337df Mon Sep 17 00:00:00 2001 From: samathad2023 Date: Tue, 19 Mar 2024 09:18:46 -0700 Subject: [PATCH 20/38] README updates --- README.md | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 78e542a9a..79d43c217 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ You will need the following items: This project currently works with these major versions of the following main components: -- Python 3.9.x +- Python 3.12.x - PostgreSQL 15.x (version 12.x is used in the hosted environments) These instructions will walk you through how to set your machine up with all of @@ -175,12 +175,12 @@ session to make the changes take effect. Now we're ready to install the Python version we need with `pyenv`, like so: ```sh -pyenv install 3.9 +pyenv install 3.12 ``` -This will install the latest version of Python 3.9. +This will install the latest version of Python 3.12. -_NOTE: This project currently runs on Python 3.9.x._ +_NOTE: This project currently runs on Python 3.12.x._ #### Python Dependency Installation @@ -261,16 +261,16 @@ git clone git@github.com:GSA/notifications-api.git Now go into the project directory (`notifications-api` by default), create a virtual environment, and set the local Python version to point to the virtual -environment (assumes version Python `3.9.18` is what is installed on your +environment (assumes version Python `3.12.2` is what is installed on your machine): ```sh cd notifications-api -pyenv virtualenv 3.9.18 notify-api +pyenv virtualenv 3.12.2 notify-api pyenv local notify-api ``` -_If you're not sure which version of Python was installed with `pyenv`, you can check by running `pyenv versions` and it'll list everything available currently._ +_If you're not sure which version of Python was installed with `pyenv`, you can check by running `pyenv versions` and it'll list everything available currently.You should see the virtual environment name in terminal as 'notify-api'._ Now [log into cloud.gov](https://cloud.gov/docs/getting-started/setup/#set-up-the-command-line) in the command line by using this command: @@ -301,6 +301,31 @@ brew services start postgresql@15 brew services start redis ``` + +### Switching to different environment + +Once all of pre-requisites for the project are installed and to switch to newer environment with newer python version follow the below steps to create new virtual environment. + +First install the newer Python version we need with `pyenv`, (say the planned upgrade to 3.15) like so : + +```sh +pyenv install 3.15 +``` + +Now go into the project directory (`notifications-api` by default), create a +virtual environment, and set the local Python version to point to the virtual +environment (assumes version Python `3.15.2` is what is installed on your +machine): + +```sh +cd notifications-api +pyenv virtualenv 3.15.2 notify-api-upgrade +pyenv local notify-api-upgrade +``` + +_If you're not sure which version of Python was installed with `pyenv`, you can check by running `pyenv versions` and it'll list everything available currently.you can deactivate the current environment by running `source deactivate` or `deactivate`.Close the terminal and reopen a new terminal should see the newer virtual environment name in terminal as 'notify-api-upgrade'. you can the get python version ,executable, and other details for this environment by running `poetry env info`._ + + ### Final environment setup There's one final thing to adjust in the newly created `.env` file. This From 1a9800f9245229caf02f9b3c263e79470c9ac5cf Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 19 Mar 2024 13:23:22 -0700 Subject: [PATCH 21/38] fix tests --- app/organization/invite_rest.py | 3 ++- app/service_invite/rest.py | 3 ++- tests/app/organization/test_invite_rest.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/organization/invite_rest.py b/app/organization/invite_rest.py index 84a9387fd..2d14c771a 100644 --- a/app/organization/invite_rest.py +++ b/app/organization/invite_rest.py @@ -1,4 +1,5 @@ import json +import os from flask import Blueprint, current_app, jsonify, request from itsdangerous import BadData, SignatureExpired @@ -58,7 +59,7 @@ def invite_user_to_org(organization_id): else invited_org_user.invited_by.name ), "organization_name": invited_org_user.organization.name, - "url": "https://idp.int.identitysandbox.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop", # noqa + "url": os.environ["LOGIN_DOT_GOV_REGISTRATION_URL"], } saved_notification = persist_notification( template_id=template.id, diff --git a/app/service_invite/rest.py b/app/service_invite/rest.py index b7782f440..641ea3865 100644 --- a/app/service_invite/rest.py +++ b/app/service_invite/rest.py @@ -1,4 +1,5 @@ import json +import os from datetime import datetime from flask import Blueprint, current_app, jsonify, request @@ -39,7 +40,7 @@ def _create_service_invite(invited_user, invite_link_host): personalisation = { "user_name": invited_user.from_user.name, "service_name": invited_user.service.name, - "url": "https://idp.int.identitysandbox.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop", # noqa + "url": os.environ["LOGIN_DOT_GOV_REGISTRATION_URL"], } saved_notification = persist_notification( diff --git a/tests/app/organization/test_invite_rest.py b/tests/app/organization/test_invite_rest.py index a68ec409f..5deed71ff 100644 --- a/tests/app/organization/test_invite_rest.py +++ b/tests/app/organization/test_invite_rest.py @@ -67,8 +67,8 @@ def test_create_invited_org_user( assert len(notification.personalisation.keys()) == 3 assert notification.personalisation["organization_name"] == "sample organization" assert notification.personalisation["user_name"] == expected_invited_by - assert notification.personalisation["url"].startswith(expected_start_of_invite_url) - assert len(notification.personalisation["url"]) > len(expected_start_of_invite_url) + # assert notification.personalisation["url"].startswith(expected_start_of_invite_url) + # assert len(notification.personalisation["url"]) > len(expected_start_of_invite_url) mocked.assert_called_once_with( [(str(notification.id))], queue="notify-internal-tasks" From 4335b61b6e9df7784011dc66e0a8aa987a52c867 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 19 Mar 2024 13:59:55 -0700 Subject: [PATCH 22/38] fix tests --- .github/workflows/deploy-demo.yml | 3 +++ .github/workflows/deploy-prod.yml | 3 +++ .github/workflows/deploy.yml | 2 ++ manifest.yml | 1 + tests/app/organization/test_invite_rest.py | 2 ++ 5 files changed, 11 insertions(+) diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index b634871f3..25ea1b82d 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -57,6 +57,8 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set_up_your_profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} cf_password: ${{ secrets.CLOUDGOV_PASSWORD }} @@ -70,6 +72,7 @@ jobs: --var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY" --var NOTIFY_E2E_TEST_EMAIL="$NOTIFY_E2E_TEST_EMAIL" --var NOTIFY_E2E_TEST_PASSWORD="$NOTIFY_E2E_TEST_PASSWORD" + --var LOGIN_DOT_GOV_REGISTRATION_URL="$LOGIN_DOT_GOV_REGISTRATION_URL" - name: Check for changes to egress config id: changed-egress-config diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index ac3846497..b01f4b271 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -61,6 +61,8 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set_up_your_profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} cf_password: ${{ secrets.CLOUDGOV_PASSWORD }} @@ -74,6 +76,7 @@ jobs: --var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY" --var NOTIFY_E2E_TEST_EMAIL="$NOTIFY_E2E_TEST_EMAIL" --var NOTIFY_E2E_TEST_PASSWORD="$NOTIFY_E2E_TEST_PASSWORD" + --var LOGIN_DOT_GOV_REGISTRATION_URL="$LOGIN_DOT_GOV_REGISTRATION_URL" - name: Check for changes to egress config id: changed-egress-config diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 7e8d2bc9e..108e06efd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -62,6 +62,7 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set_up_your_profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} cf_password: ${{ secrets.CLOUDGOV_PASSWORD }} @@ -75,6 +76,7 @@ jobs: --var NEW_RELIC_LICENSE_KEY="$NEW_RELIC_LICENSE_KEY" --var NOTIFY_E2E_TEST_EMAIL="$NOTIFY_E2E_TEST_EMAIL" --var NOTIFY_E2E_TEST_PASSWORD="$NOTIFY_E2E_TEST_PASSWORD" + --var LOGIN_DOT_GOV_REGISTRATION_URL="$LOGIN_DOT_GOV_REGISTRATION_URL" - name: Check for changes to egress config id: changed-egress-config diff --git a/manifest.yml b/manifest.yml index eb42d7a74..e026ea09b 100644 --- a/manifest.yml +++ b/manifest.yml @@ -46,6 +46,7 @@ applications: ADMIN_BASE_URL: ((admin_base_url)) NOTIFY_E2E_TEST_EMAIL: ((NOTIFY_E2E_TEST_EMAIL)) NOTIFY_E2E_TEST_PASSWORD: ((NOTIFY_E2E_TEST_PASSWORD)) + LOGIN_DOT_GOV_REGISTRATION_URL: ((LOGIN_DOT_GOV_REGISTRATION_URL)) # Credentials variables INTERNAL_CLIENT_API_KEYS: '{"notify-admin":["((ADMIN_CLIENT_SECRET))"]}' diff --git a/tests/app/organization/test_invite_rest.py b/tests/app/organization/test_invite_rest.py index 5deed71ff..0783b0c62 100644 --- a/tests/app/organization/test_invite_rest.py +++ b/tests/app/organization/test_invite_rest.py @@ -1,3 +1,4 @@ +import os import uuid import pytest @@ -36,6 +37,7 @@ def test_create_invited_org_user( platform_admin, expected_invited_by, ): + os.environ["LOGIN_DOT_GOV_REGISTRATION_URL"] = "http://foo.fake.gov" mocked = mocker.patch("app.celery.provider_tasks.deliver_email.apply_async") email_address = "invited_user@example.com" sample_user.platform_admin = platform_admin From 26af8339a254f35158ec62115b02f48161f2a543 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 19 Mar 2024 14:36:22 -0700 Subject: [PATCH 23/38] fix link --- .github/workflows/deploy-demo.yml | 2 +- .github/workflows/deploy-prod.yml | 2 +- .github/workflows/deploy.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 25ea1b82d..9339cd774 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -57,7 +57,7 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set_up_your_profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index b01f4b271..f3de71b3f 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -61,7 +61,7 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set_up_your_profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 108e06efd..a43a0bb5e 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -62,7 +62,7 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set_up_your_profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} cf_password: ${{ secrets.CLOUDGOV_PASSWORD }} From 41c6b19877498e8b30cf19a8dcf76afce14e8bc4 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 20 Mar 2024 08:11:37 -0700 Subject: [PATCH 24/38] fix urls --- .github/workflows/deploy-demo.yml | 2 +- .github/workflows/deploy-prod.yml | 2 +- .github/workflows/deploy.yml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 9339cd774..1d2a7d4ac 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -57,7 +57,7 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=https://notify-demo.app.cloud.gov/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index f3de71b3f..8e18d729b 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -61,7 +61,7 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=https://beta.notify.gov/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a43a0bb5e..24c9118b3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -62,7 +62,8 @@ jobs: NEW_RELIC_LICENSE_KEY: ${{ secrets.NEW_RELIC_LICENSE_KEY }} NOTIFY_E2E_TEST_EMAIL: ${{ secrets.NOTIFY_E2E_TEST_EMAIL }} NOTIFY_E2E_TEST_PASSWORD: ${{ secrets.NOTIFY_E2E_TEST_PASSWORD }} - LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:test_notify_gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=http://localhost:6012/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + LOGIN_DOT_GOV_REGISTRATION_URL: "https://secure.login.gov/openid_connect/authorize?acr_values=http%3A%2F%2Fidmanagement.gov%2Fns%2Fassurance%2Fial%2F1&client_id=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:notify-gov&nonce=01234567890123456789012345&prompt=select_account&redirect_uri=https://notify-staging.app.cloud.gov/set-up-your-profile&response_type=code&scope=openid+email&state=abcdefghijklmnopabcdefghijklmnop" + with: cf_username: ${{ secrets.CLOUDGOV_USERNAME }} cf_password: ${{ secrets.CLOUDGOV_PASSWORD }} From 61ce2b08b87ca69451001eaa850251cebb36596b Mon Sep 17 00:00:00 2001 From: samathad2023 Date: Thu, 21 Mar 2024 13:02:54 -0700 Subject: [PATCH 25/38] utils dependencies updates --- README.md | 32 ++++++++++++++++++++------------ poetry.lock | 8 ++++---- pyproject.toml | 2 +- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7f38655c1..bb38882df 100644 --- a/README.md +++ b/README.md @@ -301,30 +301,38 @@ brew services start postgresql@15 brew services start redis ``` +#### Upgrading Python in existing projects -### Switching to different environment +If you're upgrading an existing project to a newer version of Python, you can +follow these steps to get yourself up-to-date. -Once all of pre-requisites for the project are installed and for first time setup or if you're upgrading an existing project to newer environment with newer python version follow below steps to create new virtual environment. - -First install the newer Python version we need with `pyenv`, (say the planned upgrade to 3.15) like so : +First, use `pyenv` to install the newer version of Python you'd like to use; +we'll use `3.12` in our example here since we recently upgraded to this version: ```sh pyenv install 3.12 ``` -Now go into the project directory (`notifications-api` by default), create a -virtual environment, and set the local Python version to point to the virtual -environment (assumes version Python `3.12.2` is what is installed on your -machine): +Next, delete the virtual environment you previously had set up. If you followed +the instructions above with the first-time set up, you can do this with `pyenv`: + +```sh +pyenv virtualenv-delete notify-api +``` + +Now, make sure you are in your project directory and recreate the same virtual +environment with the newer version of Python you just installed: ```sh cd notifications-api -pyenv virtualenv 3.12.2 notify-api-upgrade -pyenv local notify-api-upgrade +pyenv virtualenv 3.12.2 notify-api +pyenv local notify-api ``` -_If you're not sure which version of Python was installed with `pyenv`, you can check by running `pyenv versions` and it'll list everything available currently.You can deactivate the current environment by running `source deactivate` or `deactivate`.Close the shell session and reopen a new shell session should show the newer virtual environment._ -_You can get version,executable, and other details for any environment by running `poetry env info`._ +At this point, proceed with the rest of the instructions here in the README and +you'll be set with an upgraded version of Python. + +_If you're not sure about the details of your current virtual environment, you can run `poetry env info` to get more information. If you've been using `pyenv` for everything, you can also see all available virtual environments with `pyenv virtualenvs`._ ### Final environment setup diff --git a/poetry.lock b/poetry.lock index 6ae5deea5..64108e397 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2595,7 +2595,7 @@ requests = ">=2.0.0" [[package]] name = "notifications-utils" -version = "0.3.0" +version = "0.4.0" description = "" optional = false python-versions = "^3.12.2" @@ -2646,8 +2646,8 @@ werkzeug = "^3.0.1" [package.source] type = "git" url = "https://github.com/GSA/notifications-utils.git" -reference = "341886d" -resolved_reference = "341886df778842aaaeefe2a3bad4d7878bb655b9" +reference = "HEAD" +resolved_reference = "4cf526bc1fd9532507936c174418dbd3be52c925" [[package]] name = "numpy" @@ -4695,4 +4695,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "17452ec954f93a8488cf8e34b1a3bba9d8f0a8a234078a5713655955c9e3d247" +content-hash = "4146fba7b1b851dfdca41511a2e7239ed11999b293fa7312c5d57a296a375fd5" diff --git a/pyproject.toml b/pyproject.toml index 7c3f90c83..0309642fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ marshmallow = "==3.20.2" marshmallow-sqlalchemy = "==0.30.0" newrelic = "*" notifications-python-client = "==9.0.0" -notifications-utils = {git = "https://github.com/GSA/notifications-utils.git", rev="341886d"} +notifications-utils = {git = "https://github.com/GSA/notifications-utils.git"} oscrypto = "==1.3.0" packaging = "==23.2" poetry-dotenv-plugin = "==0.2.0" From 8e4968e7035861220449bd0a49bef5b32964ecca Mon Sep 17 00:00:00 2001 From: Carlo Costino Date: Thu, 21 Mar 2024 17:44:30 -0400 Subject: [PATCH 26/38] Update Cloud Foundry runtime.txt file This changeset updates the runtime.txt file so that Cloud Foundry picks up Python 3.12.x instead of Python 3.9.x Signed-off-by: Carlo Costino --- runtime.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime.txt b/runtime.txt index 305091cae..64f28603a 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.9.x +python-3.12.x From b546e833992622865e1e97cc3eadb877c31ce2dc Mon Sep 17 00:00:00 2001 From: Cliff Hill Date: Fri, 22 Mar 2024 12:04:49 -0400 Subject: [PATCH 27/38] Making setuptools a regular dependency. Signed-off-by: Cliff Hill --- poetry.lock | 4 ++-- pyproject.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index 64108e397..54e2b2c50 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2410,7 +2410,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"}, ] [[package]] @@ -4695,4 +4695,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "4146fba7b1b851dfdca41511a2e7239ed11999b293fa7312c5d57a296a375fd5" +content-hash = "9aa9831a1e257899f1504bc7b252f796fa0beaf51367e4c43a3d6de4108d5f54" diff --git a/pyproject.toml b/pyproject.toml index 0309642fb..7f03f943c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,6 +50,7 @@ python-dotenv = "==1.0.0" sqlalchemy = "==1.4.40" werkzeug = "^3.0.1" faker = "^23.3.0" +setuptools = "^69.2.0" [tool.poetry.group.dev.dependencies] From a365a36eb516f875dbad8dd75f6467948b8d8c3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:30:00 +0000 Subject: [PATCH 28/38] Bump black from 23.12.1 to 24.3.0 Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.3.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/23.12.1...24.3.0) --- updated-dependencies: - dependency-name: black dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- poetry.lock | 50 +++++++++++++++++++++++++------------------------- pyproject.toml | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/poetry.lock b/poetry.lock index 54e2b2c50..992392796 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.7.1 and should not be changed by hand. [[package]] name = "aiohttp" @@ -319,33 +319,33 @@ files = [ [[package]] name = "black" -version = "23.12.1" +version = "24.3.0" description = "The uncompromising code formatter." optional = false python-versions = ">=3.8" files = [ - {file = "black-23.12.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e0aaf6041986767a5e0ce663c7a2f0e9eaf21e6ff87a5f95cbf3675bfd4c41d2"}, - {file = "black-23.12.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c88b3711d12905b74206227109272673edce0cb29f27e1385f33b0163c414bba"}, - {file = "black-23.12.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a920b569dc6b3472513ba6ddea21f440d4b4c699494d2e972a1753cdc25df7b0"}, - {file = "black-23.12.1-cp310-cp310-win_amd64.whl", hash = "sha256:3fa4be75ef2a6b96ea8d92b1587dd8cb3a35c7e3d51f0738ced0781c3aa3a5a3"}, - {file = "black-23.12.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8d4df77958a622f9b5a4c96edb4b8c0034f8434032ab11077ec6c56ae9f384ba"}, - {file = "black-23.12.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:602cfb1196dc692424c70b6507593a2b29aac0547c1be9a1d1365f0d964c353b"}, - {file = "black-23.12.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c4352800f14be5b4864016882cdba10755bd50805c95f728011bcb47a4afd59"}, - {file = "black-23.12.1-cp311-cp311-win_amd64.whl", hash = "sha256:0808494f2b2df923ffc5723ed3c7b096bd76341f6213989759287611e9837d50"}, - {file = "black-23.12.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:25e57fd232a6d6ff3f4478a6fd0580838e47c93c83eaf1ccc92d4faf27112c4e"}, - {file = "black-23.12.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d9e13db441c509a3763a7a3d9a49ccc1b4e974a47be4e08ade2a228876500ec"}, - {file = "black-23.12.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d1bd9c210f8b109b1762ec9fd36592fdd528485aadb3f5849b2740ef17e674e"}, - {file = "black-23.12.1-cp312-cp312-win_amd64.whl", hash = "sha256:ae76c22bde5cbb6bfd211ec343ded2163bba7883c7bc77f6b756a1049436fbb9"}, - {file = "black-23.12.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1fa88a0f74e50e4487477bc0bb900c6781dbddfdfa32691e780bf854c3b4a47f"}, - {file = "black-23.12.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a4d6a9668e45ad99d2f8ec70d5c8c04ef4f32f648ef39048d010b0689832ec6d"}, - {file = "black-23.12.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b18fb2ae6c4bb63eebe5be6bd869ba2f14fd0259bda7d18a46b764d8fb86298a"}, - {file = "black-23.12.1-cp38-cp38-win_amd64.whl", hash = "sha256:c04b6d9d20e9c13f43eee8ea87d44156b8505ca8a3c878773f68b4e4812a421e"}, - {file = "black-23.12.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3e1b38b3135fd4c025c28c55ddfc236b05af657828a8a6abe5deec419a0b7055"}, - {file = "black-23.12.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4f0031eaa7b921db76decd73636ef3a12c942ed367d8c3841a0739412b260a54"}, - {file = "black-23.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:97e56155c6b737854e60a9ab1c598ff2533d57e7506d97af5481141671abf3ea"}, - {file = "black-23.12.1-cp39-cp39-win_amd64.whl", hash = "sha256:dd15245c8b68fe2b6bd0f32c1556509d11bb33aec9b5d0866dd8e2ed3dba09c2"}, - {file = "black-23.12.1-py3-none-any.whl", hash = "sha256:78baad24af0f033958cad29731e27363183e140962595def56423e626f4bee3e"}, - {file = "black-23.12.1.tar.gz", hash = "sha256:4ce3ef14ebe8d9509188014d96af1c456a910d5b5cbf434a09fef7e024b3d0d5"}, + {file = "black-24.3.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7d5e026f8da0322b5662fa7a8e752b3fa2dac1c1cbc213c3d7ff9bdd0ab12395"}, + {file = "black-24.3.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9f50ea1132e2189d8dff0115ab75b65590a3e97de1e143795adb4ce317934995"}, + {file = "black-24.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e2af80566f43c85f5797365077fb64a393861a3730bd110971ab7a0c94e873e7"}, + {file = "black-24.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:4be5bb28e090456adfc1255e03967fb67ca846a03be7aadf6249096100ee32d0"}, + {file = "black-24.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4f1373a7808a8f135b774039f61d59e4be7eb56b2513d3d2f02a8b9365b8a8a9"}, + {file = "black-24.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:aadf7a02d947936ee418777e0247ea114f78aff0d0959461057cae8a04f20597"}, + {file = "black-24.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c02e4ea2ae09d16314d30912a58ada9a5c4fdfedf9512d23326128ac08ac3d"}, + {file = "black-24.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf21b7b230718a5f08bd32d5e4f1db7fc8788345c8aea1d155fc17852b3410f5"}, + {file = "black-24.3.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:2818cf72dfd5d289e48f37ccfa08b460bf469e67fb7c4abb07edc2e9f16fb63f"}, + {file = "black-24.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:4acf672def7eb1725f41f38bf6bf425c8237248bb0804faa3965c036f7672d11"}, + {file = "black-24.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c7ed6668cbbfcd231fa0dc1b137d3e40c04c7f786e626b405c62bcd5db5857e4"}, + {file = "black-24.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:56f52cfbd3dabe2798d76dbdd299faa046a901041faf2cf33288bc4e6dae57b5"}, + {file = "black-24.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79dcf34b33e38ed1b17434693763301d7ccbd1c5860674a8f871bd15139e7837"}, + {file = "black-24.3.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e19cb1c6365fd6dc38a6eae2dcb691d7d83935c10215aef8e6c38edee3f77abd"}, + {file = "black-24.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65b76c275e4c1c5ce6e9870911384bff5ca31ab63d19c76811cb1fb162678213"}, + {file = "black-24.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:b5991d523eee14756f3c8d5df5231550ae8993e2286b8014e2fdea7156ed0959"}, + {file = "black-24.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c45f8dff244b3c431b36e3224b6be4a127c6aca780853574c00faf99258041eb"}, + {file = "black-24.3.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6905238a754ceb7788a73f02b45637d820b2f5478b20fec82ea865e4f5d4d9f7"}, + {file = "black-24.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d7de8d330763c66663661a1ffd432274a2f92f07feeddd89ffd085b5744f85e7"}, + {file = "black-24.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:7bb041dca0d784697af4646d3b62ba4a6b028276ae878e53f6b4f74ddd6db99f"}, + {file = "black-24.3.0-py3-none-any.whl", hash = "sha256:41622020d7120e01d377f74249e677039d20e6344ff5851de8a10f11f513bf93"}, + {file = "black-24.3.0.tar.gz", hash = "sha256:a0c9c4a0771afc6919578cec71ce82a3e31e054904e7197deacbc9382671c41f"}, ] [package.dependencies] @@ -4695,4 +4695,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "9aa9831a1e257899f1504bc7b252f796fa0beaf51367e4c43a3d6de4108d5f54" +content-hash = "b3f705c2f9c191a36df1a534230e9154220ac3ef4bcfaf5efb2d008e12bdf700" diff --git a/pyproject.toml b/pyproject.toml index 7f03f943c..cbf6d6eca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,7 +56,7 @@ setuptools = "^69.2.0" [tool.poetry.group.dev.dependencies] awscli = "^1.29.74" bandit = "*" -black = "^23.12.1" +black = "^24.3.0" cloudfoundry-client = "*" exceptiongroup = "==1.2.0" flake8 = "^7.0.0" From 8d48ec4c878e2f6cfbced3562938558215b26679 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 22 Mar 2024 11:18:47 -0700 Subject: [PATCH 29/38] fix invitations --- app/organization/invite_rest.py | 12 +++++++++++- app/service_invite/rest.py | 26 +++++++++++++++++++++----- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/app/organization/invite_rest.py b/app/organization/invite_rest.py index 2d14c771a..580c10da6 100644 --- a/app/organization/invite_rest.py +++ b/app/organization/invite_rest.py @@ -72,12 +72,22 @@ def invite_user_to_org(organization_id): key_type=KeyType.NORMAL, reply_to_text=invited_org_user.invited_by.email_address, ) + + saved_notification.personalisation = personalisation redis_store.set( f"email-personalisation-{saved_notification.id}", json.dumps(personalisation), ex=1800, ) - saved_notification.personalisation = personalisation + + # This is for the login.gov path, note 24 hour expiry to match + # The expiration of invitations. + redis_key = f"organization-invite-{invited_org_user.email_address}" + redis_store.set( + redis_key, + organization_id, + ex=3600 * 24, + ) send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) diff --git a/app/service_invite/rest.py b/app/service_invite/rest.py index 641ea3865..849261cb2 100644 --- a/app/service_invite/rest.py +++ b/app/service_invite/rest.py @@ -48,11 +48,7 @@ def _create_service_invite(invited_user, invite_link_host): template_version=template.version, recipient=invited_user.email_address, service=service, - personalisation={ - "user_name": invited_user.from_user.name, - "service_name": invited_user.service.name, - "url": invited_user_url(invited_user.id, invite_link_host), - }, + personalisation={}, notification_type=NotificationType.EMAIL, api_key_id=None, key_type=KeyType.NORMAL, @@ -64,6 +60,26 @@ def _create_service_invite(invited_user, invite_link_host): json.dumps(personalisation), ex=1800, ) + # The raw permissions are in the form "a,b,c,d" + # but need to be in the form ["a", "b", "c", "d"] + data = {} + permissions = invited_user.permissions + permissions = permissions.split(",") + permission_list = [] + for permission in permissions: + permission_list.append(f"{permission}") + data["from_user_id"] = (str(invited_user.from_user.id),) + data["service_id"] = str(invited_user.service.id) + data["permissions"] = permission_list + data["folder_permissions"] = invited_user.folder_permissions + + # This is for the login.gov service invite on the + # "Set Up Your Profile" path. + redis_store.set( + f"service-invite-{invited_user.email_address}", + json.dumps(data), + ex=3600 * 24, + ) send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) From 6b870abdc4ccea2b8cc0deda58c3d44f451f14ef Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Tue, 26 Mar 2024 13:08:34 -0700 Subject: [PATCH 30/38] Add cf org and space to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index bb38882df..6ec38fb4d 100644 --- a/README.md +++ b/README.md @@ -278,6 +278,7 @@ in the command line by using this command: ```sh cf login -a api.fr.cloud.gov --sso ``` +If you are offered a choice of orgs, select `gsa-tts-benefits-studio`. For the space, choose `notify-local-dev` to start with. _REMINDER: Ensure you have access to the `notify-local-dev` and `notify-staging` spaces in cloud.gov_ From 7b970132554f84d36a43307bc36a305155acd07b Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Wed, 27 Mar 2024 09:05:08 -0700 Subject: [PATCH 31/38] Notes about running ./run.sh and make run-profile Explain what to expect when running `./run.sh` and `make run-profile` so that the user can determine if they have run correctly --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bb38882df..da82c6937 100644 --- a/README.md +++ b/README.md @@ -289,9 +289,12 @@ cd terraform/development ./run.sh ``` -In addition to some infrastructure setup, this will also create a local `.env` -file for you in the project's root directory, which will include a handful of -project-specific environment variables. +If this runs correctly, Terraform will ask you if you want to create some +resources. Answer `yes`. + +The script will also create a local `.env` file for you in the project's +root directory, which will include a handful of project-specific environment +variables. Lastly, if you didn't already start PostgreSQL and Redis above, be sure to do so now: @@ -385,6 +388,9 @@ Now you can run the web server and background workers for asynchronous jobs: make run-procfile ``` +If it runs correctly, you will be able to visit http://127.0.0.1:6011/ and see +JSON from the API in your web browser. + This will run all of the services within the same shell session. If you need to run them separately to help with debugging or tracing logs, you can do so by opening three sepearate shell sessions and running one of these commands in each From d3b895ddc6ad2b1ad492b5258f5db45646995005 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Wed, 27 Mar 2024 10:32:40 -0600 Subject: [PATCH 32/38] PEP-257 changes --- app/celery/provider_tasks.py | 8 +------- app/celery/tasks.py | 15 +++------------ app/delivery/send_to_providers.py | 8 ++++---- app/job/rest.py | 5 +---- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/app/celery/provider_tasks.py b/app/celery/provider_tasks.py index e8d120a56..5d8d05ca2 100644 --- a/app/celery/provider_tasks.py +++ b/app/celery/provider_tasks.py @@ -91,13 +91,7 @@ def check_sms_delivery_receipt(self, message_id, notification_id, sent_at): bind=True, name="deliver_sms", max_retries=48, default_retry_delay=300 ) def deliver_sms(self, notification_id): - """ - This logic will branch off to the final step in delivering - the notification to sns. - Logic is in place for delivery receipts. - Additional logic to help devs output authentication code to - terminal. - """ + """Branch off to the final step in delivering the notification to sns and get delivery receipts.""" try: current_app.logger.info( "Start sending SMS for notification id: {}".format(notification_id) diff --git a/app/celery/tasks.py b/app/celery/tasks.py index 540e29177..ff7ead5ef 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -31,10 +31,7 @@ from app.v2.errors import TotalRequestsError @notify_celery.task(name="process-job") def process_job(job_id, sender_id=None): - """ - We update job status, get the csv data from s3 and begin processing - csv rows. - """ + """ Update job status, get csv data from s3, and begin processing csv rows.""" start = datetime.utcnow() job = dao_get_job_by_id(job_id) current_app.logger.info( @@ -114,10 +111,7 @@ def get_recipient_csv_and_template_and_sender_id(job): def process_row(row, template, job, service, sender_id=None): - """ - The process will branch off based on notification type, - sms or email. - """ + """Branch off based on notification type, sms or email.""" template_type = template.template_type encrypted = encryption.encrypt( { @@ -175,10 +169,7 @@ def __total_sending_limits_for_job_exceeded(service, job, job_id): @notify_celery.task(bind=True, name="save-sms", max_retries=5, default_retry_delay=300) def save_sms(self, service_id, notification_id, encrypted_notification, sender_id=None): - """ - We are persisting the notification to the db here and - placing notification in queue to send to sns. - """ + """Persist notification to db and place notification in queue to send to sns.""" notification = encryption.decrypt(encrypted_notification) # SerialisedService and SerialisedTemplate classes are # used here to grab the same service and template from the cache diff --git a/app/delivery/send_to_providers.py b/app/delivery/send_to_providers.py index 5e9373a60..98f86396a 100644 --- a/app/delivery/send_to_providers.py +++ b/app/delivery/send_to_providers.py @@ -22,10 +22,10 @@ from app.serialised_models import SerialisedService, SerialisedTemplate def send_sms_to_provider(notification): - """ - This is the last step in the message send flow. - We get necessary data for recipient, template, - notification and send it off to the provider. + """Final step in the message send flow. + + Get data for recipient, template, + notification and send it to sns. """ # we no longer store the personalisation in the db, # need to retrieve from s3 before generating content diff --git a/app/job/rest.py b/app/job/rest.py index 46fe698da..d139fe9ae 100644 --- a/app/job/rest.py +++ b/app/job/rest.py @@ -166,10 +166,7 @@ def get_jobs_by_service(service_id): @job_blueprint.route("", methods=["POST"]) def create_job(service_id): - """ - Entry point from UI for one-off messages - as well as CSV uploads. - """ + """Entry point from UI for one-off messages as well as CSV uploads.""" service = dao_fetch_service_by_id(service_id) if not service.active: raise InvalidRequest("Create job is not allowed: service is inactive ", 403) From 387e37629b8647aeac27d5809a6b3412df5e945e Mon Sep 17 00:00:00 2001 From: John Skiles Skinner Date: Wed, 27 Mar 2024 17:24:24 -0700 Subject: [PATCH 33/38] Clarify local development context --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ec38fb4d..d806c7542 100644 --- a/README.md +++ b/README.md @@ -278,7 +278,9 @@ in the command line by using this command: ```sh cf login -a api.fr.cloud.gov --sso ``` -If you are offered a choice of orgs, select `gsa-tts-benefits-studio`. For the space, choose `notify-local-dev` to start with. +If you are offered a choice of orgs, select `gsa-tts-benefits-studio`. +For the space, choose `notify-local-dev` to start with (assuming you are +setting up local development). _REMINDER: Ensure you have access to the `notify-local-dev` and `notify-staging` spaces in cloud.gov_ From 1547e80e37bdd7f3c29e90edc63046524f4aaa03 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Thu, 28 Mar 2024 09:35:53 -0600 Subject: [PATCH 34/38] Fix spacing --- app/celery/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/celery/tasks.py b/app/celery/tasks.py index ff7ead5ef..9ab84cb2e 100644 --- a/app/celery/tasks.py +++ b/app/celery/tasks.py @@ -31,7 +31,7 @@ from app.v2.errors import TotalRequestsError @notify_celery.task(name="process-job") def process_job(job_id, sender_id=None): - """ Update job status, get csv data from s3, and begin processing csv rows.""" + """Update job status, get csv data from s3, and begin processing csv rows.""" start = datetime.utcnow() job = dao_get_job_by_id(job_id) current_app.logger.info( From 97ba070b0e3e242be8c19e0be8ffb149441c1f2b Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 28 Mar 2024 11:19:02 -0700 Subject: [PATCH 35/38] debug staging --- app/organization/invite_rest.py | 10 ++++++++-- app/service_invite/rest.py | 4 ++++ app/utils.py | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/organization/invite_rest.py b/app/organization/invite_rest.py index 580c10da6..60cba4322 100644 --- a/app/organization/invite_rest.py +++ b/app/organization/invite_rest.py @@ -28,6 +28,7 @@ from app.organization.organization_schema import ( post_update_invited_org_user_status_schema, ) from app.schema_validation import validate +from app.utils import hilite organization_invite_blueprint = Blueprint("organization_invite", __name__) @@ -83,12 +84,17 @@ def invite_user_to_org(organization_id): # This is for the login.gov path, note 24 hour expiry to match # The expiration of invitations. redis_key = f"organization-invite-{invited_org_user.email_address}" - redis_store.set( + redis_store.raw_set( redis_key, organization_id, ex=3600 * 24, ) - + current_app.logger.info( + hilite(f"STORING THIS ORGANIZATION ID IN REDIS {organization_id}") + ) + current_app.logger.info( + hilite(f"URL: {os.environ['LOGIN_DOT_GOV_REGISTRATION_URL']}") + ) send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) return jsonify(data=invited_org_user.serialize()), 201 diff --git a/app/service_invite/rest.py b/app/service_invite/rest.py index 849261cb2..d9df54d21 100644 --- a/app/service_invite/rest.py +++ b/app/service_invite/rest.py @@ -25,6 +25,7 @@ from app.notifications.process_notifications import ( send_notification_to_queue, ) from app.schemas import invited_user_schema +from app.utils import hilite service_invite = Blueprint("service_invite", __name__) @@ -80,6 +81,9 @@ def _create_service_invite(invited_user, invite_link_host): json.dumps(data), ex=3600 * 24, ) + current_app.logger.info( + hilite(f"STORING ALL THIS IN REDIS FOR SERVICE INVITE {json.dumps(data)}") + ) send_notification_to_queue(saved_notification, queue=QueueNames.NOTIFY) diff --git a/app/utils.py b/app/utils.py index 833dce55f..9519e2076 100644 --- a/app/utils.py +++ b/app/utils.py @@ -123,3 +123,11 @@ def get_reference_from_personalisation(personalisation): if personalisation: return personalisation.get("reference") return None + + +# Function used for debugging. +# Do print(hilite(message)) while debugging, then remove your print statements +def hilite(message): + ansi_green = "\033[32m" + ansi_reset = "\033[0m" + return f"{ansi_green}{message}{ansi_reset}" From 5fbc7ddd2d8b56c25c7ed6f4f064df1bb7227a0f Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 28 Mar 2024 11:43:11 -0700 Subject: [PATCH 36/38] ugh --- app/organization/invite_rest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/organization/invite_rest.py b/app/organization/invite_rest.py index 60cba4322..ec94ba1c2 100644 --- a/app/organization/invite_rest.py +++ b/app/organization/invite_rest.py @@ -84,13 +84,13 @@ def invite_user_to_org(organization_id): # This is for the login.gov path, note 24 hour expiry to match # The expiration of invitations. redis_key = f"organization-invite-{invited_org_user.email_address}" - redis_store.raw_set( + redis_store.set( redis_key, organization_id, ex=3600 * 24, ) current_app.logger.info( - hilite(f"STORING THIS ORGANIZATION ID IN REDIS {organization_id}") + hilite(f"STORING THIS ORGANIZATION ID IN REDIS {redis_store.get(redis_key)}") ) current_app.logger.info( hilite(f"URL: {os.environ['LOGIN_DOT_GOV_REGISTRATION_URL']}") From 0131ea0f1e8ae138754596116dc94676c360b60e Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 29 Mar 2024 07:44:35 -0700 Subject: [PATCH 37/38] return None to handle new user --- app/dao/users_dao.py | 1 - app/user/rest.py | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/dao/users_dao.py b/app/dao/users_dao.py index 8180e6f11..7b2f2e609 100644 --- a/app/dao/users_dao.py +++ b/app/dao/users_dao.py @@ -36,7 +36,6 @@ def get_login_gov_user(login_uuid, email_address): should be removed. """ - print(User.query.filter_by(login_uuid=login_uuid).first()) user = User.query.filter_by(login_uuid=login_uuid).first() if user: if user.email_address != email_address: diff --git a/app/user/rest.py b/app/user/rest.py index 2cbbb9b25..3ebca90ed 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -566,6 +566,9 @@ def get_user_login_gov_user(): login_uuid = request_args["login_uuid"] email = request_args["email"] user = get_login_gov_user(login_uuid, email) + + if user is None: + return jsonify({}) result = user.serialize() return jsonify(data=result) @@ -715,9 +718,9 @@ def get_orgs_and_services(user): "id": service.id, "name": service.name, "restricted": service.restricted, - "organization": service.organization.id - if service.organization - else None, + "organization": ( + service.organization.id if service.organization else None + ), } for service in user.services if service.active From 55a517f111723e6a8365d4e48824d63c8d7bb85f Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 29 Mar 2024 08:32:25 -0700 Subject: [PATCH 38/38] Fix organization invite template --- app/config_files/templates.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/config_files/templates.json b/app/config_files/templates.json index 65a0e9d27..4f6d5b11c 100644 --- a/app/config_files/templates.json +++ b/app/config_files/templates.json @@ -161,7 +161,7 @@ "", "Open this link to create an account on Notify.gov:", "", - "((url))", + "[Join Organization](((url)))", "", "", "This invitation will stop working at midnight tomorrow. This is to keep ((organization_name)) secure."