Commit Graph

48 Commits

Author SHA1 Message Date
Martyn Inglis
fb77052585 Merge branch 'master' of github.com:alphagov/notifications-admin 2016-01-19 15:44:26 +00:00
Martyn Inglis
a74c78ebd5 Reorded the inits - so logging gets done first 2016-01-19 15:44:12 +00:00
Martyn Inglis
19ea0de766 Reorderd to override from env over credstash over config 2016-01-19 15:01:45 +00:00
Nicholas Staples
a9fead0d82 Merge with master. 2016-01-19 09:49:01 +00:00
Nicholas Staples
3b1d521c10 Tests added for dao. 2016-01-15 15:15:35 +00:00
Nicholas Staples
d42ee85f93 Added new notification-python-client removed check on old one, fixed tests, live service will be broken. 2016-01-14 14:55:07 +00:00
Chris Hill-Scott
75c92c12c1 Add a prototype email template
If the templates page contains text messages and emails then there’s two ways it
could be structured:
- into two sections, all text messages first, then all emails
- emails and text messages interleaved, sorted by date

I think the second one is better. Imagine a situation where you mostly do emails
but have a few text messages. You’d have to scroll past the text messages to get
to your emails. Every time.

I reckon that the most commonly accessed templates will be the most recent ones.
2016-01-14 10:59:51 +00:00
Adam Shimali
9ce46c19cb Add content security policy directive to allow loading of base64 encoded
fonts.
2016-01-13 10:37:34 +00:00
Adam Shimali
886d0c8c95 Added content security policy header.
unsafe-inline exception added to allow inline js scripts
we have in base govuk_template.
2016-01-12 11:08:10 +00:00
Martyn Inglis
e8a22f4d09 Added status page
- returns "OK" as JSON with a 200
- used in healthchecks
2016-01-11 14:54:23 +00:00
Martyn Inglis
7efa513777 Ensured credstash is located only with the wsgi/gunicorn code. 2016-01-11 09:59:31 +00:00
Martyn Inglis
ba4dac051b Integrated credstash as a live properties setting in the app.py class
- initial versions kept it out of this class but updated as lots of duplication and errors as config
set up in multiple places and not all picking up credstash.
2016-01-11 09:32:49 +00:00
Martyn Inglis
af713b1583 Removed flask config property lookup. 2016-01-10 21:38:53 +00:00
Chris Hill-Scott
a289335661 Merge pull request #49 from alphagov/error-pages
Error pages
2016-01-08 15:13:44 +00:00
Martyn Inglis
35fe1ae5a3 Live was set to debug mode 2016-01-07 16:24:10 +00:00
Adam Shimali
dfbcfa9d49 Removed redundant return of None 2016-01-07 16:12:29 +00:00
Rebecca Law
548d086cbf Merge pull request #47 from alphagov/integrate-logging
Integrated logging from the utils repo
2016-01-07 15:58:05 +00:00
Adam Shimali
479ecbd699 pep8 suggested name change 2016-01-07 15:55:55 +00:00
Adam Shimali
d64e3b81fb Add basic error pages 2016-01-07 15:54:05 +00:00
Rebecca Law
afd03ea5bf Merge pull request #46 from alphagov/add-useful-headers
Add some useful owasp suggested headers
2016-01-07 15:39:51 +00:00
Martyn Inglis
ef8964284c Integrated logging from the utils repo 2016-01-07 15:39:36 +00:00
Adam Shimali
78b8aed96b Add some useful owasp suggested headers 2016-01-07 13:58:38 +00:00
Nicholas Staples
10c2978f85 Merge with master and test fix. 2016-01-06 17:17:02 +00:00
Chris Hill-Scott
fd4c4107ac Remove Flask Assets
This commit’s parent introduces a Node-based way of managing front end assets.

Nothing else is needed in the app, specifically not Flask Assets. Flask itself
automatically routes requests for `domain.tld/static/*` to the files in
`app/static`.

This also removes all the Ruby stuff.
2016-01-05 13:12:35 +00:00
Chris Hill-Scott
5ebeec08ae Use a Node-based tools for handling assets
…or how to move a bunch of things from a bunch of different places into
`app/static`.

