Commit Graph

562 Commits

Author SHA1 Message Date
Chris Hill-Scott
7f72d3a60f Bump utils to 53.0.0
Changes:

53.0.0
---

* `notifications_utils.columns.Columns` has moved to
  `notifications_utils.insensitive_dict.InsensitiveDict`
* `notifications_utils.columns.Rows` has moved to
  `notifications_utils.recipients.Rows`
* `notifications_utils.columns.Cell` has moved to
  `notifications_utils.recipients.Cell`

52.0.0
---

* Deprecate the following unused `redis_client` functions:
  - `redis_client.increment_hash_value`
  - `redis_client.decrement_hash_value`
  - `redis_client.get_all_from_hash`
  - `redis_client.set_hash_and_expire`
  - `redis_client.expire`

51.3.1
---

* Bump govuk-bank-holidays to cache holidays for next year.
2022-02-08 09:45:10 +00:00
Leo Hemsted
19a11e57d2 Merge pull request #3432 from alphagov/cryptography
unpin cryptography
2022-01-24 15:19:31 +00:00
Leo Hemsted
cdab82c1eb unpin cryptography
we previously pinned cryptography to versions less than 3.4 since after
that point, cryptography started using rust as a dependency. This isn't
an issue if you install from wheel, but we found that the version of pip
bundled with the python buildpack was too old to support this. However,
since upgrading from python 3.6 to python 3.9, the pip version has been
bumped and we now no longer need to pin cryptography as it installs
correctly.
2022-01-19 18:46:18 +00:00
Ben Thorner
491b7ce9ee Bump utils to 51.3.0
This brings in new logging for the NotifyCelery base class [1].

[1]: https://github.com/alphagov/notifications-utils/pull/938
2021-12-20 16:45:47 +00:00
Leo Hemsted
b7c1fcb66d bump lxml to fix security warning
two vulnerabilities in <4.6.5 (GHSL-2021-1037 and GHSL-2021-1038)
https://github.com/lxml/lxml/blob/master/CHANGES.txt

also removes docopt as we don't use it except for a dev script (which we
might not need anyway)
2021-12-14 13:47:38 +00:00
Ben Thorner
a7560af9c4 Bump utils to 51.2.1
This includes performance improvements for RecipientCSV, which may
reduce the processing time in some edge cases - this depends on if
the Admin app rejects CSVs with these edge cases.
2021-12-10 16:38:28 +00:00
Chris Hill-Scott
f011254667 Bump notifications-utils to 51.0.0
Just so other people don’t have to merge these changes.

The breaking changes don’t affect this repo because the API doesn’t:
- check the service guestlist before sending a message
- do any visual preview of emergency alert messages

> **51.0.0**
> - Initial argument to RecipientCSV renamed from whitelist to guestlist, in other words consuming code should call RecipientCSV(guestlist=['test@example.com'])
> - RecipientCSV.whitelist property renamed to RecipientCSV.guestlist
>
> **50.0.0**
> - Make icon in broadcast_preview_template.jinja2 an inline SVG (requires changes to the CSS of consumer code)
>
> **49.1.0**
> Add ttl_in_seconds argument to RequestCache.set to let users specify a custom TTL

This commit also changes the format of the line in the requirements
file, copying https://github.com/alphagov/notifications-admin/pull/4074/files
2021-12-06 09:34:15 +00:00
Chris Hill-Scott
4feb3fdc10 Bump utils
This new version of utils implements the transformation of our polygons
to a Cartesian plane. In other words, it converts them from being
defined in spherical degrees to metres.

For the API this means our simplification will be slightly more
accurate.
2021-11-18 15:43:39 +00:00
Ben Thorner
528223ed61 Use central NotifyCelery base class in utils
Note that the new base class doesn't include a bespoke feature we
had here: 'log_on_worker_shutdown'. We've agreed it's reasonable
to remove it for now as it was introduced many years ago and its
use case is unclear - we can always add it back if needed.
2021-11-16 13:58:12 +00:00
Chris Hill-Scott
0aa7cf1aaf Tell Pyup to ignore outdated Eventlet version
We already do this in the admin app:
https://github.com/alphagov/notifications-admin/pull/3876/files

