Martyn Inglis
909fac3c05
Added research mode tasks
...
- if a service is in research mode the don't send the notifications via the providers (MMG/SES/etc)
- instead set up a task to mimic those services callbacks - this completes the loop, and show stats, delivery receipts and so on.
- Use the "to" field to choose the response, allows users to create successful and errored notifications
temp fail sms, uses "07833333333"
perm fail sms, uses = "07822222222"
success = "07811111111" (or anything else)
success email = "delivered@simulator.notify "
perm fail = "perm-fail@simulator.notify "
temp fail = "temp-fail@simulator.notify "
2016-05-31 16:55:26 +01:00
Martyn Inglis
503ae80ece
Dev config does not send statsd
2016-05-16 12:05:26 +01:00
Martyn Inglis
829d862739
Fixed pep8 issues and hostname in the test environment.
2016-05-13 17:20:29 +01:00
Martyn Inglis
3f7559b286
Added statsd integration into the API
...
- new client for statsd, follows conventions used elsewhere for configuration
- client wraps underlying library so we can use a config property to send/not send statsd
Added statsd metrics for:
- count of API successful calls SMS/Email
- count of successful task execution for SMS/Email
- count of errors from Client libraries
- timing of API calls to third party clients
- timing of how long messages live on the SQS queue
2016-05-13 17:15:39 +01:00
Martyn Inglis
06bfe81329
Load testing client added
2016-05-12 10:46:35 +01:00
Martyn Inglis
571686b638
Ensure that the primary provider is used in all tasks
2016-05-10 09:04:22 +01:00
Adam Shimali
b51ee0b4d0
Add delivery status endpoint
2016-04-29 13:00:21 +01:00
Nicholas Staples
f71dbe9c0f
Message limit added and all tests passing.
2016-04-29 10:36:59 +01:00
Adam Shimali
4e81695c84
Added limit_days filter to get notifications dao.
2016-04-28 16:51:19 +01:00
Adam Shimali
24ea6f1637
Use short dates when selection notifications for deletion.
...
This means we will retain notifications for a full week and not
delete records that are 7 x 24 hours older than the time of the run of
the deletion task.
Also the task only needs to run once a day now, so I have changed
the celery config for the deletion tasks.
2016-04-25 16:12:46 +01:00
Rebecca Law
203d9f1e42
Fix mmg_api_key config
2016-04-08 11:04:24 +01:00
Rebecca Law
39f7aa0820
Fix bucket name for all environments
2016-04-08 10:28:25 +01:00
Nicholas Staples
143d1b0db8
Updated to retrieve csv upload from new bucket.
...
Fix test errors.
2016-04-07 14:10:30 +01:00
Rebecca Law
c132bbf46e
Rename NOTIFY_FROM_NUMBER to MMG_FROM_NUMBER, there should be a separate short code per provider.
2016-04-07 10:18:46 +01:00
Rebecca Law
e8d5a9292a
Merge branch 'master' into integrate_MMG
...
Conflicts:
app/notifications/rest.py
2016-04-06 14:58:13 +01:00
Nicholas Staples
4cc0028b01
Remove csv after process job is finished.
...
Fixed new tests.
2016-04-05 14:55:03 +01:00
Rebecca Law
2ba12da77d
WIP: adding delivery receipt endpoint for mmg
2016-04-04 15:02:21 +01:00
Rebecca Law
69697388d7
Initial set up for mmg client integration
2016-04-01 16:42:31 +01:00
Rebecca Law
df6f784f9e
- Remove different behaviour for debug mode in errors.py
2016-04-01 14:19:50 +01:00
Rebecca Law
8493e29acc
Added some more tests.
...
Removed the validation in the schema - it was adding complexity, let the unique constraint on the db throw the exception. This should only ever happen on a race condition which seems unlikely (two people changing a service to the same name at the same time)
Do no set debug=true to the test config. If debug=true it changes the behaviour of the error handlers, throwing the exception rather than returning a 500.
2016-04-01 13:42:11 +01:00
Nicholas Staples
090babaaeb
Added endpoint for removing user from service, all tests passing.
2016-03-22 13:14:23 +00:00
Adam Shimali
2d1d883283
Added task for sending email verification links out on intial
...
registration.
Left original email code endpoint in as it is still used for things like
email change.
2016-03-17 15:21:04 +00:00
Martyn Inglis
9a7788a6f5
Allowing overrides on a per environment basis
2016-03-17 11:47:44 +00:00
Martyn Inglis
976a4c06e3
Renamed some files and fixed a bug on deleting the failed notifications
2016-03-10 09:34:27 +00:00
Martyn Inglis
c8a5366484
Scheduled tasks to clean up the database
...
- tasks run hourly
- uses celery beat to schedule the tasks
4 new tasks
- delete verify codes (after 1 day)
- delete invitations (after 1 day)
- delete successful notifications (after 1 day)
- delete failed notifications (after 7 days)
Delete methods in the DAO classes
2016-03-09 17:46:01 +00:00
Martyn Inglis
fbfa176895
First schedule
2016-03-09 14:41:36 +00:00
Rebecca Law
49198b26e7
Merge branch 'master' into reset-password
...
Conflicts:
app/schemas.py
tests/app/celery/test_tasks.py
2016-03-09 09:36:57 +00:00
Rebecca Law
5d7b1bc786
Removed DELIVERY_CLIENT_USER_NAME and DELIVERY_CLIENT_SECRET from configs and auth module
2016-03-08 15:27:12 +00:00
Rebecca Law
5c4ac9d938
Include token creation date in the url token.
2016-03-07 18:20:20 +00:00
Rebecca Law
b15d3434c3
Added an endpoint and celery task to email a reset password url.
2016-03-07 14:34:53 +00:00
Rebecca Law
0169ebe69a
Add routing keys to celery queues.
...
NOTE: make sure upstart script on preview is updated before merging.
2016-03-02 16:22:22 +00:00
Rebecca Law
fde062ec7d
Reduce polling_interval back to 1 second
2016-03-02 14:04:03 +00:00
Rebecca Law
6a739d5ec9
Remove celery_queues from config.
...
Removed unused endpoint.
2016-03-02 13:15:23 +00:00
Martyn Inglis
3872ac5e67
Moved the deinition of which queues the worker will consume from
...
- now in config not the script
2016-03-01 16:57:06 +00:00
Rebecca Law
dd503e7f14
Merge pull request #113 from alphagov/fetch-notifications-endpoints
...
Fetch endpoints for notifications
2016-03-01 15:16:54 +00:00
Martyn Inglis
c5a993ead1
Fetch endpoints for notifications
...
- includes check on token type to ensure clients can perform admin style fetches
2016-03-01 13:30:10 +00:00
Rebecca Law
3879350c12
Send email invitation to invited user
2016-02-29 15:56:00 +00:00
Rebecca Law
df278a8e6e
Email invitation to an invited user.
...
New celery task to send the email.
2016-02-29 13:21:12 +00:00
Martyn Inglis
b01782bbe6
Send Email via the API
...
- uses the new subject/email from fields present on the templates / service tables
- brings the send email api call into line with the sms one.
- same fields (to/template_id)
- same rules regarding restricted services
- wired in as a task into celery
Requires
- new celery queue
- new env property (NOTIFY_EMAIL_DOMAIN)
2016-02-22 17:17:29 +00:00
Rebecca Law
7afa87c367
Merge branch 'master' into celery-send-sms-code
...
Conflicts:
tests/app/celery/test_tasks.py
2016-02-17 15:43:57 +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
Martyn Inglis
226459132a
Basic (Very basic) implementation of the fire text API.
...
[https://www.firetext.co.uk/docs#sendingsms ](https://www.firetext.co.uk/docs#sendingsms )
Not to be merged. This API has a limit on it at the moment that will need to be removed before it is used in anger.
2016-02-17 12:57:51 +00:00
Martyn Inglis
95cdfe08d1
Updated logging in run-celery script to log to application logs
...
- poll every second
- visibility of 1 minute
2016-02-17 11:18:27 +00:00
Martyn Inglis
e0e47b40fc
Setup celery config
2016-02-17 10:22:25 +00:00
Martyn Inglis
cb265896a7
Merge branch 'master' into move-sms-notifications-into-celery
...
Conflicts:
app/__init__.py
tests/conftest.py
2016-02-17 09:14:37 +00:00
Rebecca Law
af86520e95
Add verify_code_email_address
2016-02-16 16:03:30 +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
Nicholas Staples
20650a91e0
Update to config to pull out from email address.
2016-02-16 11:10:02 +00:00
Martyn Inglis
223cb8c2dd
Made SMS messages go through celery
...
- twilio client pulled in from delivery app
- made method to perform task
2016-02-15 16:01:14 +00:00
Martyn Inglis
fcc1585fdf
Merge branch 'master' into celery-spike
...
Conflicts:
app/__init__.py
app/notifications/rest.py
config.py
wsgi.py
2016-02-12 09:36:49 +00:00