Commit Graph

11696 Commits

Author SHA1 Message Date
Ben Thorner
cd1fe0640c Improve coverage of suspend service tests
Previously these only tested with a Platform Admin user, but service
admins can suspend a service too. I've rewritten the tests to match
the 'archive_service' ones, which use the client_request fixture to
make changing the user easier.

Note that the return value of the service API client wasn't used for
anything, so it's safe to remove it from the mock.
2021-07-08 17:17:23 +01:00
Ben Thorner
301908460a Audit when a service is archived ("deleted")
This is similar to the previous commit. I've used the term 'archive'
to match the rest of the code - services aren't ever truly deleted.
2021-07-08 17:17:22 +01:00
Ben Thorner
bb4c86008a Add audit event for suspending a service
This is particularly important for broadcast services, where a rogue
service or platform admin could launch a DoS attack by suspending a
service at a critical moment when it needs to send alerts.
2021-07-08 15:29:52 +01:00
Ben Thorner
e72a260e13 Merge pull request #3947 from alphagov/allow-ccs
Allow other users to use security keys
2021-07-08 11:53:03 +01:00
Chris Hill-Scott
ceca92c84e Merge pull request #3952 from alphagov/emergency-alerts-content-review
Emergency alerts content review
2021-07-08 09:33:54 +01:00
Chris Hill-Scott
9ac51481d7 Remove most uses of broadcast from the tour
We prefer send now.

I think broadcast as a verb is still good in explaining how it coming
straight from the towers is different to a normal text message.
2021-07-07 16:31:28 +01:00
Ben Thorner
4c2915ce86 Use API flag to give users access to WebAuthn
This allows us to roll out the feature to other users. Note that
the flag is also "True" if the user has "webauthn_auth" as their
auth type, so this is compatible with the more fine-grained check
we have on the authentication parts of the feature. We could do a
more explicit "can_use_webauthn or webauthn_auth" check here, but
the idea is that we'll be able to get rid of this flag eventually,
so I've optimised for brevity instead.

I've modified a couple of the unhappy-path tests to make it more
explicit that the flag is false, since it can be true for Platform
Admins and "normal users" alike.
2021-07-07 15:04:48 +01:00
Ben Thorner
1a4dd04ab1 Add missing tests for authentication radios
Previously we only had one test for SMS auth not being disabled on
the invite version of the form. This modifies that test to fully
check what's displayed, and adds two more for the edit version of
the form.
2021-07-07 15:04:47 +01:00
Ben Thorner
a1b4ccc246 Prevent auth type changing for any WebAuthn user
Previously we applied this restriction to Platform Admins, on the
assumption that all of them use a security key to log in. Rather
than making that assumption, we can explicitly check their login
method, which also supports rolling out the feature to more users.
2021-07-07 15:04:43 +01:00
Ben Thorner
fab58b4e4e Merge pull request #3950 from alphagov/clarify-sms-prefix
Explain about text message prefixes when editing
2021-07-07 12:35:23 +01:00
Ben Thorner
a219de4fa3 Merge pull request #3958 from alphagov/update-roadmap
Remove March to June section from roadmap page
2021-07-07 09:59:53 +01:00
karlchillmaid
9a7008ba36 Update roadmap priorities 2021-07-06 17:57:14 +01:00
Chris Hill-Scott
a4c461ed3f Merge pull request #3944 from alphagov/bump-utils-polygon-simplification
Bump utils to bring in new polygon simplification
2021-07-06 17:14:41 +01:00
Chris Hill-Scott
a766324559 Make the max polygon point count a constant
And document it in context.
2021-07-06 17:00:51 +01:00
Chris Hill-Scott
2accf8434a Remove false precision from area estimates
We give estimates of the area for those who can’t see the map. These
estimates were needlessly precise, gave a false sense of accuracy and
were causing intermittent test failures between different environments.

