Commit Graph

11569 Commits

Author SHA1 Message Date
Ben Thorner
ef8cab7fa4 Simplify network choice form to use boolean radio
This follows the same pattern as in other forms [1].

[1]: 1b459d6692/app/templates/views/organisations/add-gp-organisation.html (L20)
2021-06-07 17:51:09 +01:00
Ben Thorner
5ce76b8b33 Add property to construct account type string
This allows us to start decoupling the form fields from the final,
hyphenated string, which we'll do in the next commits.

Note that I've also removed the conditional that changes the data
of the network field as part of validating it. We shouldn't change
data in validations, and having the new property directly above
makes it clear there's no need for this code.
2021-06-07 17:51:08 +01:00
Ben Thorner
e848643361 Simplify provider selection with '-all' suffix
Previously we had to cope with two forms of the hyphenated string
we use to represent a pending change in broadcast account type.
Using "all" to mean "all providers" matches the behaviour in the
API [1], and means we can remove some complexity.

"training-test-all" isn't ideal, since the provider is irrelevant
for a training mode service. However, this isn't much worse than
the previous "training-test", noting that the channel also has no
relevance. We'll iterate this in later commits.

[1]: 8e1a144f87/migrations/versions/0352_broadcast_provider_types.py (L14)
2021-06-07 17:51:01 +01:00
Ben Thorner
e3cc16c936 Remove redundant '_get' and '_post' in test names
This is inconsistent with all the other tests in the same file, and
one of them was incorrect ('_post' was testing a GET). I don't think
we get any value from them, given the inconsistency.
2021-06-07 17:33:55 +01:00
Ben Thorner
9f3cd7332e Add missing test for dodgy broadcast account types
This moves the redundant assertions for the service not changing to
where they're actually relevant, by comparing with the happy path [1].

[1]: c5196fbf07/tests/app/main/views/test_service_settings.py (L5858)
2021-06-07 12:58:52 +01:00
Ben Thorner
2a09429e1d Remove duplication between no-radio-selected tests
Previously the network selection case was tested here and also by
'test_post_service_set_broadcast_network_makes_you_choose'.

I've renamed the test to be consistent and more specific.
2021-06-07 12:51:43 +01:00
Leo Hemsted
1b459d6692 Merge pull request #3912 from alphagov/next-url
Get webauthn login to honour next queryparam url
2021-06-04 16:58:15 +01:00
Leo Hemsted
4ad93a0ea9 add logging when webauthn cred registration fails 2021-06-04 12:52:40 +01:00
Leo Hemsted
e9636119ef set user_verification to discouraged
this is in line with our settings during registration. user verification
involves the browser popping up a PIN prompt. Since the user has already
entered their password correctly to get to this stage, we don't need any
more proof of Something They Know, so there's no need for this.
2021-06-04 12:52:40 +01:00
Leo Hemsted
9fe8666733 add some docstrings for the webauthn endpoints 2021-06-04 12:52:40 +01:00
Leo Hemsted
0993792137 rename verify to complete in api endpoint
it was changed in this PR: https://github.com/alphagov/notifications-api/pull/3260
2021-06-04 12:52:40 +01:00
Leo Hemsted
26ad20719f send people to /two-factor-sms instead of /two-factor
both routes are already valid, however, the link from sign-in sends to
the old link. it fetches whichever URL is second in the route decorator
list when you call `url_for`. Swapping the order around keeps the routes
valid but starts pointing users to the new url.
2021-06-04 12:52:40 +01:00
Leo Hemsted
bb7343d846 pass nextUrl through yubikey flow
the next url comes from sign in via a query param, and needs to go to
the POST /webauthn/authenticate endpoint. That endpoint logs the user
in and returns the redirect to the browser, and will take the next from
the request query params to get there.

also moving the window mocks to beforeEach/afterEach ensures that
promise callbacks from previous tests aren't still associated in future
tests to ensure good test isolation.

