Commit Graph

6987 Commits

Author SHA1 Message Date
Martyn Inglis
8d8abb524d Add script to set notifications sent count on jobs table. 2016-03-08 09:12:33 +00:00
NIcholas Staples
f931e3fca6 Merge pull request #133 from alphagov/aggregate-data
Aggregate data
2016-03-08 08:55:04 +00:00
NIcholas Staples
bcca510a2d Merge pull request #137 from alphagov/fix-logged-in-at
Capture logged in at when password is verified
2016-03-08 08:49:44 +00:00
Rebecca Law
5c4ac9d938 Include token creation date in the url token. 2016-03-07 18:20:20 +00:00
Rebecca Law
10296f0cc2 Send email address in the data rather than the user_id as a path param.
Remove unused OldRequestVerifyCodeSchema.
2016-03-07 15:21:05 +00:00
Martyn Inglis
4f8c2d31a5 Capture logged in at when password is verified 2016-03-07 15:01:40 +00:00
Rebecca Law
b15d3434c3 Added an endpoint and celery task to email a reset password url. 2016-03-07 14:34:53 +00:00
minglis
7665ec7213 Merge pull request #135 from alphagov/strip-html-from-templates
Strip HTML from template content
2016-03-07 12:40:29 +00:00
Chris Hill-Scott
b3f4e40421 Strip HTML from template content
Templates are created in the admin app and persisted in the API.

They are consumed:
- in the admin app, by requesting them from the API
- in the API, by loading them from the database

There are two potential places where unescaped HTML could be sent to a user:
- when the admin app is previewing a template (it has to render the template as
  markup in order to show the placeholders)
- in the body of an email

For all consumers to have confidence that the templates are safe, it makes sense
to santitise them at the point of creation (and modification). This also avoids
any performance issues that could come from doing it at the point of requesting
a template.

In the future they could be created by a direct API call, bypassing the admin
app. Therefore it makes sense for the API to sanitise them.

The commit sanitises templates using a Mozilla’s Bleach library[1]. It is
configured to get the text content of the template, minus any HTML tags. It is
not using a regex because[2].

