Commit Graph

39 Commits

Author SHA1 Message Date
Nicholas Staples
16e1ecb134 Working permissions and all tests passing.
Remove print statements.

Fix for review comments.
2016-02-26 15:00:29 +00:00
Adam Shimali
21e791b25c Add endpoint for getting user by email address 2016-02-23 11:03:59 +00:00
Martyn Inglis
530c8a2faa Fixed merge issues 2016-02-22 13:27:47 +00:00
Martyn Inglis
886b206d63 Merge branch 'master' into email-templates
Conflicts:
	app/user/rest.py
	tests/app/user/test_rest.py
2016-02-22 13:12:24 +00:00
Martyn Inglis
cc720b137f Merge branch 'master' into email-templates
Conflicts:
	app/user/rest.py
2016-02-19 17:33:28 +00:00
Martyn Inglis
98314485d3 Generate the email_from from the service name. 2016-02-19 17:07:59 +00:00
Martyn Inglis
dc294c32ae Fix all other dependant classes that are affected by the DAO / Service / Model changes 2016-02-19 15:54:11 +00:00
Rebecca Law
17d14f291e Refactor user/<user_id>/code into two endpoints.
- Created new endpoint user/<user_id>/sms-code to send the sms verification code to the user.
- Create new endpoirtn user/<user_id>/email-code to send the email verifcation code to the user.
- Marked the old methods, schema, tests with a TODO to be deleted when the admin app is no longer sending messages to /user/<user_id>/code
- Added error handlers for DataError and NoResultFound. Data error catches invalid input errors.
- Added error handler for SqlAlchemyError which catches any other database errors.
- Removed the need for the try catches around the db calls in the user endpoints with the addition of the db error handlers.
- We may want to wrap db excpetions in the dao, if we want the No results found message to be more specific and say no result found for user.
2016-02-19 11:37:35 +00:00
Rebecca Law
9ea2acfdae Use dashes in the celery queue names 2016-02-18 11:18:35 +00:00
minglis
9b99782662 Merge pull request #83 from alphagov/celery-send-email-code
Celery send email code
2016-02-18 11:03:23 +00:00
Rebecca Law
4d9d511575 Merge pull request #81 from alphagov/celery-send-sms-code
Use Celery to send sms code
2016-02-18 10:51:16 +00:00
Rebecca Law
3ce6758f3e Change names for clarity sake.
Rename test.
What we do when the validation_code fails to send is still to be decided.
2016-02-18 09:59:18 +00:00
Rebecca Law
c1df61a7d4 Use celery to send the email verification code. 2016-02-18 09:52:27 +00:00
Rebecca Law
9073814d9f I have an issue with the test, not sure why? 2016-02-17 17:48:23 +00:00
Adam Shimali
4f33b6f406 Wire up error handlers.
Replace some 400s with more appropriate 500s.

DAO methods that cause unexpected exceptions get caught and
logged by errors.py 500 error handler.
2016-02-17 17:04:50 +00:00
Rebecca Law
d022d036dc Celery task to send the sms verify code.
Each celery task will use it's own queue.
2016-02-17 15:41:33 +00:00
Nicholas Staples
20650a91e0 Update to config to pull out from email address. 2016-02-16 11:10:02 +00:00
Nicholas Staples
1b25a3c762 Removed alpha client imports. 2016-02-09 16:13:48 +00:00
Nicholas Staples
2fda7ee59b Alpha client removed from code. Tests fixed but will wait till other notifications jobs are done before creating a pull request. 2016-02-09 11:38:57 +00:00
Nicholas Staples
409857fba6 Now done. 2016-02-08 09:43:19 +00:00
Nicholas Staples
8fd15b44eb Missed a couple of places where we should push to the queue. 2016-02-03 13:52:09 +00:00
Rebecca Law
b5c662eca8 Change services.id to a UUID
Ideally all the primary keys in the db would be UUID in order to guarantee unique ids across distributed dbs.
This updates the services.id to a UUID. All the tables with a foreign key to the services.id are also updated.
The endpoints no longer state a data type of the <service_id> path param.
All the tests are updated to reflect this update.

The thing to pay attention to is the 0011_uuid_service_id.py migration script.
This commit must go with a commit on the notifications_admin app to keep things working.
There will be a small outage until both deploys have happened.
2016-02-02 14:22:22 +00:00
Rebecca Law
cec0d40e5b Create schema for RequestVerifyCodeSchema
Previously we were using a schema that mapped onto db.Model. However, the json
in the request did not reflect the VerfiyCode db Model.
I did not add validation on the to field, we did not have that previously.
2016-02-01 10:48:33 +00:00
Adam Shimali
806b3f6851 If failed login count > 0 and user subsequently logs in sucessfully,
then failed logins set to 0.
2016-01-28 11:58:33 +00:00
Nicholas Staples
66c1d858ac Added support for allowing password to updated from the PUT request to the user rest endpoint. 2016-01-28 11:41:21 +00:00
Rebecca Law
3536aef8c0 Use VerifyCodeSchema 2016-01-27 12:11:25 +00:00
Rebecca Law
ba1a496520 Update send user code to use optional to field 'to' send the sms message to. 2016-01-27 11:54:28 +00:00
Rebecca Law
5dc48f8a01 Updated send user code to use an optional to field to send emails
Added tests for send_user_code
2016-01-27 11:51:02 +00:00
Rebecca Law
20f71487df Remove trailing slash from /verify/code 2016-01-26 15:32:55 +00:00
Adam Shimali
d62b5bdce7 Record and persist failed login count on api. 2016-01-25 11:14:23 +00:00
Nicholas Staples
11c7795396 Merged with master. 2016-01-22 14:46:03 +00:00
Nicholas Staples
2c4f2c92b5 Fix for empty response 204. 2016-01-22 12:07:09 +00:00
Rebecca Law
8fa1cac1c6 Fix the user url.
Add test for authentication to test paths with path params
2016-01-22 09:59:02 +00:00
Nicholas Staples
6b035cd324 All tests working, second time around. 2016-01-21 17:29:24 +00:00
Nicholas Staples
0ec69b89ee Added user verify password endpoint. 2016-01-20 16:25:18 +00:00
Adam Shimali
44824c9985 Update error message for password to match marshmallow errors. 2016-01-19 12:07:14 +00:00
Adam Shimali
f839bae1f5 Add rest of user model fields to api.
First step to moving user interactions to api.
2016-01-19 11:39:59 +00:00
Rebecca Law
b05ad17029 Remove trailing slashing from urls 2016-01-15 17:02:29 +00:00
Rebecca Law
010408d98a Remove the view packages 2016-01-14 16:13:27 +00:00