There are three main reasons not to use Flask Assets:
- It had some strange behaviour like only
- It was based on Ruby SASS, which is slower to get new features than libsass,
  and meant depending on Ruby, and having the SASS Gem globally installed—so
  you’re already out of being a ‘pure’ Python app
- Martyn and I have experience of doing it this way on Marketplace, and we’ve
  ironed out the initial rough patches

The specific technologies this introduces, all of which are Node-based:
- Gulp – like a Makefile written in Javascript
- NPM – package management, used for managing Gulp and its related dependencies
- Bower – also package management, and the only way I can think to have
  GOV.UK template as a proper dependency

…speaking of which, GOV.UK template is now a dependency. This means it can’t be
modified at all (eg to add a global `#content` wrapper), so every page now
inherits from a template that has this wrapper. But it also means that we have a
clean upgrade path when the template is modified.

Everything else (toolkit, elements) I’ve kept as submodules but moved them to a
more logical place (`app/assets` not `app/assets/stylesheets`, because they
contain more than just SASS/CSS).
2016-01-05 13:12:35 +00:00
Chris Hill-Scott
4c14e273c2 Try out previewing messages 2015-12-11 12:02:21 +00:00
Chris Hill-Scott
b46872d2b9 Add a template filter for message placeholders
As a first guess placeholders can be added to messages with the
`((placeholder))` syntax.

This commit adds a Jinja template filter to convert strings containing
said-formatted strings into HTML, which can then be styled to highlight which
parts will be substituted in messages.
2015-12-11 09:48:59 +00:00
Chris Hill-Scott
a5f4580a7f Get SASS compilation working
Main thing that was missing was including the main CSS file in the template.

There are a few hacky bits here, like moving the whole of toolkit inside the
stylesheets directory.

Would arguably be cleaner using something that isn’t Flask Assets, but that’s
something for later.
2015-12-11 09:48:59 +00:00
Rebecca Law
4486a859f8 109638656: fix the login_manager.login_view 2015-12-09 10:12:21 +00:00
Rebecca Law
16618e80f9 109526520: Implement verify flow
When a person registers with a valid mobile number and email address,
a code will be sent to each. That person can enter the verify codes and continue to the add-service page.
2015-12-09 10:12:21 +00:00
Martyn Inglis
5040affc64 upstart puts FLASK_CONFIG into env on AWS.
If present then read the config file pointed at by this property to do environment specific overrides
2015-12-07 13:39:56 +00:00
Martyn Inglis
49aaa116bc Look in environ for AWS properties 2015-12-07 12:10:04 +00:00
Martyn Inglis
7aacd9f1bd Read config file if in AWS 2015-12-07 11:53:14 +00:00
Martyn Inglis
f7cc266546 If there is a FLASK_CONFIG set then use file at that location 2015-12-07 11:35:46 +00:00
Martyn Inglis
d5ea99ee7b Merge branch 'master' of github.com:alphagov/notifications-admin 2015-12-07 11:30:37 +00:00
Martyn Inglis
66537fca30 Setting ENV to live and read config on non-dev environments from a file. 2015-12-07 11:30:29 +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
Chris Heathcote
15e5d8f145 Fixed flask-assets to look for css changes and rebuild 2015-12-03 16:01:21 +00:00
Rebecca Law
3f017b30f2 108536490: add the proxy_fix 2015-12-01 10:00:07 +00:00
Rebecca Law
af382885d3 108536490: Use ItsDangerousSessionInterface in the app.
Start using http://flask.pocoo.org/snippets/51/
2015-12-01 10:00:06 +00:00
Rebecca Law
6f61906fd4 108536490: Implement LoginManager for the admin app.
Also added csrf error handler, will make the session unauthorized if the csrf token is invalid.
2015-12-01 10:00:06 +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
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
Rebecca Law
a9fe2e6bb7 Add govuk-template-flask-skeleton 2015-11-23 13:50:37 +00:00
Rebecca Law
9ec1ba2dfa Use absolute paths for imports 2015-11-20 16:33:11 +00:00
Rebecca Law
d6c81d581d Start to create views 2015-11-20 16:22:44 +00:00
Rebecca Law
29012c78ee Initial creation of notify-admin-frontend 2015-11-18 16:19:40 +00:00