1. https://github.com/mozilla/bleach
2. http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454
2016-03-04 22:07:10 +00:00
Martyn Inglis
ae395b490e Fixed bug where I forgot to update only the right job :-( 2016-03-04 15:54:43 +00:00
Rebecca Law
fa87f9c7b3 Merge pull request #129 from alphagov/add-user-with-permissions
[WIP] Changed add user to service to take list
2016-03-04 15:52:58 +00:00
Martyn Inglis
c44aaf0fdc Capture the count of sent notifications for a job 2016-03-04 14:25:28 +00:00
Martyn Inglis
024e390c2f Merge branch 'master' into aggregate-data 2016-03-04 13:43:22 +00:00
Martyn Inglis
a186e277d7 Sent count on jobs 2016-03-04 13:42:55 +00:00
Chris Hill-Scott
065e81697b Merge pull request #132 from alphagov/revert-130-strip-html-from-templates
Revert "Strip HTML from template content"
2016-03-04 13:41:10 +00:00
Chris Hill-Scott
f7a1cfac50 Revert "Strip HTML from template content" 2016-03-04 13:23:44 +00:00
Rebecca Law
9f6f1f791a Merge pull request #131 from alphagov/revert-strip-html
Reverting the use of lxml until we can fix the ubuntu dependencies
2016-03-04 12:56:35 +00:00
Rebecca Law
49a51a8d87 Reverting the use of lxml until we can fix the ubuntu dependencies 2016-03-04 12:40:02 +00:00
Rebecca Law
7e1f3f6180 Merge pull request #130 from alphagov/strip-html-from-templates
Strip HTML from template content
2016-03-04 11:46:52 +00:00
Martyn Inglis
4217f6524a deploy from master to preview 2016-03-04 11:29:27 +00:00
Martyn Inglis
7758021b97 deploy from master to preview 2016-03-04 10:10:02 +00:00
Martyn Inglis
bbf79e3a7b deploy from master to preview 2016-03-04 10:05:26 +00:00
Martyn Inglis
8d859924b0 Remove pycache on zip 2016-03-04 09:02:37 +00:00
Chris Hill-Scott
703e513ddf Strip HTML from template content
Templates are created in the admin app and persisted in the API.

They are consumed:
- in the admin app, by requesting them from the API
- in the API, by loading them from the database

There are two potential places where unescaped HTML could be sent to a user:
- when the admin app is previewing a template (it has to render the template as
  markup in order to show the placeholders)
- in the body of an email

For all consumers to have confidence that the templates are safe, it makes sense
to santitise them at the point of creation (and modification). This also avoids
any performance issues that could come from doing it at the point of requesting
a template.

In the future they could be created by a direct API call, bypassing the admin
app. Therefore it makes sense for the API to sanitise them.

The commit sanitises templates using an XML parser. It extracts the text content
of the template, minus any HTML tags, because of this famous StackOverflow
answer:
http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454
2016-03-04 07:03:15 +00:00
Martyn Inglis
cb731b7434 Merge branch 'master' into staging 2016-03-03 17:40:34 +00:00
Adam Shimali
f945253596 [WIP] Changed add user to service to take list of permissions instead
of invite.
2016-03-03 17:36:21 +00:00
Martyn Inglis
1d760604e7 Set region 2016-03-03 17:23:52 +00:00
Martyn Inglis
fa4f0d9313 Get the right bucket names 2016-03-03 17:15:20 +00:00
Martyn Inglis
cd24dc223f updated travis 2016-03-03 17:06:07 +00:00
Martyn Inglis
c2eba78c97 updated key 2016-03-03 16:58:03 +00:00
Rebecca Law
632642e790 Merge pull request #128 from alphagov/accept-invite-add-permissions
[WIP] When user is added to a service a list of permissions groups are
2016-03-03 16:57:40 +00:00
Adam Shimali
fc8e27e582 [WIP] When user is added to a service a list of permissions groups are
used to assign the correct permissions to the user.

Last slice will be to update invite status.
2016-03-03 16:38:12 +00:00
Martyn Inglis
9b28a6d4ad Fixed version file to use new names 2016-03-03 16:27:13 +00:00
minglis
bfe0ef5520 Merge pull request #127 from alphagov/status-page
Status page
2016-03-03 15:50:29 +00:00
Martyn Inglis
5a2cf1baca Appeased pep8 2016-03-03 15:38:22 +00:00
Martyn Inglis
13320cbed0 Updated to populate on dev 2016-03-03 15:32:22 +00:00
Martyn Inglis
24a9487a20 Updated status page
- include travis build number
- renamed properties
- ELB version
- moved code all into health check
- changed health check to be on same URL for admin and api
2016-03-03 15:18:12 +00:00
Martyn Inglis
b818e1a535 Populate version data with build number and fixed date 2016-03-03 15:06:10 +00:00
Martyn Inglis
aa6fbdc263 Setting up deployment for staging builds 2016-03-03 14:56:47 +00:00
Martyn Inglis
0453bf85a6 Conditional builds 2016-03-03 14:39:06 +00:00
Martyn Inglis
39a48c5523 Deploy staging branch only 2016-03-03 14:32:13 +00:00
Martyn Inglis
aaedd4d054 Removed unused notifcation status 2016-03-03 12:19:56 +00:00
Rebecca Law
2d142287c2 Merge pull request #125 from alphagov/check-restricted-services-on-tasks
Ensure restricted service are respected by tasks:
2016-03-03 12:17:52 +00:00
Martyn Inglis
800afc9e44 Ensure restricted service are respected by tasks:
This is checked on 3rd party API calls, but jobs (CSV files) were able expected to only allow valid files.

Change in tack means we want to have restricted notification failures reported in the UI.
2016-03-03 12:05:18 +00:00
Rebecca Law
3845a17794 Merge pull request #124 from alphagov/fix_user_service_permissions_url
Fix url for user service permissions.
2016-03-03 11:41:45 +00:00
Nicholas Staples
c80753bb75 Fix url for user service permissions. 2016-03-03 09:59:21 +00:00
Adam Shimali
26120e4e7f Merge pull request #122 from alphagov/correct_permission_enums
Permission enums corrected, all tests passing.
2016-03-02 17:22:03 +00:00
NIcholas Staples
ce7e0cef7a Merge pull request #123 from alphagov/add-routing-keys
Add routing keys to celery queues.
2016-03-02 16:30:08 +00:00
Nicholas Staples
9acc528988 Update migration to fix bug. 2016-03-02 16:25:15 +00:00
Rebecca Law
0169ebe69a Add routing keys to celery queues.
NOTE: make sure upstart script on preview is updated before merging.
2016-03-02 16:22:22 +00:00