Commit Graph

2547 Commits

Author SHA1 Message Date
Chris Hill-Scott
48891babc4 Add log of notifications to API integration page
Now that we’ve removed simulated notifications from the dashboard and
activity pages they’re not visible anywhere in the app.

While they should’t be visible to non-technical users, developers have
a real need for Notify to confirm that their code is doing what they
expect. This is needed especially when they’re just getting started with
Notify.

There’s no way of seeing this info from the API either, because a key
can only get notifications created with a key of that type.

It doesn’t make sense to make this a ‘mode’ of the dashboard or activity
because the information about notifications that developers need is
also different. So this commit adds up to 50 of the most recent
notifications sent via the API to the page that developers use as their
‘home’ page.

This also lets us explain the 7 days thing to developers via the
empty slate state of this area of the page.
2016-09-29 09:28:04 +01:00
Chris Hill-Scott
a04aad8825 Add additional params to get notifications client
We want to show a log of notifications that have been sent from the API.

The admin app uses its own private `/service/…/notifications` endpoint
for listing activity. This commit allows us to pass through two
optional, additional parameters to tell the API to:

- include or not include notifications created from a job
- include or not include notifications created with a test API key
2016-09-29 09:27:55 +01:00
Chris Hill-Scott
ce0b3511e6 Make indentation more sensible
Starting arguments on their own line and putting the closing parenthesis
on it’s own line because any subsequent changes to the arguments diff
cleanly (ie without touching any other lines).
2016-09-29 09:27:46 +01:00
Chris Hill-Scott
3e42042156 Add a page to manage a service’s whitelist
Services who are in alpha or building prototypes need a way of sending
to any email address or phone number without having to sign the MOU.

This commit adds a page where they can whitelist up to 5 email addresses
and 5 phone numbers.

It uses the ‘list entry’ UI pattern from the Digital Marketplace
frontend toolkit [1] [2] [3].

I had to do some modification:
- of the Javascript, to make it work with the GOV.UK Module pattern
- of the template to make it work with WTForms
- of the content security policy, because the list entry pattern uses
  Hogan[1], which needs to use `eval()` (this should be fine if we’re
  only allowing it for scripts that we serve)
- of our SASS lint config, to allow browser-targeting mixins to come
  after normal rules (so that they can override them)

This commit also adds a new form class to validate and populate the two
whitelists. The validation is fairly rudimentary at the moment, and
doesn’t highlight which item in the list has the error, but it’s
probably good enough.

The list can only be updated all-at-once, this is how it’s possible to
remove items from the list without having to make multiple `POST`
requests.

1. 434ad30791/toolkit/templates/forms/list-entry.html
2. 434ad30791/toolkit/scss/forms/_list-entry.scss
3. 434ad30791/toolkit/javascripts/list-entry.js
4. http://twitter.github.io/hogan.js/
2016-09-29 09:27:38 +01:00
Chris Hill-Scott
4a596c1dd2 Add a new banner for telling you about trial mode
We’ve found in research that developers have no idea they’re in trial
mode until they hit an error. And even then they don’t really know what
trial mode means.

So this commit:
- adds a message to the API integration page about trial mode
- puts it in a really yellow banner to draw attention to it
- adds the same banner to the settings page
2016-09-28 17:00:46 +01:00
Chris Hill-Scott
f514d377f7 Add a new pattern for sub-navigation
This is like the ‘pill’ pattern that we use for filtering lists of
notifications. However it is meant for navigating between discrete
things, not a filtered view of the same list.

This is why is has a gutter between each item, and no selected state.

Turns out we already had a pattern about this on the dashboard, so this
commit also changes the dashboard to use the same code.
2016-09-28 17:00:46 +01:00
Chris Hill-Scott
dfa3a9242f Add a separate page for linking to documentation
It’s going to get too cluttered to have these links on the API index
page.
2016-09-28 17:00:45 +01:00
Chris Hill-Scott
70a9582c91 Make ‘add new’ button line up with <h1>
Having changed the layout of the API keys page a bit the vertical
misalignment was apparent.
2016-09-28 17:00:45 +01:00
Chris Hill-Scott
d9cc936972 Add an index page for the API integration
This commit adds a placeholder page which, for now, just has links to
the API keys page and links to the clients.