unfortunately i couldn't get mocking location for a single js test to
work, but by changing the global config i was able to add some query
params that i can expect to be passed through. Don't love this at all
but not quite sure of a good way round this. I think we're not
practicing very good hygiene and best practices with our mocking and
it's really confounding me here.
2021-06-04 12:52:40 +01:00
Chris Hill-Scott
5ea82b0cdc Merge pull request #3911 from alphagov/fix-html-on-old-job-page
Fix HTML showing on old job page
2021-06-03 14:14:55 +01:00
Chris Hill-Scott
64ac12d7c3 Merge pull request #3910 from alphagov/designerise-webauthn-2fa-page
Designerise the page for signing in with a security key
2021-06-03 14:14:47 +01:00
Chris Hill-Scott
9838c30a55 Merge pull request #3909 from alphagov/security-key-flash
Add a success message when security key registered
2021-06-03 14:12:55 +01:00
Chris Hill-Scott
a149c6a853 Fix HTML showing on old job page
Using the `Markup` class tells Jinja that the content is safe to render
without any escaping.
2021-06-03 14:01:20 +01:00
Chris Hill-Scott
5de7c6981f Add image and content to security key 2FA page
This reinforces the graphic from when you registered the key. ‘Check’ is
language we use on the test message two factor page.
2021-06-03 14:01:07 +01:00
Chris Hill-Scott
2a62d6dfb8 Add a success message when security key registered
This makes it clear that there’s nothing more the user needs to do,
until the next time they sign in.
2021-06-03 13:59:43 +01:00
Chris Hill-Scott
6869b299b3 Merge pull request #3906 from alphagov/pyup-scheduled-update-2021-05-31
Scheduled weekly dependency update for week 22
2021-06-03 13:37:40 +01:00
David McDonald
0fcb7778ac Merge pull request #3893 from alphagov/allow-provider-all-channels
Allow setting provider for any channel
2021-06-03 09:36:43 +01:00
David McDonald
d04602c3aa Fix incorrect test having channel as 'all'
'all' isn't a valid channel. It should be one of government, severe or
test. I think this is a mistake and therefore this commit changes it to
what it should be
2021-06-02 18:17:54 +01:00
Chris Hill-Scott
e6bbe3f6a5 Remove Python 2 compatibility code
This will make it easier to upgrade to Flask 3.0 in the future.
2021-06-02 16:15:34 +01:00
Chris Hill-Scott
7832c862a1 Pin Flask to less than version 2
Flask 2.0 requires Jinja 3.0

govuk_frontend_jinja is not compatible with Jinja 3.0 yet
2021-06-02 16:15:34 +01:00
David McDonald
2d40208fec Merge pull request #3894 from alphagov/webauthn-login-python-tests
Webauthn login
2021-06-02 15:30:36 +01:00
Chris Hill-Scott
0888ecb628 Freeze requirements 2021-06-02 15:28:31 +01:00
pyup-bot
69a498cbd0 Update xlrd from 1.2.0 to 2.0.1 2021-06-02 15:28:30 +01:00
pyup-bot
4e82afeae6 Update werkzeug from 1.0.1 to 2.0.1 2021-06-02 15:28:30 +01:00
pyup-bot
ee16845c65 Update urllib3 from 1.26.4 to 1.26.5 2021-06-02 15:28:30 +01:00
pyup-bot
69141eb13c Update six from 1.15.0 to 1.16.0 2021-06-02 15:28:30 +01:00
pyup-bot
ea13a94952 Update s3transfer from 0.3.7 to 0.4.2 2021-06-02 15:28:30 +01:00
pyup-bot
c2ee400123 Update pyjwt from 2.0.1 to 2.1.0 2021-06-02 15:28:30 +01:00
pyup-bot
25418ddb04 Update phonenumbers from 8.12.21 to 8.12.24 2021-06-02 15:28:30 +01:00
pyup-bot
934a144725 Update markupsafe from 1.1.1 to 2.0.1 2021-06-02 15:28:30 +01:00
pyup-bot
9563138d6f Update jinja2 from 2.11.3 to 3.0.1 2021-06-02 15:28:30 +01:00
pyup-bot
0e15653939 Update idna from 2.10 to 3.2 2021-06-02 15:28:30 +01:00
pyup-bot
b4a9fe21b6 Update greenlet from 1.0.0 to 1.1.0 2021-06-02 15:28:30 +01:00
pyup-bot
a00db30546 Update et-xmlfile from 1.0.1 to 1.1.0 2021-06-02 15:28:30 +01:00
pyup-bot
3487087f4a Update docutils from 0.15.2 to 0.17.1 2021-06-02 15:28:30 +01:00
pyup-bot
79e1273d82 Update dnspython from 1.16.0 to 2.1.0 2021-06-02 15:28:30 +01:00
pyup-bot
c72022307c Update cryptography from 3.3.2 to 3.4.7 2021-06-02 15:28:30 +01:00
pyup-bot
1de542bd05 Update colorama from 0.4.3 to 0.4.4 2021-06-02 15:28:30 +01:00
pyup-bot
48ae94efa7 Update click from 7.1.2 to 8.0.1 2021-06-02 15:28:30 +01:00
pyup-bot
a6ea8dbe46 Update certifi from 2020.12.5 to 2021.5.30 2021-06-02 15:28:30 +01:00
pyup-bot
22adea55b0 Update cachetools from 4.2.1 to 4.2.2 2021-06-02 15:28:30 +01:00
pyup-bot
82d08522e6 Update botocore from 1.20.51 to 1.20.84 2021-06-02 15:28:30 +01:00
pyup-bot
176966ff83 Update boto3 from 1.17.51 to 1.17.84 2021-06-02 15:28:29 +01:00
pyup-bot
5b6125aef0 Update awscli from 1.19.51 to 1.19.84 2021-06-02 15:28:29 +01:00
pyup-bot
c832e11523 Update requests-mock from 1.8.0 to 1.9.3 2021-06-02 15:28:29 +01:00
pyup-bot
d4f11a3b40 Update flake8 from 3.9.0 to 3.9.2 2021-06-02 15:28:29 +01:00