Commit Graph

58 Commits

Author SHA1 Message Date
Chris Hill-Scott
ba48707371 Add routing and pages for managing templates
So that users can see what it the flow is like to:
- add new templates
- edit existing templates
2016-01-06 09:39:42 +00:00
Chris Hill-Scott
31e6e53d46 Make data consistent from dashboard -> job
- adds a table of recent activity to the job page, which is shared by the
  dashboard page
- uses the same filename and message template as the first job shown on the
  dashboard
- sets the time of file uploads/message delivery/message sending to always
  match ‘just now’
2016-01-05 13:31:54 +00:00
Chris Hill-Scott
0e6dab3f5c Add unit tests for activity (and SMS) flows
These are basic tests to make sure that the pages stay stitched together.

Added for both the jobs and send SMS flows (because the send SMS flow didn’t
have any before)
2016-01-05 13:31:54 +00:00
Rebecca Law
785c413cde Move and rename macro.html
Remove print statements
Fix code style
2016-01-04 15:50:26 +00:00
Rebecca Law
ac05f6931e Refactor add-service form such that the dao is not exposed in the forms. 2016-01-04 15:31:50 +00:00
Rebecca Law
b2f544a165 110880218: Completed implementation of resend the verificaton code 2015-12-31 13:16:59 +00:00
Rebecca Law
fb5e80e0d4 110880218: Implementation to resend the verification code.
Added implementation for GET/POST for the /verification-not-received endpoint.
2015-12-31 11:13:42 +00:00
Rebecca Law
10dd647f2b Merge pull request #35 from alphagov/did-not-receive-code
Implementation for did not receive email or sms code
2015-12-31 10:32:34 +00:00
Rebecca Law
e38df7cda1 109898688: Fix unit test 2015-12-17 16:16:12 +00:00
Rebecca Law
7478f8a0f3 Make Users.email_address unique 2015-12-17 14:57:26 +00:00
Rebecca Law
010be66d31 109898688: Complete the implementation of the did not receive code. 2015-12-17 14:33:20 +00:00
Rebecca Law
64812c1614 109898688: All codes are valid until one code is used, then they are all marked used.
Fixed the is_active() method on the Users model, if the user was pending they would come back as active, allowing a user to sign in before being active.
There is still a problem with the validate_sms_code and validate_email_code method.
2015-12-17 14:33:20 +00:00
Rebecca Law
bd8bb3c926 109898688: Implementation of text-not-received and email-not-received 2015-12-17 14:33:20 +00:00
Rebecca Law
e9383b733e 109898688: Implement get method for email-not-received and text-not-received 2015-12-17 14:33:20 +00:00
Rebecca Law
258ae3674b 110067722: Fix code style 2015-12-15 10:32:26 +00:00
Rebecca Law
eb0cff18c5 110067722: Add form validation for duplicate service name. 2015-12-15 10:32:26 +00:00
Rebecca Law
43f2605ac4 110067722: Post add-service endpoint saves the service and maps it to the user. 2015-12-15 10:32:26 +00:00
Rebecca Law
350ccda208 110067722: Added endpoints for add-service
Post is not complete as of yet.
2015-12-15 10:32:25 +00:00
Rebecca Law
4b01335703 110067722: Create the model and dao for services.
This commit creates the data model for services and user_to_service.
The dao is also created to insert, get, activate, and unrestrict the service.
2015-12-15 10:31:27 +00:00
Rebecca Law
caabda92e0 Test for VerifyForm and TwoFactorForm 2015-12-14 14:09:29 +00:00
Rebecca Law
295dbeb7d1 Create unit tests that test the forms. 2015-12-14 13:25:27 +00:00
Rebecca Law
c0550d2c61 Refactor unit tests 2015-12-14 13:25:27 +00:00
Rebecca Law
2b4097dd2d 109526036: Updates as per comments made on pull request. 2015-12-10 15:21:06 +00:00
Rebecca Law
588730d594 109526036: Persist the verify code to the db.
The codes are hashed and saved to the db.
The code is marked as used once a valid code is submitted.
The code is valid for 1 hour.
The codes are no longer saved to the session.
2015-12-10 14:48:01 +00:00
Rebecca Law
975aaf58ff 109638656: Add mocker for api client, which tries to send sms 2015-12-09 12:11:43 +00:00
Rebecca Law
9ba229820a 109638656: Implementation of two factor verification
Validation of the code is done in the form, when the form.validate_on_submit is called the validate code methods are called as well.
2015-12-09 11:36:57 +00:00
Rebecca Law
1af2dd5e98 109638656: Use Regex validator for sms code to ensure it is 5 digits. 2015-12-09 10:17:50 +00:00
Rebecca Law
7570a80a00 109638656: Added test and moved common function to __init__ 2015-12-09 10:17:09 +00:00
Rebecca Law
2e59870490 109638656: Implement two factor verify flow
When user enters valid sms code they are redirected to the dashboard.
Otherwise, form errors are present.
2015-12-09 10:17:09 +00:00
Rebecca Law
c946f85f9d 109638656: Send sms code from sign-in post. 2015-12-09 10:16:30 +00:00
Rebecca Law
eae2756a5e 109638656: Initial implementation for two-factor 2015-12-09 10:15:41 +00:00
Rebecca Law
ae19161b32 109526520: Use Regex validator to test the code is 5 digits. 2015-12-09 10:12:21 +00:00
Rebecca Law
9923c14e73 109526520: Changed the code form fields to StringField
When the codes were IntegerFields and the code started with zero, the zero was trimmed, resulting in a failed match.
2015-12-09 10:12:21 +00:00
Rebecca Law
bef2258803 109526520: Add custom validators for the VerifyForm
If the email_code or sms_code entered does not pass check password, then add errors to the form.
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
Rebecca Law
56db1ad400 109526520: fix code style 2015-12-09 10:12:21 +00:00
Rebecca Law
6d47c01117 109526520: Implememt verify post method. 2015-12-09 10:12:20 +00:00
Rebecca Law
69da9f8f32 109526520: render verify template with VerifyForm 2015-12-09 10:12:20 +00:00
Rebecca Law
229935c050 Remove test for temp_create_user, removed in previous commit. 2015-12-08 13:04:20 +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
9d9b80bab7 Login user after they register 2015-12-01 16:45:11 +00:00
Rebecca Law
3b96b6e5ca 108536374: Implement a validator to exclude passwords on a blacklist 2015-12-01 16:45:11 +00:00
Rebecca Law
9e2cf2fa4c 108536366: Implement register flow
Includes validation for gov.uk email address, mobile number with +44, password at least 10 char.
Form validation errors will be added to template in a later story.
User is created when form validates.
2015-12-01 16:45:11 +00:00
Rebecca Law
4b90c1105b remvoe unused import 2015-12-01 16:41:49 +00:00
Rebecca Law
64d2cbb927 108536366: Implement register flow
Includes validation for gov.uk email address, mobile number with +44, password at least 10 char.
Form validation errors will be added to template in a later story.
User is created when form validates.
2015-12-01 16:41:49 +00:00
Rebecca Law
e8d2a81597 108536490: Fix bug when user does not exist and tries to sign in 2015-12-01 10:35:49 +00:00
Rebecca Law
de0efcb508 108536490: Add test that post with bad password when account is locked results in 401 2015-12-01 10:00:07 +00:00
Rebecca Law
edfc1d6efc 108536490: Implement User.is_active()
If the state of the user is inactive the user.is_active() returns false.
2015-12-01 10:00:07 +00:00
Rebecca Law
3b27db98ff 108536490: Implement locked out function.
User is locked if they fail to login 10 times or more.
2015-12-01 10:00:07 +00:00
Rebecca Law
ff9e98907e 108536490: Update encryption for password 2015-12-01 10:00:07 +00:00