Commit Graph

210 Commits

Author SHA1 Message Date
David McDonald
289c0ea0c6 Make freeze requirements 2021-03-08 15:56:42 +00:00
pyup-bot
9f39118991 Update notifications-python-client from 5.7.1 to 6.0.2 2021-03-03 13:00:06 +00:00
pyup-bot
b5f5114c59 Pin cryptography to latest version 3.4.6 2021-03-03 13:00:06 +00:00
pyup-bot
80891199f8 Update cachetools from 4.2.0 to 4.2.1 2021-03-03 13:00:05 +00:00
pyup-bot
8067ebdca5 Update sqlalchemy from 1.3.22 to 1.3.23 2021-03-03 13:00:05 +00:00
pyup-bot
49dac21739 Update pyjwt from 2.0.0 to 2.0.1 2021-03-03 13:00:05 +00:00
pyup-bot
b615f7192f Update marshmallow-sqlalchemy from 0.23.1 to 0.24.0 2021-03-03 13:00:04 +00:00
pyup-bot
e05ae8f413 Update iso8601 from 0.1.13 to 0.1.14 2021-03-03 13:00:04 +00:00
pyup-bot
6371975981 Update eventlet from 0.30.0 to 0.30.1 2021-03-03 13:00:03 +00:00
pyup-bot
d56430b3a8 Update flask-migrate from 2.5.3 to 2.7.0 2021-03-03 13:00:03 +00:00
pyup-bot
83c5a4f67c Update cffi from 1.14.4 to 1.14.5 2021-03-03 13:00:03 +00:00
Rebecca Law
5986a65005 Check international number for alpha: NO if true then use number to send
SMS.

This is not a catch all for international SMS, the rules are quite
complex and still not completely understood. We are talking with our
provider who maybe able to sort this out for us. But in the meantime,
this should solve for the case that we understand.
2021-02-24 15:12:03 +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
Katie Smith
fc9ecaba1d Bump utils to 43.8.1
This brings in the change to stop TV numbers from being treated as
international numbers.
2021-01-29 15:53:35 +00:00
Chris Hill-Scott
c9d55039eb Simplify polygons before storing them
We’re going to let people pass in fairly complex polygons, but:
- we don’t want to store massive polygons
- we don’t want to pass the CBCs massive polygons

So this commit adds a step to simplify the polygons before storing them.

We think it’s best for us to do this because:
- writing code to do polygon simplification is non-trivial, and we don’t
  want to make all potential integrators do it
- the simplification we’ve developed is domain-specific to emergency
  alerting, so should throw away less information than

There’s a bit more detail about how we simplify polygons in
https://github.com/alphagov/notifications-admin/pull/3590/files
2021-01-26 16:24:45 +00:00
Chris Hill-Scott
26871eeacc Validate CAP against the spec
This gives us some extra confidence that there aren’t any problems with
the data we’re getting from the other service. It doesn’t address any
specific problems we’ve seen, rather it seems like a sensible precaution
to take.
2021-01-26 16:24:45 +00:00
Chris Hill-Scott
f98aca05e9 Add translators from CAP to dict
Other systems we’re working with won’t easily be adapted to emit JSON
instead of CAP, so it’s less work for us to do that conversion.

This commit adds to code to parse the XML and turn it into a dict that
we can work with, including converting the polygon string into native
Python lists.
2021-01-26 16:24:44 +00:00
Leo Hemsted
ee2bec2f72 pin marshmallow-sqlalchemy
to keep marshmallow <=3.0 dep
2020-12-31 13:56:18 +00:00
Leo Hemsted
156c7aa32a bump python client
brings in jwt2.0 compat
2020-12-31 13:56:04 +00:00
pyup-bot
b298440f00 Update sqlalchemy from 1.3.20 to 1.3.22 2020-12-31 13:55:37 +00:00
pyup-bot
97d35b86b5 Update pyjwt from 1.7.1 to 2.0.0 2020-12-31 13:55:37 +00:00
pyup-bot
659a43e435 Update cachetools from 4.1.1 to 4.2.0 2020-12-31 13:55:37 +00:00
pyup-bot
e4c5633150 Update eventlet from 0.29.1 to 0.30.0 2020-12-31 13:55:37 +00:00
pyup-bot
0c0821b9f9 Update prometheus-client from 0.8.0 to 0.9.0 2020-12-31 13:55:37 +00:00
pyup-bot
39877e1e40 Update marshmallow-sqlalchemy from 0.23.1 to 0.24.1 2020-12-31 13:55:37 +00:00
pyup-bot
e560b4a972 Update flask-marshmallow from 0.11.0 to 0.14.0 2020-12-31 13:55:37 +00:00
pyup-bot
20994c2d5d Update cffi from 1.14.3 to 1.14.4 2020-12-31 13:55:37 +00:00
Chris Hill-Scott
b6734d25d0 Bump utils to 43.5.9
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.8...43.5.9
2020-12-18 15:37:15 +00:00
Chris Hill-Scott
4e009af2f7 Bump utils to 43.5.8
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.7...43.5.8
2020-12-18 14:35:16 +00:00
Pea Tyczynska
4fc3f95c41 Increase email size limit to 2MBby pulling in new utils
This is because GOV.UK has hit the email size limit with their
weekly digest email.
2020-12-16 15:59:49 +00:00
Chris Hill-Scott
2165cbaf76 Bump utils to 43.5.6
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.4...43.5.6
2020-12-11 10:56:06 +00:00
Leo Hemsted
dc881b262e bump utils
this is to fix pip errors due to bad requirements
2020-12-07 14:35:06 +00:00
Chris Hill-Scott
a497788740 Bump utils to 43.5.2
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/808/files