There’s more stuff to come on this page, but this commit just does the
reorganising so that it’s easier to review.
2016-09-28 17:00:45 +01:00
Chris Hill-Scott
c22eb0f081 Reorganise templates for API keys page
This adds another layer of folder structure to the templates to match
the new URLs, which have another layer of hierarchy.
2016-09-28 17:00:44 +01:00
Chris Hill-Scott
234e0b3e6e Change URL for the API keys page
We’re going to have an ‘index’ page for a service’s API integration,
so the keys page needs to move down one level in the hierarchy.
2016-09-28 17:00:43 +01:00
Chris Hill-Scott
2c945902af Merge pull request #955 from alphagov/fix-template-inheritance-without-navigation
Don’t inherit directly from admin template
2016-09-28 15:12:43 +01:00
Chris Hill-Scott
79e0881a23 Don’t inherit directly from admin template
Pages that don’t have navigation shouldn’t extend the top-level admin
template directly.

They should extend `withoutnav_template.html` instead, because then they
get a wrapping `<main>` element, which is good semantically and for
accessibility, and also defaults the font size to `19px`.
2016-09-28 15:10:01 +01:00
Chris Hill-Scott
232eada842 Merge pull request #954 from alphagov/update-password-hints
Update password hint text
2016-09-28 15:00:32 +01:00
Chris Hill-Scott
74efba61db Update password hint text 2016-09-28 14:57:50 +01:00
Chris Hill-Scott
317a01972c Merge pull request #953 from alphagov/fix-change-email-bug
Fixed bug where there was an error when try and change email.
2016-09-28 14:37:16 +01:00
Martyn Inglis
0bf39c75d9 Fixed bug where there was an error when try and change email.
- it tried to send a verify code which no longer is applicable
- one stage of process removed and tests update properly

Flow is:

- Change email
- Confirm with password
- Done
2016-09-28 14:34:22 +01:00
Chris Hill-Scott
6a0bf88211 Merge pull request #950 from alphagov/8-char-password
Reduce minimum password length to 8 characters
2016-09-28 14:34:02 +01:00
Chris Hill-Scott
3c005500a9 Merge pull request #952 from alphagov/ajax-activity-page
AJAX the activity page
2016-09-27 16:08:58 +01:00
Chris Hill-Scott
d9eac94f1e Make the activity page update with AJAX
The activity page looks the same as the job page. So it should behave
the same and not need manually refreshing to see the new stuff.
2016-09-27 15:34:47 +01:00
minglis
e056e44aba Merge pull request #951 from alphagov/remove-travis-image
Removed outdated build monitors
2016-09-27 15:29:46 +01:00
Chris Hill-Scott
0d936e373a Removed repeated if statements 2016-09-27 13:24:48 +01:00
Martyn Inglis
411b20ad1c Removed outdated build monitors 2016-09-27 12:41:28 +01:00
Chris Hill-Scott
d747389e2a Add variations on GOV.UK Notify to blacklist
There’s a chance that someone will run out of imagination and use
the name of the thing they’re signing up for as their password.

This wouldn’t be caught by the generic blacklist.
2016-09-27 12:24:46 +01:00
Chris Hill-Scott
68a6ceec78 Give better error message for blacklisted password
Telling the user what to do, rather than the mistake they’ve made is
usually better.
2016-09-27 11:51:12 +01:00
Chris Hill-Scott
136662bd30 Stop people using very common passwords
If a user chooses a very common password then an attacker could guess it
in relatively few attempts, circumventing the lockout.

CESG recommend blacklisting the most common passwords:

> …enforcing the requirement for complex character sets in passwords is
> not recommended. Instead, concentrate efforts on technical controls,
> especially:
>
> - defending against automated guessing attacks by either using account
>   lockout, throttling, or protective monitoring
> - blacklisting the most common password choices

How I made this list:

- went to the OWASP repository of security lists:
  https://github.com/danielmiessler/SecLists

- downloaded `10k_most_common.txt`, `twitter-banned.txt` and
  `500-worst-passwords.txt`

- filtered out any under 8 characters:
  ```
  sed -r '/^.{,7}$/d' passwords-twitter.txt > passwords-combined.txt
  sed -r '/^.{,7}$/d' passwords-500.txt >> passwords-combined.txt
  sed -r '/^.{,7}$/d' passwords.txt >> passwords-combined.txt
  ```

- filtered out any duplicates:
  ```
  cat passwords-combined.txt | awk '!x[$0]++' > passwords-combined-deduped.txt
  ```
2016-09-27 11:51:12 +01:00
Chris Hill-Scott
0c704c246d Reduce minimum password length to 8 characters
We see over and over in research that people are tripped up by the 10
character requirement because it’s longer than they are used to. Most
sites require 6 or 8 characters for a password.

It goes against the CESG advice which is to not try increasing password
strength by increasing the burden on the user:

> Traditionally, organisations impose rules on the length and complexity
> of passwords. However, people then tend to use predictable strategies
> to generate passwords, so the security benefit is marginal while the
> user burden is high.

