Rebecca Law
488ba7a1ef
Remove import
2016-11-11 10:56:21 +00:00
Rebecca Law
b0d88e0888
Removed OrderedDict
...
Added missing assert in test
2016-11-11 10:50:38 +00:00
Rebecca Law
c758694b98
Change validation error message to a string from a dict.
2016-11-10 16:30:51 +00:00
Rebecca Law
7d763260ce
Update format of the errors for DataError and exception
2016-11-10 14:53:39 +00:00
Rebecca Law
26d6a0c1a9
Merge branch 'master' into change-v2-error-resp
2016-11-10 14:21:20 +00:00
Leo Hemsted
abecb5ff98
Merge pull request #726 from alphagov/auth-500
...
update python client to 2.0.0
2016-11-10 13:47:34 +00:00
Leo Hemsted
dd004a6154
Merge pull request #727 from alphagov/exc-handl
...
remove 500/unplanned exception handlers in test
2016-11-10 13:47:13 +00:00
Rebecca Law
346d90e319
update V2 error response to
...
{status_code: 403,
errors: [error: AuthError, message: token has expired}]
}
2016-11-09 14:56:54 +00:00
Rebecca Law
78e84801bd
Merge branch 'master' into change-v2-error-resp
2016-11-08 15:59:42 +00:00
Chris Hill-Scott
bec20d3854
Merge pull request #728 from alphagov/case-insensitive-auth-header
...
Make bearer prefix on auth header case insensitive
2016-11-07 14:59:09 +01:00
imdadahad
273984a629
Merge pull request #729 from alphagov/logging-around-jobs-and-tasks
...
Added job id to logger
2016-11-07 12:00:48 +00:00
Martyn Inglis
15ba0a3eb1
Added job id to logger
2016-11-07 11:59:46 +00:00
Chris Hill-Scott
9248e72c50
Make bearer prefix on auth header case insensitive
...
From a support ticket:
> the "Bearer" prefix on the auth header is case sensitive. Can this be
> made case-insensitive?
Sure can 🙃
2016-11-07 10:49:05 +00:00
Leo Hemsted
f842a8c893
update test to pytest.raises instaed of assert response == 500
2016-11-04 17:04:51 +00:00
Leo Hemsted
ed187f7fad
remove 500/unplanned exception handlers in test
...
this means if your code throws an exception, in the test you'll see the full stack trace to help debugging
2016-11-04 16:37:55 +00:00
Leo Hemsted
f089b75129
update python client to 2.0.0
...
this is to prevent 500 errors because <2.0.0 raised AssertionError
if supplied JWT tokens were incorrectly formatted
tests added
2016-11-03 17:05:25 +00:00
bandesz
edf22860e1
Bump boto version to 2.43.0-patch3
2016-11-02 17:59:09 +00:00
Rebecca Law
4cb38e2d12
Use status_code in error response.
...
Remove code.
2016-11-02 14:58:39 +00:00
Rebecca Law
db91a87fb2
Remove link from v2 error response
2016-11-02 14:48:15 +00:00
Rebecca Law
9f9ec28e2c
Merge pull request #724 from alphagov/post-sms-v2
...
Move jsonschema to requirements.txt to missing dependency
2016-11-02 14:16:27 +00:00
Rebecca Law
83f3c92c24
Move jsonschema to requirements.txt to missing dependency
2016-11-02 14:02:06 +00:00
Rebecca Law
58a010ae77
Merge pull request #721 from alphagov/post-sms-v2
...
Post sms v2
2016-11-02 13:38:42 +00:00
Rebecca Law
36ac00811d
Create dict for the fields in the error response.
2016-11-02 09:13:48 +00:00
Rebecca Law
e32978b72a
Merge branch 'master' into post-sms-v2
2016-11-02 09:08:26 +00:00
Rebecca Law
482d10545b
Improvements to the tests.
...
Update AuthError with a to_dict_v2 method.
2016-11-01 10:33:34 +00:00
Rebecca Law
a358f3cb3a
Error handler for schema validation errors
2016-10-31 15:43:11 +00:00
Chris Hill-Scott
5485252b85
Merge pull request #720 from alphagov/utils-bump-email-newline
...
Bump utils
2016-10-31 16:05:37 +01:00
Leo Hemsted
11cebb295c
Merge pull request #718 from alphagov/letters-flag
...
add can_send_letters flag to services
2016-10-31 14:46:25 +00:00
Rebecca Law
fc298367c5
Updated test_validators to test the contents of the error messages.
...
Added some tests to the test_post_notifications.
Added a errorhandler for AuthErrors.
This endpoint is not being used anywhere, however there is some common code being used in the v1 post endpoint. The only thing that may be affected is the error response, hopefully they are the same.
2016-10-31 12:22:26 +00:00
Chris Hill-Scott
9192ff137f
Bump utils
...
Includes:
- [ ] https://github.com/alphagov/notifications-utils/pull/75
2016-10-31 09:21:18 +00:00
imdadahad
250a14092c
Merge pull request #719 from alphagov/use-wheels-to-speed-as-deployment
...
Move wheel dependency installation to docker build
2016-10-28 17:54:39 +01:00
Imdad Ahad
ebe2ec4341
Install pip wheel in the dockerfile
2016-10-28 17:48:31 +01:00
Imdad Ahad
c8be8db742
Use venv for installation
2016-10-28 17:43:27 +01:00
Imdad Ahad
497f56bc81
Move wheel dependency installation to docker build
2016-10-28 17:27:37 +01:00
imdadahad
62303571ce
Merge pull request #717 from alphagov/use-wheels-to-speed-as-deployment
...
Use python wheels to speed up AS deployment
2016-10-28 17:15:23 +01:00
Rebecca Law
8cf2fc72a8
- Refactor version 1 of post notificaitons to use the common persist_notificaiton and send_notification_to_queue methods.
...
- It would be nice to refactor the send_sms and send_email tasks to use these common functions as well, that way I can get rid of the new Notifications.from_v2_api_request method.
- Still not happy with the format of the errors. Would like to find a happy place, where the message is descript enough that we do not need external documentation to explain the error. Perhaps we still only need documentation to explain the trial mode concept.
2016-10-28 17:10:00 +01:00
Rebecca Law
6e4bad135a
- Implemented persist_notification and send_notification_to_queue in the process_notifications module
...
- Not sure I want to create a new classmethod on Notifications to create from v2 request. Will take another look at that.
2016-10-27 17:34:54 +01:00
Rebecca Law
c2eecdae36
- Add validation methods for post notification.
...
- Use these validation methods in post_sms_notification and the version 1 of post_notification.
- Create a v2 error handlers.
- InvalidRequest has a to_dict method for private and v1 error responses and a to_dict_v2 method to create the v2 of the error responses.
- Each validation method has extensive unit tests, so the unit test for the endpoint do not need to check every error case, but check that the error handle formats the message correctly.
- The format of the error messages is still a work on progress.
- This version of the api could be deployed without causing a problem to the application.
- The new endpoing is still a work in progress and is not being used yet.
2016-10-27 11:46:37 +01:00
Leo Hemsted
a45c62d41d
add can_send_letters flag to services
...
defaults to false
2016-10-26 13:01:40 +01:00
Rebecca Law
23a4f00e56
New package structure for the version 2 of the public api.
...
Start building up the validators required for post notificaiton.
The app/v2/errors.py is a rough sketch, will be passed a code, the error can look up the message and link for the error message.
2016-10-25 18:04:03 +01:00
Rebecca Law
a5e07d8aff
V2 schemas for post sms notifications, post_sms_request and post_sms_response
2016-10-25 14:53:31 +01:00
Imdad Ahad
72993311b3
Install wheel when building artifact
2016-10-24 16:23:18 +01:00
Imdad Ahad
177515de8f
Use python wheels to speed up AS deployment:
...
* Create wheels from python dependencies on building codedeploy artifact
* Update script to install wheels and default to pypi if not found
2016-10-21 16:16:10 +01:00
Leo Hemsted
e5bedbd789
Merge pull request #716 from alphagov/error-handling
...
Error handling
2016-10-19 10:24:18 +01:00
Andras Ferencz-Szabo
5d840bfab0
Merge pull request #715 from alphagov/use_patched_boto
...
Bump up boto version to 2.42.0-patch2
2016-10-18 09:58:20 +01:00
bandesz
a675509b5e
Bump up boto version to 2.42.0-patch2
2016-10-17 18:10:16 +01:00
Leo Hemsted
a1cc092d3b
fix logger.exception syntax
...
when given any log function with multiple parameters, the python logging utils
assume the first param is a format string and the rest are arguments to pass
in - we were passing in the exception object to `logger.exception`, however,
the purpose of .exception is to add the exception object itself - so we didn't
need to
2016-10-17 17:44:17 +01:00
Leo Hemsted
65197a6c91
handle Exception and remove duplication in errors.py
...
ensure that if unexpected Exceptions are thrown, we handle them correctly
(log and then return JSON)
also remove some branches that will never trip, and combine a couple of
identical functions
2016-10-17 17:41:39 +01:00
Andras Ferencz-Szabo
7ff373723d
Merge pull request #714 from alphagov/use_patched_boto
...
Use custom patched boto: 2.42.0-patch1
2016-10-17 16:55:10 +01:00
bandesz
cffedb1a05
Use custom patched boto: 2.42.0-patch1
2016-10-17 16:42:41 +01:00