Commit Graph

34 Commits

Author SHA1 Message Date
Chris Hill-Scott
fc09750662 Cache static files for a year
We only want static files to not come from the browser cache when they have
changed. The best way to do this is by cache busting the URLs.

Otherwise, we want static files to be cached for a long time. This commit sets
the `Expires` HTTP header to 1 year in the future.

Previously it was set to 12 hours, the default.

From the Flask docs:
> Default cache control max age to use with send_static_file() (the default
> static file handler) and send_file(), in seconds. Override this value on a
> per-file basis using the get_send_file_max_age() hook on Flask or Blueprint,
> respectively. Defaults to 43200 (12 hours).
2016-02-10 16:07:10 +00:00
Rebecca Law
3a89039795 Remove need for TWILIO_TEST_NUMBER 2016-02-09 15:56:09 +00:00
Chris Hill-Scott
7f2d2bd5c2 Add all the configs 2016-02-09 14:10:28 +00:00
Rebecca Law
6d318659ff fix codestyle 2016-02-08 15:23:10 +00:00
Rebecca Law
05adb1f3ad Add test number for functional testing. 2016-02-08 15:22:19 +00:00
Adam Shimali
c05a4b2059 Bucket creation needed correct region to be set.
That resulted in non-idempotent create_bucket in non us east 1
location, so needed to check for bucket existence first.
2016-02-02 22:26:49 +00:00
Chris Hill-Scott
3135f6c510 Use different colours for each environment
https://www.pivotaltracker.com/story/show/112786779

> There's an emerging convention on admin apps, to have a red strip atop the
> page, also to have a different colour for preview environment... so let's
> adopt that and see how it feels. Red for prod and gold for preview.

This commit adds config so that:
- yellow locally
- orange on preview and staging
- red on live

It will not actually work until each AWS environment uses the right config, but
can be tested locally by setting the environment variable manually, eg:
`export HEADER_COLOUR='#F47738'`
2016-02-01 15:35:19 +00:00
Rebecca Law
54a61ac928 Update the cookie to secure on LIVE
Set the expiration of the cookie.
2016-01-28 15:31:32 +00:00
Rebecca Law
5a17bba97e Set SESSION_COOKIE_SECURE=True for live. 2016-01-28 15:01:44 +00:00
Adam Shimali
4d130fed01 Sessions expire after one hour 2016-01-22 15:05:13 +00:00
Rebecca Law
28658c6cc4 Rename NOTIFY_API_URL to API_HOST_NAME.
The NOTIFY_API_URL will point to the alpha api.
2016-01-19 16:39:04 +00:00
Adam Shimali
c86b53f7f1 Add user via api
Leave original user object in for this slice. Remove on next
2016-01-19 16:07:44 +00:00
Rebecca Law
bc7ad75899 Add default config 2016-01-19 16:04:08 +00:00
Rebecca Law
e98eacf661 Add admin client user name and secret (used to call into the API) 2016-01-19 16:02:24 +00:00
Nicholas Staples
3b1d521c10 Tests added for dao. 2016-01-15 15:15:35 +00:00
Adam Shimali
4dcb180da1 Changed page flow to first save file and then redirect to check.
On check numbers in file are validated.

Posting to check then uploads file to s3
2016-01-13 17:32:40 +00:00
Adam Shimali
bfd7291426 resolve merge conflicts 2016-01-12 10:43:23 +00:00
Rebecca Law
05695a1c03 Updated generate_token to use encrypt the entire url.
Created notify_client.sender to hold the methods to send notifications.
2016-01-11 15:18:37 +00:00
Adam Shimali
584533eb11 First slice of csv upload of phone numbers for sending messages.
At the moment the file contents are not persisted by checked in
memory.

The first and last three records are show if all are valid.

If there are invalid rows, they are reported and the user is
prompted to go back and sort out upload file.

The storing of upload result (i.e. validation of file) in session
will be removed in next story which is about persisting of file
for later processing.
2016-01-11 15:00:51 +00:00
Rebecca Law
bb1db0c345 When the user request a reset password link, the user.state is set to request_password_reset.
Which means the user will only be able to reset their password, and not sign-in.
Once the user resets the password the user state is set to active once more.
If the link is used a second time they will be redirected to the index page with a message
that the link in the email is not longer valid.
2016-01-11 12:23:08 +00:00
Rebecca Law
806c584b03 Reset password token is valid for 1 hour 2016-01-11 12:23:08 +00:00
Rebecca Law
a860f713d2 Implementation of the new_password endpoint.
Found a way to create the token that does not need to persist it to the database.
This requires proper error messages, written by people who speak menglis good.
2016-01-11 12:23:07 +00:00
Martyn Inglis
35fe1ae5a3 Live was set to debug mode 2016-01-07 16:24:10 +00:00
Martyn Inglis
684230370f Tests run in debug mode 2016-01-07 15:52:56 +00:00
Martyn Inglis
55534522e0 updated config with logging properties 2016-01-07 15:42:16 +00:00
Rebecca Law
e1c2ba034d Turn on debug for live 2016-01-05 13:17:01 +00:00
Rebecca Law
49a8caefa0 Add the live envirornment 2015-12-14 11:00:29 +00:00
Rebecca Law
7c7d0701dd Use a dev api token 2015-12-04 16:27:11 +00:00
Rebecca Law
a741c128da 108537814: Implementation of 3 factor authentication.
The post register endpoint will send a random 5 digit code via sms and another via email.
If either code fails to send, the user will not be created and the person can register again.
The codes are saved to the session cookie, and expire in 1 hour.

Another iteration of this story will save the codes to a database.
2015-12-04 16:27:11 +00:00
Rebecca Law
3f017b30f2 108536490: add the proxy_fix 2015-12-01 10:00:07 +00:00
Rebecca Law
48b7a7dc37 108536490: Adding the login manager and csrf token.
Still need to figure out how to override the load_user method, currently it is not working.
2015-12-01 10:00:06 +00:00
Rebecca Law
7f96ef5a25 108536490: Initial effort to implement log in
Add endpoint for post to /sign-in
Initialise role data
2015-12-01 10:00:06 +00:00
Rebecca Law
abe1d8ae17 108536234: created users and roles data and domain model.
You will need to run the /scripts/bootstrap.sh to create the database for test and the app.
2015-11-25 15:29:12 +00:00
Rebecca Law
b83d2f0d8a Introduce config file for application 2015-11-24 09:40:14 +00:00