https://www.cesg.gov.uk/guidance/password-guidance-simplifying-your-approach

Instead we should be relying on:

- [x] two factor authentication
- [x] blacklisting common passwords
- [ ] locking out users after a number of failed logins (not sure this
  is working)
2016-09-26 09:29:50 +01:00
Rebecca Law
e48fcf4a77 Merge pull request #947 from alphagov/add-email-domains-for-devs
Add email domains to whitelist for user registration.
2016-09-20 11:27:48 +01:00
Rebecca Law
4f20dceb9f Add email domains to whitelist for user registration. 2016-09-20 11:02:53 +01:00
Chris Hill-Scott
382c58aa34 Merge pull request #946 from alphagov/revert-942-govuk-doc-prototype
Revert "Link to GOV.UK tech doc format for Python client"
2016-09-20 10:16:06 +01:00
Chris Hill-Scott
cf2d0b0f82 Merge pull request #944 from alphagov/add-more-examples-email-template
Add more markdown to the example email
2016-09-20 10:15:53 +01:00
Chris Hill-Scott
39ab169e7d Revert "Link to GOV.UK tech doc format for Python client" 2016-09-20 09:06:53 +01:00
Chris Hill-Scott
610eaab1f8 Add more markdown to the example email
We have a route at /_email for testing the email template.

This commit adds:
- ordered lists
- a URL

And it fixes:
- the unordered list (markdown requires two line break before starting
  a list)

This is so that we can test how these features look locally without
having to send an email.
2016-09-19 09:39:37 +01:00
Rebecca Law
945f783891 Merge pull request #943 from alphagov/add-domain
Add a new domain for the email domain regex.
2016-09-15 09:43:19 +01:00
Rebecca Law
ef792d9d2a Add a new domain for the email domain regex. 2016-09-15 09:39:44 +01:00
Chris Hill-Scott
77f81ad08e Merge pull request #942 from alphagov/govuk-doc-prototype
Link to GOV.UK tech doc format for Python client
2016-09-14 13:17:38 +01:00
Chris Hill-Scott
e26f9764b3 Link to GOV.UK tech doc format for Python client
We want to try this out in research tomorrow, instead of the README
style doc we’ve been using up to this point.
2016-09-14 12:56:06 +01:00
Chris Hill-Scott
d047da69bf Merge pull request #941 from alphagov/bump-utils-faster-csv
Bump utils version
2016-09-14 12:54:27 +01:00
Chris Hill-Scott
20fa3d2ea8 Bump utils version
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/68
2016-09-14 10:31:00 +01:00
imdadahad
69c16cb0e4 Merge pull request #936 from alphagov/fix-forgot-password-empty-user-issue
Fix exception raised when a pending user attempts to complete 'forgotten password' flow
2016-09-13 15:39:29 +01:00
Chris Hill-Scott
6bad0101c8 Merge pull request #939 from alphagov/platform-admin-reorg
Reorganise list of services on platform admin page
2016-09-13 12:06:14 +01:00
Chris Hill-Scott
9da8734455 Merge pull request #935 from alphagov/fix-overlapping-on-notification-tables
Fix overlapping text on tables of notifications
2016-09-13 12:06:01 +01:00
Chris Hill-Scott
311ae4cfa4 Sort services by newest created first
Other than which services are live it’s also interesting to know what
services are getting created on Notify. So let’s put the newest ones at
the top of the page.
2016-09-13 10:38:33 +01:00
Chris Hill-Scott
88fff50ea3 Split platform admin page into live and trial mode
It sucks having to scroll down the massive list of services just to see
which ones are live.
2016-09-13 10:38:33 +01:00
Chris Hill-Scott
29d5bc4f51 Factor services table into a macro
Since we’re going to have spearate tables for live and trial mode
services it saves copying and pasting to have a macro for them. Not
worth completely factoring out into a component because it’s only going
to be used on this page.
2016-09-13 10:38:33 +01:00
Chris Hill-Scott
2156085813 Fix right aligned table headings
The CSS for these wasn’t being set on the correct class.
2016-09-13 10:38:33 +01:00
Chris Hill-Scott
e9d230b9a4 Always show created time for sending state
When a notification is in `created` or `sending` the thing you care
about is how long it’s been sitting there.
2016-09-13 10:37:38 +01:00
Chris Hill-Scott
6c961cc792 Remove date table field type
No longer used anywhere.
2016-09-13 10:37:38 +01:00
Chris Hill-Scott
95506e7c3b Refactor notification status into its own field type 2016-09-13 10:37:38 +01:00
Chris Hill-Scott
17d5af1a6e Show delivery time even for failed notifications
We reckon it’s probably still useful.
2016-09-13 10:37:38 +01:00