Commit Graph

211 Commits

Author SHA1 Message Date
Kenneth Kehl
905df17f65 remove datetime.utcnow() 2024-05-23 13:59:51 -07:00
Carlo Costino
99edc88197 Localize notification_utils to the API
This changeset pulls in all of the notification_utils code directly into the API and removes it as an external dependency.  We are doing this to cut down on operational maintenance of the project and will begin removing parts of it no longer needed for the API.

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
2024-05-16 10:17:45 -04:00
Aditi Anand
ad55eef5e9 Changes for sqlalchemy 2.0 2024-04-24 16:27:20 -04:00
Kenneth Kehl
0131ea0f1e return None to handle new user 2024-03-29 07:44:35 -07:00
Kenneth Kehl
a8640a65b6 fix email notifications missing personalisation (notify-api-853) 2024-03-13 10:52:55 -07:00
Carlo Costino
8a6cc76d15 Merge pull request #840 from GSA/notify-admin-1277
fix login.gov to use user uuid instead of email (notify-admin-1277)
2024-03-11 11:53:42 -04:00
Kenneth Kehl
7c95211649 fix login.gov to use user uuid instead of email (notify-admin-1277) 2024-03-08 08:44:27 -08:00
Kenneth Kehl
492daee970 fix personalisation for emails 2024-03-06 10:28:34 -08:00
Kenneth Kehl
b777249b6f merge from main 2024-03-01 13:50:09 -08:00
Cliff Hill
e64e500561 Debugging things is fun.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:37 -05:00
Cliff Hill
9523cc1d97 Cleaning up with black, isort, flake8.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:33 -05:00
Cliff Hill
7416de2a28 KeyType implemented.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:33 -05:00
Cliff Hill
a177042e77 Formatting cleanup for models.py
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:32 -05:00
Cliff Hill
3982f061b6 Made enums.py for all the enums to avoid cyclic imports.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:31 -05:00
Cliff Hill
ac9591ec7c More tweaks, trying to get tests to be clean.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:43:31 -05:00
Cliff Hill
43f18eed6a More changes for enums.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:41:57 -05:00
Cliff Hill
820ee5a942 Cleaning up a lot of things, getting Enums used everywhere.
Signed-off-by: Cliff Hill <Clifford.hill@gsa.gov>
2024-02-28 12:40:52 -05:00
Kenneth Kehl
b5a0562077 fix tests 2024-01-24 07:55:14 -08:00
Kenneth Kehl
6dc9828663 fix tests 2024-01-22 10:55:09 -08:00
Kenneth Kehl
f9f1013f5b notify-api-742 don't write phone numbers to db 2024-01-16 11:21:24 -08:00
Kenneth Kehl
c3cb60f3b0 fix registration so email gets sent 2024-01-11 11:11:12 -08:00
Kenneth Kehl
a8955ef78f fix flake8 2024-01-11 09:50:59 -08:00
Kenneth Kehl
ea8caf1ad9 remove debugging for 2fa issue 2024-01-11 09:38:00 -08:00
Kenneth Kehl
6f04915ee8 flake8 2024-01-10 11:20:33 -08:00
Kenneth Kehl
7b2e59dede switch to raw_get and raw_set to see exceptions 2024-01-10 10:30:44 -08:00
Kenneth Kehl
3dcb8d194e more debug 2024-01-10 09:10:52 -08:00
Kenneth Kehl
572c8ebb84 reformat 2024-01-09 14:45:11 -08:00
Kenneth Kehl
2f9b98c07e debug messages 2024-01-09 14:28:24 -08:00
Kenneth Kehl
5366992d1a format 2024-01-09 14:01:03 -08:00
Kenneth Kehl
d3ca06fec2 fix 2024-01-09 13:36:57 -08:00
Kenneth Kehl
be950a7322 no verification code on staging 2024-01-09 13:09:07 -08:00
Kenneth Kehl
88379c9e46 final 2024-01-05 10:35:14 -08:00
Kenneth Kehl
3209c6d723 remove print statements 2023-12-05 07:29:18 -08:00
Kenneth Kehl
eea6933712 notify-admin-931 2023-12-04 14:53:29 -08:00
Kenneth Kehl
065009bb7a merge from main and reformat 2023-08-29 16:21:18 -07:00
Kenneth Kehl
1ecb747c6d reformat 2023-08-29 14:54:30 -07:00
Kenneth Kehl
5a350560d7 notify-api-433b remove research mode 2023-08-25 12:09:00 -07:00
Kenneth Kehl
00fd3a72bb code review feedback, fix setup.cfg and reformat 2023-08-25 08:10:33 -07:00
Kenneth Kehl
026dc14021 notify-api-412 use black to enforce python style standards 2023-08-23 10:35:43 -07:00
Kenneth Kehl
1adc05a7c6 notify-admin-641 let platform admins export listing of all users (#370)
Co-authored-by: Kenneth Kehl <@kkehl@flexion.us>
2023-07-26 12:13:57 -04:00
Kenneth Kehl
4940d5e93b notify-api-332 rename organisation 2023-07-10 11:06:29 -07:00
Ryan Ahearn
abc7b09d0d Update app to utilize updated phone validation methods 2023-01-05 11:06:12 -05:00
stvnrlly
e9fdfd59f4 clean flake8 except provider code 2022-10-19 16:16:26 +00:00
Jim Moffet
ac8d8d3c29 clean up config 2022-06-25 18:36:39 -07:00
Katie Smith
bd4f74b359 Replace how .load is called
https://marshmallow.readthedocs.io/en/stable/upgrading.html#schemas-are-always-strict

`.load` doesn't return a `(data, errors)` tuple any more - only data is
returned. A `ValidationError` is raised if validation fails. The code
now relies on the `marshmallow_validation_error` error handler to handle
errors instead of having to raise an `InvalidRequest`. This has no
effect on the response that is returned (a test has been modified to
check).

Also added a new `password` field to the `UserSchema` so that we don't
have to specially check for password errors in the `.create_user` endpoint
- we can let marshmallow handle them.
2022-05-25 11:35:44 +01:00
Katie Smith
b440f3f904 Use Draft-07 and Draft7Validator everywhere
We were using the Draft4Validator in one place, so this updates it to
the Draft7Validator instead.

The schemas were mostly using draft 4 of the JSON schema, though there
were a couple of schemas that were already of version 7. This updates
them all to version 7, which is the latest version fully supported by
the jsonschema Python package. There are some breaking changes in the
newer version of the schema, but I could not see anywhere would these
affect us. Some of these schemas were not valid in version 4, but are
now valid in version 7 because `"required": []` was not valid in earlier
versions.
2022-04-14 14:46:10 +01:00
Chris Hill-Scott
c2b6a9df80 Allow admin app to specify domain for registration email
This follows the pattern for invite emails where the admin app tells the
API which domain to use when generating the link.

This will starting working once the admin change is merged:
- [ ] TBC

It won’t break anything if it’s merged before the admin change.
2022-03-07 15:03:46 +00:00
Chris Hill-Scott
07f584e1d5 Allow admin app to specify domain for password reset
This follows the pattern for invite emails where the admin app tells the
API which domain to use when generating the link.

This will starting working once this admin change is merged:
- [ ] https://github.com/alphagov/notifications-admin/pull/4150/files

It won’t break anything if it’s merged before the admin change.
2022-02-02 17:15:09 +00:00
Chris Hill-Scott
544bfbf569 Add separate config item for failed login count
It’s confusing that changing `MAX_VERIFY_CODE_COUNT` also limits the
number of failed login attempts that a user of text messages 2FA can
make.

This makes the parameters independent, and adds a test to make sure any
future changes which affect the limit of failed login attempts are
covered.
2021-10-04 10:45:07 +01:00
Chris Hill-Scott
2c7e4657ce Don’t update email_access_validated_at on password reset
As of https://github.com/alphagov/notifications-admin/pull/4000/files
the admin app is doing this, so we don’t need to do it here as well.
2021-09-01 09:54:54 +01:00