Upgrading Eventlet is blocked until this change in Gunicorn is released:
https://github.com/benoitc/gunicorn/pull/2581/files
2021-11-15 11:14:34 +00:00
Chris Hill-Scott
6c0bda0388 Bump Celery to latest version
This brings in the version 5.2.1 of Kombu, which fixes a security
vulnerability:
> Celery 5.2.0 includes 'kombu' v5.2.1, which includes dependencies
> updates that resolve security issues.
— https://pyup.io/repos/github/alphagov/notifications-api/commits/?page=1#b654c27699a5164cbbe50e042d5d34141f560255

This is the commit from Kombu:
f3b04558fa

I believe the dependency of Kombu which has issues is urllib3, which
has two open advisories for versions less than 1.26.5:
- https://github.com/urllib3/urllib3/security/advisories/GHSA-q2q7-5pp4-w6pg
- https://github.com/urllib3/urllib3/security/advisories/GHSA-5phf-pp7p-vc2r
2021-11-15 11:12:33 +00:00
Leo Hemsted
036bc92245 switch from freeze reqs script to pip-tools
instead of alexey's home-grown script, pip-tools offers a quicker, more
efficient and better supported way to freeze requirements.

see prior art here:

https://github.com/alphagov/notifications-admin/pull/3753
https://github.com/alphagov/notifications-ftp/pull/333
2021-11-11 13:54:21 +00:00
David McDonald
e4f523e3a0 Bump utils to 48.0.0
Brings in fixes to support for non breaking spaces

See https://github.com/alphagov/notifications-utils/pull/908
2021-11-05 15:09:09 +00:00
Ben Thorner
29c92a9e54 Try removing boto package again 2021-11-01 09:54:10 +00:00
Ben Thorner
efe4c6f06e Fix notify-api crashing in PaaS
This is purely by elimination: I couldn't see anything in the logs
to indicate the cause of the crashes, just that the processes were
exiting. The crash seemed to happen immediately after the AWS logs
part of the wrapper script, which was a small indicator it might be
something AWS-related. Since this package is no longer included by
other dependencies, we need to include it explicitly.
2021-11-01 09:54:09 +00:00
Ben Thorner
89e390a3fc Run "make freeze-requirements"
Most of these are due to dependency changes in celery / kombu:

-boto==2.49.0
9b2a172078

+cached-property==1.5.2
560518287a

+click-didyoumean==0.3.0
+click-plugins==1.1.1
+click-repl==0.2.0
f462a437e3/requirements/default.txt

+pycurl==7.43.0.5
59d88326b8/requirements/extras/sqs.txt

+vine==5.0.0
f6c3b3313f

I'm not sure about the following, but neither are critical so
I don't think it's worth tracking down where they came from.

+prompt-toolkit==3.0.21
+wcwidth==0.2.5
2021-11-01 09:54:08 +00:00
Ben Thorner
60799399ab Remove anyjson package
This is no longer required by Celery [1] and now causes an error
when deploying with the new versions of other packages:

        use_2to3 is invalid

[1]: https://docs.celeryproject.org/en/stable/history/whatsnew-4.0.html#requirements
2021-11-01 09:54:06 +00:00
Ben Thorner
3e49de5330 Upgrade to Celery 5.1.2
There are several other changes we need to make in order to install
the new version. For more context, see:

- 208e90e40f
- e3d1993a58
- 7e93611fce

In the next commits we'll look at tidying up the config and other
dependencies so the change is deployable.
2021-11-01 09:54:00 +00:00
Ben Thorner
64327c10ae Bump utils to 47.1.0
This includes the new email_ccs feature needed for the next commit,
but also an upgrade to bleach [1].

[1]: https://github.com/alphagov/notifications-utils/pull/909
2021-10-29 11:46:28 +01:00
Ben Thorner
32e8f9cbc6 Run "make freeze-requirements"
This is so we can clear the diff prior to upgrading to Celery 5,
which has a number of transitive package changes associated with
it. It makes sense for this to be a separate change in case it
causes issues of its own. However, the only major difference in
this commit is pyparsing [1].

