Commit Graph

5478 Commits

Author SHA1 Message Date
Pete Herlihy
1787c8a05c Adding .ac.uk domain to the whitelist 2018-05-30 11:43:40 +01:00
Chris Hill-Scott
0e1e5ccecc Merge pull request #2070 from alphagov/manheadschool
Adding mansheadschool to the whitelist of domains
2018-05-08 14:29:53 +01:00
Pete Herlihy
bb7973f753 Adding a test for mansheadschool whitelisting domain 2018-05-08 11:42:04 +01:00
Pete Herlihy
653e3fcd52 Adding Manshead School to allowed domains 2018-05-08 11:40:19 +01:00
Leo Hemsted
e47a459757 Merge pull request #2066 from alphagov/mock-tests
Make sure we always mock endpoints in tests
2018-05-08 11:37:51 +01:00
Leo Hemsted
4ddd3aa155 use client_request to always check the response
this'll avoid us accidentally 503ing and ignoring it in tests where we
check for "assert my_content not present"
2018-05-08 11:16:12 +01:00
Chris Hill-Scott
d9e7aa9059 Merge pull request #2064 from alphagov/pyup-update-pyexcel-io-0.5.6-to-0.5.7
Update pyexcel-io to 0.5.7
2018-05-03 17:01:11 +01:00
Leo Hemsted
7656d3d567 ensure create_email_branding is mocked in tests
also fix asserts to check status codes (to make sure it's not 500)
2018-05-03 16:33:37 +01:00
Leo Hemsted
236339435c conversations only looks for 404 errors from inbound sms
stops masking some 503s in tests
2018-05-03 16:33:37 +01:00
Leo Hemsted
09a8e863a4 in send flow replace suppress with try catch
suppress was suppressing 404 errors (the happy path) - but it was also
suppressing 503s from tests where we hadn't mocked endpoints
2018-05-03 16:33:32 +01:00
Leo Hemsted
e8ef6fa174 don't swallow HTTP errors from create_event
tests weren't patching out create_event (which is invoked every time a
user logs in). This was getting caught by our egress proxy on jenkins.
We didn't notice because the event handler code was swallowing all
exceptions and not re-raising.

This changes that code to no longer swallow exceptions. Since we did
that, we also need to update all the tests that test log-in to mock
the call
2018-05-03 16:14:13 +01:00
pyup-bot
d29885f15b Update pyexcel-io from 0.5.6 to 0.5.7 2018-05-02 23:27:01 +01:00
Chris Hill-Scott
23e53a9fae Merge pull request #1992 from alphagov/add-crown-agreement
Let users download the crown agreement
2018-05-02 10:18:37 +01:00
Chris Hill-Scott
793842bb3b Let users download the crown agreement
This (partially) reverts commit dca5546cbd

Depends on

- [ ] agreement being uploaded to the bucket in all environments as
      `crown.pdf`
2018-05-02 09:54:13 +01:00
Chris Hill-Scott
714b9289b4 Merge pull request #2060 from alphagov/pyup-update-pytest-mock-1.9.0-to-1.10.0
Update pytest-mock to 1.10.0
2018-05-02 09:34:38 +01:00
Chris Hill-Scott
2bc1d1f6e5 Merge pull request #2040 from alphagov/gchq
Mark agreement signed by GCHQ
2018-05-02 09:34:26 +01:00
Chris Hill-Scott
b443c299c3 Merge pull request #2058 from alphagov/pyup-update-gunicorn-19.8.0-to-19.8.1
Update gunicorn to 19.8.1
2018-05-02 09:34:15 +01:00
Chris Hill-Scott
a36ecd1f9e Merge pull request #2062 from alphagov/can-show-contents
Fix truncation message for large file
2018-05-02 09:33:30 +01:00
Chris Hill-Scott
403d856fde Fix truncation message for large file
We do show the initial rows now.
2018-05-02 09:24:16 +01:00
Chris Hill-Scott
f7a7ac53e2 Merge pull request #2061 from alphagov/fix-too-many-rows-exception
Bump utils to fix large CSV bug
2018-05-02 09:12:36 +01:00
Chris Hill-Scott
fa3b7603f4 Bump utils to fix large CSV bug
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/473