Changes:
- https://github.com/alphagov/notifications-utils/compare/43.5.1...43.5.2
2020-11-30 10:52:48 +00:00
Tom Byers
2021555a07 Bump utils to 43.5.1
Brings in
https://github.com/alphagov/notifications-utils/pull/807
which removes a hack we had in our email template
to deal with this bug:

https://www.pivotaltracker.com/story/show/161183433

This behaviour is no longer happening so this
removes the hack.

See
https://www.pivotaltracker.com/story/show/161183433/comments/219297211
for evidence of the change in behaviour.
2020-11-18 16:43:22 +00:00
Katie Smith
47e427d0a9 Bump notifications-utils to 43.5.0
This version changes the `.fragment_count` method of the
`BaseSMSTemplate` class to take extended GSM characters into account.
2020-11-17 09:46:26 +00:00
Rebecca Law
2e114b7404 Bump utils requirement 2020-11-16 14:04:37 +00:00
Rebecca Law
171bc74c69 Rename check_character_count method to check_is_message_to_long.
Add different error message for email and text if content is too long.
Use utils version with is_message_too_long method implemented for email templates.
2020-11-09 16:06:57 +00:00
pyup-bot
b2fe9d0a6f Update sqlalchemy from 1.3.19 to 1.3.20 2020-11-06 10:51:09 +00:00
pyup-bot
87a093845a Update psycopg2-binary from 2.8.5 to 2.8.6 2020-11-06 10:51:09 +00:00
pyup-bot
a3ba4b3e3d Update iso8601 from 0.1.12 to 0.1.13 2020-11-06 10:51:09 +00:00
pyup-bot
73ca396504 Update eventlet from 0.27.0 to 0.29.1 2020-11-06 10:51:09 +00:00
pyup-bot
8cb1797ec4 Update cffi from 1.14.2 to 1.14.3 2020-11-04 13:00:02 +00:00
Katie Smith
c4075f1fc0 Revert "Tailor message-too-long error message depending on the notification type" 2020-11-03 10:55:15 +00:00
Pea Tyczynska
9708b09ba3 Tailor message-too-long error message
depending on the notification type.

Up until now, only sms messages could get message-too-long error,
but now we also need to validate the size of email messages, so
the message content needs to be tailored to the notification type.
2020-10-29 14:07:48 +00:00
Chris Hill-Scott
28f01bd776 Use utils template to format broadcast content
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/801

Formats the content of the template at the time of creating the event.
This means that any downstream code (eg Celery tasks) can assume the
content is already formatted correctly.

Also, these downstream tasks don’t  know which template the broadcast
was created from, so if we support personalisation in the future this is
the most sensible place to bring together the template and the
personalisation.

---

I had to re-create some of the deleted code from utils for stuff like
formatting the timestamp to the CAP standard.
2020-10-27 10:55:26 +00:00
Chris Hill-Scott
29ff625a4b Bump utils to 42.2.1
Changes: https://github.com/alphagov/notifications-utils/compare/42.2.0...42.2.1
2020-09-29 12:34:44 +01:00
Chris Hill-Scott
379a227a1d Bump utils to 42.2.0
Increases CSV row limit from 50,000 to 100,000

Changes: https://github.com/alphagov/notifications-utils/compare/42.0.0...42.2.0
2020-09-25 18:16:14 +01:00
David McDonald
5b2dee5ddb Bump utils to 42.0.0
Requires unit test updating as we now expect broadcast event areas to
be a dict containing a list of areas and simple polygons.
2020-09-14 15:21:55 +01:00