This commit rounds them in the same way that we round the count of
phones.
2021-07-06 17:00:51 +01:00
Chris Hill-Scott
e4ca78634d Bump utils to bring in new polygon simplification
We’ve changed our simplification a bit so:
- polygons have slightly more points (see https://github.com/alphagov/notifications-utils/pull/873)
- the individual points have less precision (see https://github.com/alphagov/notifications-utils/pull/872)

Overall this reduces the size of the data we’re storing from 74MB to
63MB, and should make any pages where we are rendering lots of
coordinates load a bit quicker.
2021-07-06 17:00:50 +01:00
Katie Smith
59ed8b0f8b Update tests for new content 2021-07-06 16:42:54 +01:00
Ben Thorner
b4bd978289 Update content following review with Karl 2021-07-06 16:30:24 +01:00
karlchillmaid
eebcc2df36 Remove March to June section 2021-07-06 15:28:20 +01:00
Leo Hemsted
416b5c3e26 Merge pull request #3926 from alphagov/sign-in-bug
ensure user details are always in the session after entering password
2021-07-06 11:56:24 +01:00
karlchillmaid
cd6574c28d Change 'broadcasting' to 'sending' 2021-07-05 17:42:37 +01:00
karlchillmaid
4b198fdf72 Change 'cancel' to 'reject' 2021-07-05 17:22:35 +01:00
karlchillmaid
d90d0d632e Change 'cancel' to 'reject' 2021-07-05 17:21:57 +01:00
karlchillmaid
18800a9cec Change 'withdraw' to 'discard' 2021-07-05 17:11:26 +01:00
karlchillmaid
2cc1ccfd7e Change 'withdraw' to 'discard' 2021-07-05 17:10:35 +01:00
karlchillmaid
2b8a495dc7 Update preview button content 2021-07-05 16:50:49 +01:00
karlchillmaid
d7e2b0b783 Replace 'broadcast' and 'prepared' 2021-07-05 16:41:17 +01:00
karlchillmaid
60d8734f79 Replace use of 'broadcast' 2021-07-05 16:39:48 +01:00
karlchillmaid
d804ab747e Replace use of 'broadcast' 2021-07-05 16:38:46 +01:00
karlchillmaid
f910c91a9d Remove use of 'broadcast' 2021-07-05 16:23:55 +01:00
karlchillmaid
64b0fb769b Remove use of 'broadcast' 2021-07-05 16:23:25 +01:00
karlchillmaid
5ffb2a8594 Remove use of 'broadcast' 2021-07-05 16:22:47 +01:00
Chris Hill-Scott
960d2b8bf1 Merge pull request #3954 from alphagov/no-empty-state-choose-areas
Remove empty state step before choosing areas
2021-07-05 16:01:49 +01:00
karlchillmaid
4d2e769400 Replace use of 'broadcast' 2021-07-05 15:57:37 +01:00
karlchillmaid
72e83adb19 Replace use of 'broadcast' 2021-07-05 15:56:21 +01:00
Chris Hill-Scott
da97669674 Merge pull request #3941 from alphagov/use-custom-polygon-to-estimate-phones-in-bleed-area
Use `CustomBroadcastArea` to estimate number of phones in bleed area
2021-07-05 15:51:15 +01:00
Chris Hill-Scott
a0d6c153bf Add comment explaining phone counting strategy 2021-07-05 15:24:04 +01:00
Chris Hill-Scott
2cfd22b20c Remove empty state step before choosing areas
We had some kind of idea that having this empty page would introduce the
idea of choosing areas and reinforce that you are building up a list of
areas.

But since the journey is now so simple with the button to create an
alert directly on the dashboard page, maybe people don’t need this extra
orientation.
2021-07-05 14:33:02 +01:00
karlchillmaid
a8bd65254e Change previous to past 2021-07-05 13:49:36 +01:00
karlchillmaid
ff576555cf Change previous to past 2021-07-05 13:47:10 +01:00
karlchillmaid
dcc38b5619 Change previous to past 2021-07-05 13:46:04 +01:00
Leo Hemsted
74b5d8f3cd add test for when trying to sign in as another invited user 2021-07-02 18:11:53 +01:00
Ben Thorner
2355d1e0e6 Explain about text message prefixes when editing
Previously this lead to 2 support tickets because the user didn't
understand why their messages was being split into 2 fragments. We
tried modifying the message about charges, but that made it more
complicated. Adding a hint should hopefully be enough.
2021-07-02 16:25:45 +01:00
Chris Hill-Scott
5a378fe51f Use CustomBroadcastArea to estimate phones in bleed area
Our current assumption is that the bleed area has the same population
density as the broadcast area.

This is particularly naïve when:
- the bleed area overlaps the sea – no-one lives in the sea
- the broadcast area is a village and the bleed area is the surrounding
  countryside
- the broadcast area is adjacent to a densely populated area like a city

We can be smarter about this now that we have a way of determining the
number of phones in an arbitrary area, based on the known areas that we
have population data about.

Calculating the population in an overlap is a slightly more intensive
calculation. So we only doing it for areas which are smaller enough that
it doesn’t slow things down too much. For larger areas we still use the
more naïve algorithm.
2021-07-02 10:36:25 +01:00
Ben Thorner
256c840b46 Merge pull request #3948 from alphagov/send-upload-id
Send upload_id to Template Preview for logging
2021-07-01 12:22:13 +01:00
Ben Thorner
1f33924ceb Send upload_id to Template Preview for logging
This means we can include the anonymous ID for the file in the log
we have about Type3 fonts [1]. Currently, we have no way of tracing
manually uploaded files with this potential defect.

[1]: https://github.com/alphagov/notifications-template-preview/pull/557
2021-07-01 12:09:47 +01:00
Chris Hill-Scott
bcc494f0ec Merge pull request #3943 from alphagov/fix-invalid-geometries
Fix invalid polygons while importing geographic data
2021-06-30 16:19:29 +01:00
Ben Thorner
43afcd1064 Remove redundant restrictions for WebAuthn feature
Since the register and authentication APIs work in pairs, we can
just put the restrictions on the "begin" API. We weren't testing
the restrictions on the "complete" API anyway.

For authentication, it's also enough to check if the user has
WebAuthn as their auth type, as it's not a big deal if a user
continues to login with a security key indefinitely.
2021-06-30 16:19:12 +01:00
Ben Thorner
7fafc18fb3 Remove unnecessary restriction for 2FA WebAuthn
It should be enough to check the user has it set as their auth type.
Even if a user is no longer eligible to register a security key, it
should still be OK for them to continue using the feature.
2021-06-30 14:54:20 +01:00
Ben Thorner
aad017a184 Merge pull request #3927 from alphagov/webauthn
Webauthn bug fixes and permission tightening
2021-06-30 14:12:11 +01:00