[1]: https://github.com/pyparsing/pyparsing/blob/master/docs/whats_new_in_3_0_0.rst
2021-10-27 11:00:48 +01:00
Chris Hill-Scott
ecd2b0c4a3 Bump Werkzeug to version 2.0.2
This is the newest version.

Pyup is complaining about vulnerabilities in version 1.0.1, specifically
> Werkzeug version 2.0.2 improves the security of the debugger cookies.
> "SameSite" attribute is set to "Strict" instead of "None", and the
> secure flag is added when on HTTPS.

Previously we were using whatever version of Werkzeug that Flask
specified this pins it to get rid of the vulnerability without having to
upgrade everything at once.

We’ve done this for the admin app already:
https://github.com/alphagov/notifications-admin/pull/4042/files

I suspect the memory usage issues we saw with version 2.0.0 have been
fixed in 2.0.2, per this line in the changelog:
> Fix memory usage for locals when using Python 3.6 or pre 0.4.17 greenlet versions.
> https://github.com/pallets/werkzeug/pull/2212https://werkzeug.palletsprojects.com/en/2.0.x/changes/
2021-10-18 15:00:39 +01:00
Katie Smith
329a418cc4 Bump utils to 46.1.0
This is to bring in the Zendesk changes which allow us to create tickets
using the Notify Form in Zendesk.
2021-09-24 08:16:06 +01:00
Ben Thorner
11e1a597da Bump utils to 46.0.0
This brings in some new polygon simplication code [1] so we need to
tweak any tests that rely on the exact number of polygons after this
operation.

[1]: https://github.com/alphagov/notifications-utils/pull/890
2021-09-08 14:36:13 +01:00
Chris Hill-Scott
f3e6d92046 Revert "Update utils to bring in coordinate transformation" 2021-08-20 16:05:39 +01:00
Chris Hill-Scott
a6135fb8ab Bump utils
This new version of utils implements the transformation of our polygons
to a Cartesian plane. In other words, it converts them from being
defined in spherical degrees to metres.

For the API this means our simplification will be slightly more
accurate.
2021-08-19 11:08:18 +01:00
Pea Tyczynska
2b2c240bee Update utils version to bring in too_late_to_cancel_letter
We need that method to show right errors to the user
when cancelling letter fails

Update dependencies
2021-07-28 16:33:01 +01:00
sakisv
7ff43939bc Revert werkzeug to the last non-2.0.0 version
We observe high memory usage since we bumped it (along with other
things) and because it only appears on the API and not on the workers
the hypothesis is that Werkzeug is responsible for it.
2021-07-19 16:06:56 +03:00
Pea Tyczynska
e82b8bc33c Bump utils to revert changes to placeholders that introduced
a bug.
2021-07-09 14:45:41 +01:00
Pea Tyczynska
9e8682ac29 Bump utils to bring in fix for optional placeholder bug
See https://github.com/alphagov/notifications-utils/pull/878 for
details.

Changes we had to make for our app and tests to work correctly
after the dependency updates:

1. Update emergency alerts polygons test because we changed
how exact we are with locations of the points on the map.

2. Use Flask's g object to set additional request attributes

So far we have been storing them in _request_ctx_stack which is
an innard for Flask's request context.