Changes: https://github.com/alphagov/notifications-utils/compare/27.0.0...fix-too-many-rows-exception
2018-05-01 19:49:45 +01:00
pyup-bot
70420eded5 Update pytest-mock from 1.9.0 to 1.10.0 2018-05-01 18:43:57 +01:00
Alexey Bezhan
c9f40f63ce Merge pull request #2059 from alphagov/upload-document-permission-switch
Add a button for switching 'upload_document' permission
2018-05-01 17:02:11 +01:00
Alexey Bezhan
f663092cf4 Add a button for switching 'upload_document' permission
Adds a platform admin button to the service settings to turn on/off
'upload_document' service permission. The permission allows uploading
documents to document-download-api through the post notification API
endpoint.
2018-05-01 16:53:21 +01:00
Chris Hill-Scott
394ef265ed Merge pull request #2056 from alphagov/no-session-file-uploads
Remove use of session storage from file upload journey
2018-05-01 09:55:05 +01:00
Chris Hill-Scott
054f75a8ed Don’t load the check page if a job exists already
If a user clicks ‘back’ once they’ve sent a job we don’t want them to
land on the ‘check’ page again. This would suggest that they can send
the same job again (they can’t because that `job_id` is in the database
already). That said, it’s confusing to see that page; the natural thing
is to go jump back another step, to where you uploaded the file.
2018-05-01 09:47:05 +01:00
Chris Hill-Scott
b44074bf3a Stop writing job metadata to the session
We’re not looking at the job metadata in the session any more (see
previous commits) so it’s safe to stop writing it.
2018-05-01 09:47:05 +01:00
Chris Hill-Scott
8c04f8f21a Stop checking the session to see if a file’s valid
We’re going to stop storing job metadata in the session. So we can’t
rely on it for checking whether a file is valid. That safeguard is
happening in the API instead now (because it’s looking at the metadata
stored in S3).
2018-05-01 09:47:04 +01:00
Chris Hill-Scott
98214884d3 Stop posting job metadata to the API
The API is looking at the S3 metadata for this information now, so
there’s no need for us to continue sending it through.
2018-05-01 09:47:04 +01:00
Katie Smith
6ea4cf7c07 Merge pull request #1639 from alphagov/delete-senders-reply-addresses
Allow delete email reply to address, SMS senders
2018-05-01 09:07:53 +01:00
Katie Smith
db921896b2 Highlight the new endpoints in the appropriate navigation menus
Added the four new endpoints to navigation.py to determine which (if
any) navigation items get highlighted when the endpoints are visited.
2018-05-01 08:38:54 +01:00
Katie Smith
0e370d511e Update service_api_client to use new endpoints
API now has separate endpoints to archive email reply-to addresses and
SMS senders, so we no longer need to use the endpoints for updating.
2018-05-01 08:38:54 +01:00
Chris Hill-Scott
965bc76c42 Allow delete email reply to address, SMS senders
For both SMS senders and email reply to addresses this commit adds:
- a delete link
- a confirmation loop

It doesn’t let users delete:
- default SMS senders or reply to addresses (they always have to have
  one)
- inbound numbers

