Chris Hill-Scott
761ff86591
Merge pull request #853 from alphagov/ignore-additional-personalisation
...
Quietly ignore extra personalisation
2017-03-10 16:16:27 +00:00
imdadahad
c11f4b5d5d
Merge pull request #829 from alphagov/feat-add-endpoint-for-service-monthly-usage-stats
...
Add endpoint for service monthly usage stats by template
2017-03-09 16:12:22 +00:00
Imdad Ahad
ed8dcf5fa1
Refactor schemas and add tests to ensure user is returned on provider schema
...
dump
2017-03-09 08:43:44 +00:00
imdadahad
7b110d9ae4
Merge pull request #851 from alphagov/feat-add-who-updated-providers
...
Store who updated providers
2017-03-08 16:23:44 +00:00
Imdad Ahad
a4dc614ef7
Restore dao_create_template and use custom template fixture instead
2017-03-08 13:03: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
e507fed152
Quietly ignore extra personalisation
...
> If a user makes an API request with additional personalisation fields,
> we should simply discard any fields that the template doesn't have.
>
> This gives a couple of related advantages:
>
> - modifying template parameters no longer requires downtime for
> clients - as they can pass in extra new parameters before a template
> change, or continue passing in old unused parameters after removing
> them from a template
>
> - services can pass in large user objects, for example, and then play
> around with templates adding and removing fields at will
>
> we should make sure we still return an error if a user doesn't pass in
> a required parameter.
– https://www.pivotaltracker.com/story/show/140774195
2017-03-07 16:09:17 +00:00
Rebecca Law
77f520acba
Created an endpoint to test how the incoming messages from MMG will work.
...
So this just prints the response to logs, removing the phone number first. Then returns the requested RECEIVED.
2017-03-06 11:58:49 +00:00
bandesz
e8bf03c7e1
Get Redis config from PaaS
2017-03-03 11:35:51 +00:00
Imdad Ahad
f6dbc6a06c
Updates:
...
* Add endpoint to retrieve provider history
* Remove marshmallow schemas when updating a provider
* Include created by user when updating a provider
2017-03-03 10:54:20 +00:00
Imdad Ahad
fe2ccb2222
Remove unused import and ensure provider details are restored after test
2017-03-03 10:54:20 +00:00
Imdad Ahad
37341e7a62
Updates:
...
* Add notify user id in config
* Add dao method to get provider history versions along with tests
* BUG: Provider switching did not handle case where priorities were equal. This
* adds a fix to properly cover this case along with tests
2017-03-03 10:54:20 +00:00
Rebecca Law
6386cb968a
Fix tests.
...
Fix copy/paste error in the history table
2017-03-02 12:12:01 +00:00
Rebecca Law
70a239b023
Merge pull request #846 from alphagov/fix-failed-login-count
...
Fix failed login count
2017-02-28 16:24:46 +00:00
Rebecca Law
fd0bfbe2f6
If user account is locked return 404 even if the code is correct.
...
Update user.failed_login_count = 0 if code is correct.
New endpoint to reset the failed_login_count
2017-02-28 14:28:33 +00:00
Rebecca Law
fb61b4528b
Remove resetting the failed_login_count to zero in the api. The admin app will deal with doing that.
2017-02-28 11:21:47 +00:00
imdadahad
f4be099533
Merge pull request #824 from alphagov/feat-switch-providers-on-slow-delivery
...
Auto-switch providers on slow delivery of notifications
2017-02-27 16:25:15 +00:00
Imdad Ahad
d7e4ca2a43
Remove created notification - not needed for test
2017-02-27 15:01:44 +00:00
Imdad Ahad
ed65150f3b
Update set primary sms helper to use compulsory identifier
2017-02-27 13:45:53 +00:00
Imdad Ahad
d805985a4e
Refactor tests to use cleaner fixture and be more verbose in tests
2017-02-27 13:18:42 +00:00
Imdad Ahad
17b6c13c46
Small updates:
...
* Make config use new provider sms template id
* create_notification to account for created status
* Small robustness addition to test
2017-02-27 13:16:48 +00:00
Leo Hemsted
8bad5926ab
dont set session_id or logged_in_at if user provides email code
2017-02-24 15:14:47 +00:00
Imdad Ahad
204d72830f
Update switch task to use sent_at and newer db helpers
2017-02-24 13:41:32 +00:00
Imdad Ahad
eafe8269ef
Simplify dao method and update tests and fixtures
2017-02-24 13:39:58 +00:00
Imdad Ahad
73d5ce4f8b
Add tests to verify correctness of the switching provider task
2017-02-24 12:23:39 +00:00
Imdad Ahad
60f63a30db
Add dao method to get count of slow delivery notifications by provider
2017-02-24 12:23:39 +00:00
Leo Hemsted
a47672f7e3
Add current_session_id to the user model, update on login
...
when we change the last logged in time, set the current session id to
a random uuid
this way, we can compare it to the cookie a user has, and if they
differ then we can log them out
also update user.logged_in_at at 2FA rather than password check, since
that feels more accurate
2017-02-22 17:30:55 +00:00
Chris Hill-Scott
22aeb5455c
Merge branch 'master' into gsm
2017-02-20 10:13:53 +00:00
Chris Hill-Scott
7775a36cf3
Merge pull request #821 from alphagov/remove-weekly-stats-endpoints
...
Remove weekly stats endpoints
2017-02-17 14:53:44 +00:00
Leo Hemsted
c30b4d00e7
bump utils to 13.6.0 - downgrade non-gsm chars on sms send
...
also refactor test_send_to_providers to use the shiny new db.py
create_*db obj* functions and clean up some of the fixture usage
2017-02-17 11:26:43 +00:00
Leo Hemsted
0515c51475
replace notify_api with client fixture in user/test_rest.py
2017-02-17 11:02:28 +00:00
Leo Hemsted
521872ce63
update_user now resets failed_login_count if password is changed
...
until work is done to stop using PUT /user/{id} on the admin app, this
function also needs to reset failed logins, cos it's used during the
forgotten password flow
2017-02-16 17:39:47 +00:00
Leo Hemsted
ac9739f8a2
ensure we reset failed_login_count when appropriate
...
in verify_user_password, if succesful we reset the failed_login_count.
now we use failed_login_count for 2FA attempts, we need to make sure we
reset it in other places too, so that people don't get blocked,
especially in the reset-password user journey.
* verify_user_code - if it's succesful, reset the failed_login_count
* update_password - reset failed_login_count because either
* you're logged in and so it's 0 anyway
* you're resetting your password via pword reset link, and the old
count isn't relevant anymore
2017-02-16 16:00:40 +00:00
Rebecca Law
ed4b9d34a6
Changes as per code review comments.
...
Fix my backward date math :P
2017-02-15 17:41:07 +00:00
Rebecca Law
52342afe3f
Add a limit to the number of active 2fa codes that we create. At the moment that is set to 10.
2017-02-15 16:18:05 +00:00
Rebecca Law
9de88c50ba
Remove test for resetting the failed_login_count, the admin app will request that.
2017-02-15 15:24:42 +00:00
Rebecca Law
c4bf7a1331
Merge branch 'master' into stronger-2fa-security
2017-02-15 14:20:32 +00:00
Rebecca Law
07fc71cc4c
Fix codestyle
2017-02-15 11:59:31 +00:00
Rebecca Law
74e29708f9
Fix bug where the increment calls set count to 1 if the cache does not exist.
2017-02-15 11:49:19 +00:00
Rebecca Law
53b7ad0961
Moved the cache key to the utils module.
...
Renamed the dao method.
2017-02-14 14:22:52 +00:00
Rebecca Law
5f48367ee5
Set the expiry time on a verify code (2fa) to 10 minutes.
...
When the verify code is wrong or expired increment the failed to login count for the user.
When the verify code is successfully used reset the failed login count to 0.
2017-02-14 14:04:11 +00:00
Rebecca Law
458adefcb8
Added a redis cache for the template usage stats.
...
Cache expires every 10 minutes, but will help with the every 2 second query, especially when a job is running.
There is some clean up and qa to do for this yet
2017-02-13 18:47:29 +00:00
imdadahad
7417662fc1
Merge pull request #819 from alphagov/fix-auto-provider-switch-update-history
...
Fix: Update history when auto switching provider
2017-02-09 10:50:01 +00:00
Imdad Ahad
41a689f4be
Update test to assert that the provider history table has been updated
2017-02-08 17:14:46 +00:00
Imdad Ahad
42bb2f14da
Add test to check version is updated after switch
2017-02-08 14:15:45 +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
Chris Hill-Scott
8cefe6a71b
Merge pull request #820 from alphagov/fix-monthly-miscount
...
Fix miscount with monthly totals
2017-02-08 13:05:43 +00:00
imdadahad
cdc693fae5
Merge pull request #818 from alphagov/feat-add-update-user-password-endpoint
...
Add separate endpoint to update a user's password
2017-02-08 09:44:29 +00:00