Because of major update to Werkzeug dependency, which Flask relies
on, the way we were using it stopped working, so we had a new
way to set those values.
The way we set those values now, by using g object, seems to also
be favoured in Flask documentation:
https://flask.palletsprojects.com/en/1.1.x/reqcontext/#how-the-context-works
2021-07-08 12:18:09 +01:00
David McDonald
04e23ca6a9 Revert "Bump utils version for new invalid address character" 2021-06-01 10:53:28 +01:00
Rebecca Law
50de85988e Fix dependency issues
We haven't bumped the test version for a while.
Also bumped the version of Flask and itsdangerous.
In order to fix flask warnings I needed to changed how the blueprints were registerd.
2021-05-27 13:02:24 +01:00
Rebecca Law
bd1498f49f Bump utils version which contains ~ as an invalid first character for a
postal address.
2021-05-25 08:29:25 +01:00
Richard Baker
2e34f7b18e Force pyup to ignore eventlet
Signed-off-by: Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
2021-05-11 10:12:01 +01:00
Richard Baker
9acf0f839c Freeze dependencies
Signed-off-by: Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
2021-05-10 18:05:37 +01:00
Richard Baker
ab7c8b3946 Revert "Bump eventlet from 0.30.2 to 0.31.0"
Signed-off-by: Richard Baker <richard.baker@digital.cabinet-office.gov.uk>
2021-05-10 17:42:44 +01:00
dependabot[bot]
c7ae2ee06a Bump eventlet from 0.30.2 to 0.31.0
Bumps [eventlet](https://github.com/eventlet/eventlet) from 0.30.2 to 0.31.0.
- [Release notes](https://github.com/eventlet/eventlet/releases)
- [Changelog](https://github.com/eventlet/eventlet/blob/master/NEWS)
- [Commits](https://github.com/eventlet/eventlet/compare/v0.30.2...v0.31.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-08 16:37:31 +00:00
Pea Tyczynska
317ae5dbd4 Apply requirements update 2021-04-29 13:32:36 +01:00
Rebecca Law
85895a9e8b Revert "Scheduled weekly dependency update for week 16" 2021-04-28 10:17:16 +01:00
Pea Tyczynska
66127f3800 Apply requirements update 2021-04-22 16:59:15 +01:00
Katie Smith
1f301fd0f1 Pin marshmallow-sqlalchemy below v0.24.0
This was pinned to `<0.24.1` not `<0.24.0` by mistake, which meant pyup
was trying to upgrade from version `0.23.1`.
2021-04-19 13:43:59 +01:00
Katie Smith
6287b40732 Stop pyup upgrading Cryptography
We'd specified that the version should be less than 3.4 previously, but
needed to also tell pyup not to change that.
2021-04-19 11:52:58 +01:00
Katie Smith
1439f1b528 Freeze requirements 2021-04-19 11:38:55 +01:00
Pea Tyczynska
a3aad24fe1 Bump utils to allow double hyphens in email address domain
It was requested by our user and it is an allowed domain format
with Amazon SES, so we started allowing it in our validation.
2021-03-29 17:53:29 +01:00
Rebecca Law
057c4e4568 Quick fix to ensure that billing doesn't fail if the crown is not set
for the service.

The letters rates for cronw and non crown are the same. It would be nice
to remove the need for crown but for now this is a quick fix.
2021-03-25 08:42:46 +00:00
Katie Smith
1347e708c8 Bump lxml for security vulnerability
This bumps lxml to version 4.6.3 because version 4.6.2 had a
vulnerability (https://lxml.de/4.6/changes-4.6.3.html).
2021-03-24 11:09:07 +00:00
David McDonald
289c0ea0c6 Make freeze requirements 2021-03-08 15:56:42 +00:00
Rebecca Law
11bd906338 Update utils to get the new function 2021-02-24 16:56:33 +00:00
Chris Hill-Scott
0bb671df45 Validate content length on broadcast API
The maximum content count of a broadcast varies depending on its
encoding, so we can’t simply validate it against a schema. This commit
moves to using the validation from `notifications-utils`, and raising a
custom error response.
2021-02-16 09:30:40 +00:00
Rebecca Law
87cf3afdc9 Update notifications-utils version.
Postal address validation now includes `< >` in the invalid characters allowed at the start of an address line.
2021-02-10 10:26:00 +00:00
Pea Tyczynska
7cc8371c7f Pin cryptography to a version < 3.4
One of our dependencies has a dependency on cryptography, which has
recently released version 3.4.

This version introduced a circular import error
(pyca/cryptography#5756) which was fixed in
3.4.1.

However, 3.4.1 has a different error where it fails because it cannot
find a rust compiler.

The suggested
solutions are:

Install a newer version of pip which will install a pre-compiled
cryptography wheel OR
Have rust installed and available on our PATH so that it can be used
to build the package.
Since we can't change the buildpack's pip version and we cannot install
rust ourselves, the only we're left with is to avoid upgrading to 3.4 -
at least until PaaS updates their python buildpacks.
2021-02-08 17:05:46 +00:00