It assumes that the API will allow updating of an attribute named
`active` on the respective database rows. It could work in a different
way. We can’t do complete deletion though because these will still be
keyed to notifications.
2018-05-01 08:38:54 +01:00
pyup-bot
f8723bccf0 Update gunicorn from 19.8.0 to 19.8.1 2018-04-30 19:49:55 +01:00
Chris Hill-Scott
63b17001e1 Merge pull request #2041 from alphagov/👑
Add some crown bodies who haven’t signed the MOU
2018-04-30 17:09:04 +01:00
Leo Hemsted
b3101a08b0 Merge pull request #2037 from alphagov/strip-obscure-whitespace
Strip obscure whitespace from form submissions
2018-04-30 14:41:31 +01:00
Leo Hemsted
57bc9469e0 Merge pull request #2052 from alphagov/pyup-update-gunicorn-19.7.1-to-19.8.0
Update gunicorn to 19.8.0
2018-04-30 14:40:13 +01:00
Leo Hemsted
f51042f176 Merge pull request #2051 from alphagov/pyup-update-httpretty-0.8.14-to-0.9.4
Update httpretty to 0.9.4
2018-04-30 14:40:05 +01:00
Leo Hemsted
cae4cd69be Merge pull request #2055 from alphagov/reply-to-anyone
allow non-gov reply to email addresses
2018-04-30 14:39:48 +01:00
Leo Hemsted
60202cf5af allow non-gov reply to email addresses
we reckon users will like to see gov reply-to email addresses because
it will improve their confidence in the email.

however, some services, for a few complex reasons, don't want a gov
reply to address. rather than add their specific domains to the
whitelist for signups etc, just make reply tos allowed from any domain.

We vet reply-tos before services go live anyway.
2018-04-30 14:03:57 +01:00
Chris Hill-Scott
4cd6de15b4 Merge pull request #2038 from alphagov/wigan.gov.uk
Note agreement signed by Wigan Council
2018-04-30 11:56:41 +01:00
Chris Hill-Scott
869e4607f4 Merge pull request #2054 from alphagov/more-metadata
Store original filename as S3 metadata
2018-04-30 11:52:06 +01:00
Chris Hill-Scott
ef4dd9d126 Add some breathing room to file name length limit
Because Amazon stores metadata keys prefixed with `x-amz-` which might
get counted as part of the size.
2018-04-30 11:44:00 +01:00
Chris Hill-Scott
bc8bc727f3 Limit length of filename
S3 has a limit of 2kb for metadata:

> the user-defined metadata is limited to 2 KB in size. The size of
> user-defined metadata is measured by taking the sum of the number of
> bytes in the UTF-8 encoding of each key and value.

– https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#object-metadata

This means we have a limit of 1870 bytes for the filename:
```python
encoded = 'notification_count50000template_id665d26e7-ceac-4cc5-82ed-63d773d21561validTrueoriginal_file_name'.encode('utf-8')
sys.getsizeof(b)
>>> 130
2000-130
>>> 1870
```

Or, in other words, ~918 characters:
```python
sys.getsizeof(('ü'*918).encode('utf-8'))
>>> 1869
```
2018-04-30 11:44:00 +01:00
Chris Hill-Scott
735d5f0a29 Remove redundant call to get_template
We’re getting the template just to get back its `id`, which is the one
thing we do know in order to get it.

The call to get template is still happening inside `_check_messages`, so
we’ll still catch someone trying to look at this page for a template
that doesn’t exist.
2018-04-30 10:06:51 +01:00
Chris Hill-Scott
66e6538d95 Store original filename as S3 metadata
By doing this we no longer have to store it in the session. This is the
last thing that’s currently in the session, so removing it means we can
drop session storage for file uploads entirely.
2018-04-30 10:06:33 +01:00
pyup-bot
fbbc2de13e Update gunicorn from 19.7.1 to 19.8.0 2018-04-28 20:34:52 +01:00
pyup-bot
20deb54d14 Update httpretty from 0.8.14 to 0.9.4 2018-04-28 07:25:52 +01:00
Chris Hill-Scott
2774cf45f2 Merge pull request #2049 from alphagov/removed-endpoint
Remove reference to removed endpoints
2018-04-27 16:54:36 +01:00
Chris Hill-Scott
4cc8f39231 Remove reference to removed endpoints 2018-04-27 16:50:09 +01:00