Martyn Inglis
786adb5d71
Move Queuenames in with the celery code, revamp config to allow move to celery 4.x
2017-07-12 12:01:52 +01:00
Ken Tsang
b04d01ba27
Refactored code to use new service permissions only
2017-07-06 12:27:55 +01:00
Imdad Ahad
4d41da22a4
Use correct schema for dumping a notification with personalisation
2017-07-06 12:27:55 +01:00
Leo Hemsted
a1e570dea7
persist created_by_id when using the one off notification endpoint
2017-06-20 12:06:49 +01:00
Leo Hemsted
729faf579d
block one-off sms with long content counts
2017-06-20 12:06:47 +01:00
Leo Hemsted
10b851b456
add send_notification file for handling sending one off messages
...
currently, they're made by creating a one-line job, but we want to
reduce task/csv file noise so we're moving them to persist in the
same vein as API usage. However, we can't just call through to that
since there are some differences:
* no api keys
* tighter control over API format
* no scheduling
* no client references
etc.
So, re-using as much of the v2 validation stuff as possible, I've
created this file that just does basic validation, and then calls
through to persist_notification and schedules a task. Woo.
2017-06-20 11:51:36 +01:00
Rebecca Law
3a66027d6a
Refactor ApiKeys.secret and ServiceInboundApi.bearer_token to use the same encryption method and get rid of the duplicate code.
2017-06-19 14:32:22 +01:00
Rebecca Law
6202da7dea
Update model to remove the string length restriction.
...
Moved logic to the dao from the endpoint.
2017-06-19 12:25:05 +01:00
Rebecca Law
effb99dca8
Add fetch request for service inbound api.
...
Add unique constraint on service_id for service_inbound_api.
2017-06-15 16:19:12 +01:00
Rebecca Law
828d5cd493
New table to store the inbound api information for a service. The table is versioned.
...
There is a new endpoint to create the inbound api and one to update it.
2017-06-15 11:32:51 +01:00
Rebecca Law
3fdd180515
New endpoint to set ServiceInboundApi data.
2017-06-13 18:00:25 +01:00
Imdad Ahad
dfeda93bc5
Merge pull request #1015 from alphagov/imdad-feat-return-content-outbound
...
Return notification content for outbound messages
2017-06-13 12:27:16 +01:00
Chris Hill-Scott
635fb8fe44
Add private endpoint to get notification by ID
...
We need this for the two way stuff in the admin app.
We already have this as a public endpoint, but the admin app can’t use
it, because the admin app auths with its own key, not that of the
service it’s acting on behalf of.
This endpoint makes sure that a request originating from one service
can’t be used to see notifications belonging to another service.
2017-06-06 16:21:57 +01:00
Imdad Ahad
3177a6ddc4
Return personalisation dump of notifications + small refactor
2017-06-05 15:54:40 +01:00
Martyn Inglis
7f65aa3eef
Merge branch 'master' into remove-nasty-query-from-dashboard
...
Conflicts:
app/service/rest.py
tests/app/service/test_rest.py
2017-06-01 13:11:54 +01:00
Martyn Inglis
75c5e5e5d5
Merge branch 'master' into redo-queue-visibitlity-timeout
...
Conflicts:
app/notifications/process_notifications.py
app/v2/notifications/post_notifications.py
2017-05-30 10:18:18 +01:00
kentsanggds
263adac805
Merge pull request #984 from alphagov/ken-update-api-service-permissions-handling
...
Ken update api service permissions handling
2017-05-26 14:39:27 +01:00
Imdad Ahad
77b82305f4
Search normalised in get_notifications_for_service:
...
* Use dao method to search against normalised(recipient)
* Add filter to accept one or more statuses
2017-05-26 11:58:50 +01:00
Ken Tsang
1375bbe400
Refactor schema to improve error response
2017-05-25 17:55:24 +01:00
Ken Tsang
54d85fd8df
Add tests for services with no permissions
2017-05-25 17:48:09 +01:00
Ken Tsang
2f626fa6fc
Add permissions validation in service schema
2017-05-25 17:47:21 +01:00
Ken Tsang
8e3e31faaf
Updated service DAO and API end points
2017-05-25 17:47:21 +01:00
Martyn Inglis
2591d3a1df
This massive set of changes uses the new queue names object throughout the app and tests.
...
Lots of changes, all changing the line of code that puts things into queues, and the code that tests that.
2017-05-25 10:51:49 +01:00
Leo Hemsted
554a193cff
separate service deserialization from validation
...
Marshmallow validates and deserialises - BUT, when it deserialises,
it explicitly sets `sms_sender=None`, even when you haven't passed
sms_sender in. This is problematic, because we wanted to take advantage
of sqlalchemy's default value to set sms_sender to `GOVUK` when the
actual DB commit happens.
Instead, still use marshmallow for validating, but manually carry out
the json deserialisation in the model class.
This fixes a bug that only manifested when the database was upgraded,
but the code hadn't updated. 🎉
2017-05-24 16:27:12 +01:00
Martyn Inglis
03346f467f
updated cache to store map not single value, to accommodate the billable units and the total cost.
2017-05-24 09:59:37 +01:00
Martyn Inglis
78a55bafe0
Added new cost field to yearly billable sms endpoint.
2017-05-24 08:57:41 +01:00
Martyn Inglis
119f0532ab
Renamed the API method/url
2017-05-22 10:06:34 +01:00
Martyn Inglis
f0395e7496
New endpoint to get the count of billable SMS units.
2017-05-19 16:43:05 +01:00
Chris Hill-Scott
2d4f10bd22
Comma-format number when emailing live services
...
250,000 is easier to read than 250000.
2017-05-16 12:33:01 +01:00
Imdad Ahad
d993e1a43e
Don't send notification if other service attrs changed
2017-05-15 15:02:01 +01:00
Imdad Ahad
5eb02a45a5
Send go live email when service goes live
2017-05-12 14:07:06 +01:00
Imdad Ahad
570d0ec9db
Send notification to active service users with user fields (optional)
2017-05-12 14:06:29 +01:00
Rebecca Law
a564b9aeb0
Update /service/{}/notifications to look for a "to" query string, if it exists call the search notifications_by_to_field method.
2017-05-08 17:20:21 +01:00
Rebecca Law
d252dc8976
New endpoint to search by "to" field of the notification.
...
The query ignores case and spaces.
2017-05-05 14:12:50 +01:00
Leo Hemsted
f577e91134
treat sent as delivered in detailed service api
...
this is for when we fetch the large blue numbers for viewing
notifications for an entire service
2017-04-28 11:56:12 +01:00
Rebecca Law
1a64509186
Change the resultset from the yearly and monthly billing data queries.
...
Fix some formatting of the return objects.
2017-04-28 10:10:49 +01:00
Rebecca Law
a186fc95be
Added new endpoints to return the yearly-usage and monthly-usage for a given financial year and service id.
...
Since the response has changed I have created new endpoints so that the deployments for Admin are more managable.
Removed print statements from some tests.
2017-04-28 10:10:48 +01:00
Ken Tsang
5f945ab30e
Refactored code, changed now to utcnow in test
2017-03-29 11:47:41 +01:00
Ken Tsang
c94b4f1b46
Removed unused import
2017-03-29 11:05:31 +01:00
Ken Tsang
af78efd137
Fix get_detailed_services BST
2017-03-29 11:03:28 +01:00
Rebecca Law
78242812ef
Register a before_request event for all blueprints, that defines the authentication requirement.
...
There are three authentication methods:
- requires_no_auth - public endpoint that does not require an Authorisation header
- requires_auth - public endpoints that need an API key in the Authorisation header
- requires_admin_auth - private endpoint that requires an Authorisation header which contains the API key for the defined as the client admin user
2017-03-16 18:15:49 +00:00
Rebecca Law
fd00351ad2
Testing out adding a admin authentication requirement per blueprint.
2017-03-15 16:52:44 +00:00
Imdad Ahad
36d52c6e42
Add template type to response and refactor
2017-03-08 12:01:38 +00:00
Imdad Ahad
520c588d56
Add endpoint to retreive stats for service by template per month
2017-03-08 12:01:38 +00:00
Imdad Ahad
8272a4388d
Add dao method to get template stats per month in financial year for service
2017-03-08 12:01:38 +00:00
Chris Hill-Scott
cffd0c2c54
Remove weekly stats endpoints
...
The weekly stats endpoint wont be used once
https://github.com/alphagov/notifications-admin/pull/1109 has been
merged.
It has been replaced with a new monthly endpoint in
https://github.com/alphagov/notifications-api/pull/807
2017-02-08 13:16:41 +00:00
Rebecca Law
30ca9e7e78
Merge pull request #811 from alphagov/check-service-is-active
...
Check service is active
2017-02-02 11:59:28 +00:00
Leo Hemsted
855a412c90
Merge pull request #812 from alphagov/plat-adm-dates
...
make sure we convert strings to dates before we use them
2017-01-31 16:24:30 +00:00
Leo Hemsted
cd47dbd36b
make sure we convert strings to dates before we use them
...
fixes 500 on platform admin page
2017-01-31 16:12:46 +00:00
Rebecca Law
dab89969cc
If the service is inactive at the time of sending the notification to the provider, the notification is marked as technical-failure.
...
Removed the /service/<id>/deactivate endpoint, now using /service/<id>/archive
2017-01-31 14:28:25 +00:00