Martyn Inglis
a2341be0e2
Don't send the SMS if we have failed to save in the database
2016-02-16 17:42:04 +00:00
Martyn Inglis
0933e5c647
Building tests for the tasks class
2016-02-16 17:17:02 +00:00
Rebecca Law
08ba5de61b
Update config
...
Source the configuration from an environment file, this way it is similar to how the aws environment works
2016-02-16 16:01:50 +00:00
Martyn Inglis
18d63e241b
Extracted serialiser for encryption into a flask module
...
- allows mocking easier
- shared across methods
- not built everytime
2016-02-16 15:28:30 +00:00
Martyn Inglis
e42da7dd54
Fixing up tests to validate the call to the celery tasks.
...
- mocker used to test call or otherwise of the task
- no new tests just a spring clean
2016-02-16 14:06:56 +00:00
Martyn Inglis
655beddba6
Fixed up the get_notitication endpoint
...
- returns a notification
2016-02-16 11:22:44 +00:00
Nicholas Staples
918c561726
Code added to now check service id matches the authorization token service for sending an sms.
2016-02-12 11:13:54 +00:00
Rebecca Law
0cd5fa278b
Fix a intermittent test.
...
Removed the need for sample_admin_service_id in service/test_rest
2016-02-10 13:09:36 +00:00
Rebecca Law
2db0f9737e
Added a test to check endpoint works with an id in payload.
2016-02-10 12:46:52 +00:00
Rebecca Law
a01828a6d0
Return notification_id on create notification endpoints
...
- /notification/sms
- /notification/email
- /notificaiton/sms/service/<service_id>
Update message attribute on SQS to notification_id from message_id
2016-02-10 12:46:52 +00:00
Adam Shimali
3a2cfc96e6
job on notification now nullable.
2016-02-10 11:08:24 +00:00
Martyn Inglis
d38ba0d36a
bumped client version
2016-02-09 18:48:02 +00:00
Adam Shimali
e6a7e07505
Fix for create job id on api side
2016-02-09 18:28:28 +00:00
Nicholas Staples
1b25a3c762
Removed alpha client imports.
2016-02-09 16:13:48 +00:00
Nicholas Staples
09d2f0d79d
Fix tests.
2016-02-09 16:04:49 +00:00
Nicholas Staples
bd947d0743
Merge remote-tracking branch 'origin/master' into remove_alpha_client_from_api
2016-02-09 15:54:21 +00:00
Adam Shimali
17e5e70f6c
[WIP] Added endpoints under /job for creating, updating and reading
...
notification status.
2016-02-09 14:17:42 +00:00
Adam Shimali
e5e049d735
Added service and template relationship to notification model.
...
This makes it more consistent with other model classes with respect
to marhmallow serialisation/deserialisation.
2016-02-09 12:48:27 +00:00
Adam Shimali
c7121be5a2
[WIP] New model class and dao for notification. This will be used for
...
recording status and outcome of sending notifications.
2016-02-09 12:03:40 +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
Adam Shimali
0580f5ab06
New endpoint for delivery app to use.
...
Once removal of code that uses existing alpha is done, then
duplicated code from /notifications/sms and the new endpoint
can be merged.
Job id is now avaiable in notificaiton but is not used yet.
2016-02-08 14:54:15 +00:00
Rebecca Law
416dd00ac8
Added a test for the case when there is no secret for the api client.
...
Fix codestyle
2016-02-08 11:33:24 +00:00
Adam Shimali
23f4ce7255
Fix for incorrect property name for service and template.
2016-02-05 16:33:07 +00:00
Adam Shimali
e024db6858
As job update is a PUT then all non nullable fields
...
need to be sent with update.
Also bug in not committing update fixed.
2016-02-05 13:07:02 +00:00
Adam Shimali
bec4bbe04e
Endpoint and dao method for updating job status.
2016-02-04 20:55:09 +00:00
Adam Shimali
aa57730fc9
Add more properties of job to job message.
2016-02-04 12:36:53 +00:00
Rebecca Law
1d4d03dbe8
Update to create_sms_notification
...
Removed the logic to check the api_user is the admin client user name.
There is another controller method to handle sending the verification codes.
2016-02-04 12:07:26 +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
Nicholas Staples
aba1cd2ed5
Sqs queues now populated from all create_notification api calls. Marshmallow schemas added for notification.
2016-02-03 13:16:19 +00:00
Adam Shimali
0ade39e63f
Add job to queue as soon as it in created.
...
Added status to job.
2016-02-02 15:14:04 +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
Nicholas Staples
2451f7e53d
Added support for validation only of put requests.
2016-01-29 11:11:00 +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
Adam Shimali
9bf11b3d40
Merge pull request #39 from alphagov/add_password_update
...
Added support for allowing password to updated from the PUT request t…
2016-01-28 11:54:26 +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
a546665188
Some code clean up.
...
Clean up the unit test.
2016-01-28 11:06:24 +00:00
Rebecca Law
42a4c8b0b1
Add sms notifications from a service to a queue.
2016-01-27 17:42:05 +00:00
Rebecca Law
daff1c3f53
Add queue name to service table.
...
Set queue name when creating the service
2016-01-27 14:18:11 +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
Adam Shimali
d62b5bdce7
Record and persist failed login count on api.
2016-01-25 11:14:23 +00:00
Nicholas Staples
e1c8360fd1
Test fix.
2016-01-22 14:58:03 +00:00
Nicholas Staples
11c7795396
Merged with master.
2016-01-22 14:46:03 +00:00
Nicholas Staples
a9fe6ad469
Working code and tests.
2016-01-22 14:43:30 +00:00
Rebecca Law
5a937d6e71
Added user_id as a query param for get_services.
...
Need to add this query param for the services page on the admin app.
Do not add the query param to path in the token.
2016-01-22 12:47:59 +00:00
Nicholas Staples
e657958af4
Templates fix with tests working.
2016-01-22 10:44:34 +00:00
Rebecca Law
cc829fee68
Merge branch 'master' of github.com:alphagov/notifications-api
2016-01-22 10:03: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