Commit graph

63 commits

Author SHA1 Message Date
Mounir Messelmeni
04fd39fa57 Enhance get_lockout_response to support original_response parameter 2025-12-19 21:19:03 +02:00
kuldeepkhatke
baace5c27b Added separate UT for complete, partial & no delete senarios 2025-07-05 16:19:19 +03:00
kuldeepkhatke
94a66c7346 Added actual queryset call UT 2025-07-05 16:19:19 +03:00
kuldeepkhatke
74c24c0e78 Added unittest for AXES_USE_ATTEMPT_EXPIRATION flag 2025-07-05 16:19:19 +03:00
Andrew Neher
2fb772efdb take out test-breaking modifications. My test custom user model wasn't working. 2025-02-19 18:09:40 +02:00
Andrew Neher
129e93cc0e savepoint 2025-02-19 18:09:40 +02:00
Bruno Alla
b54019fa0f Change AXES_COOLOFF_TIME callable to take exactly 1 argument 2024-10-02 20:15:31 +03:00
Bruno Alla
8ed0d82384 refactor: remove attempt_time parameter
As we pass down the whole request, we no longer need to extract the axes_attempt_time anymore.

This is a potential breaking change, but the impacted functions are not part of the documented API.
2024-10-02 20:15:31 +03:00
Bruno Alla
510c8d18f5 feat: pass the request to get dynamic cool off period 2024-10-02 20:15:31 +03:00
Bruno Alla
2fb4c81243 feat: pass username to AXES_COOLOFF_TIME callback
If the AXES_COOLOFF_TIME is a callable or path to a callable taking
an argument, pass the username to it.

This should enable users to customize the cool off to be user dependant,
and possibly implement a growing cool-off time:

- First lockout cools off after 5 mins
- Second one after 10 mins
- etc...
2024-10-02 20:15:31 +03:00
Aleksi Häkli
3804e834a8 Drop PyPy support
Tests are failing and need updates to fully support PyPy 3.10.
If anyone needs PyPy support please feel free to fix the tox matrix
and open a PR that reintroduces PyPy support for the project.
2024-09-21 13:02:49 +03:00
Aleksi Häkli
07483c6a15 Fix failing test case for new Django versions
See https://code.djangoproject.com/ticket/34968 for more details
2024-09-21 11:32:34 +03:00
Davide
014483c65d
Add session hash to access log 2024-04-30 16:22:50 +02:00
Aleksi Häkli
a069a42b50 Drop pkg_resources from tests 2024-03-04 20:27:20 +02:00
Pierre Lalet
6e64c62fbf Add new management command axes_reset_ip_username 2023-11-28 20:37:39 +01:00
Ronny Vedrilla
e9db2d9631 #1093: "AXES_SENSITIVE_PARAMETERS" now have sensible defaults to follow "privacy-by-design" 2023-07-30 18:59:48 +03:00
Maksim Zayakin
ebe1b74925 test: fix duplicate test names in AxesCoolOffTestCase 2023-07-25 19:57:20 +03:00
Pieter Goetschalckx
21cc0234de Test request after force_login 2023-06-22 11:44:53 +03:00
Ian Fisher
5b235b50ed Add check for callable settings 2023-06-13 19:15:07 +03:00
Maksim Zayakin
58d5b491d8 test: add deprecation check for is_admin_site, add is_admin_request tests 2023-05-14 23:01:58 +03:00
Maksim Zayakin
c66bb1fb2b test: add new client parameters tests 2023-05-13 14:04:14 +03:00
Maksim Zayakin
166c431b25 test: add callable AXES_LOCKOUT_PARAMETERS test cases and tests with wrong lockout parameters 2023-05-13 14:04:14 +03:00
Maksim Zayakin
43cc1ef39e test: add new login tests 2023-05-13 14:04:14 +03:00
Maksim Zayakin
73c4e4501b chore: adjust types: use list instead of iterables and nested lists instead of tuples 2023-05-13 14:04:14 +03:00
Maksim Zayakin
d5c6073bd7 test: use AXES_LOCKOUT_PARAMETERS in login test 2023-05-13 14:04:14 +03:00
Maksim Zayakin
a12c8bd6da test: use AXES_LOCKOUT_PARAMETERS in logging test 2023-05-13 14:04:14 +03:00
Maksim Zayakin
7ee8573939 test: use AXES_LOCKOUT_PARAMETERS in helpers test 2023-05-13 14:04:14 +03:00
Maksim Zayakin
7cb0144770 test: use AXES_LOCKOUT_PARAMETERS in handlers test 2023-05-13 14:04:14 +03:00
Maksim Zayakin
c3586ac3dc test: use AXES_LOCKOUT_PARAMETERS in attempts test 2023-05-13 14:04:14 +03:00
Aleksi Häkli
c3cfb5150a Refactor cache backend to use cache.incr method for request tracking
The old cache.set method has problems with correctness as well as
performance on higher traffic sites where there are
multiple parallel web servers running at the same time
which can overwrite each others shared cache
2023-05-01 21:27:47 +03:00
Aleksi Häkli
9924077a2a Rename get_cache_key to get_cache_keys 2023-05-01 21:27:47 +03:00
Aleksi Häkli
cd950ddfef Make ipware an optional dependency
Relates to #1038
2023-04-28 14:16:44 +03:00
Maksim Zayakin
5fb675b588 test: change status code to 429 2023-04-25 19:42:37 +03:00
ArtemDemidovAramMeem
0e76956a2e Override log handler when using sensitive parameters. Closes #1010 2023-04-16 19:51:10 +03:00
Maksim Zayakin
25f6903899 fix logout tests 2023-04-02 19:34:25 +03:00
Maksim Zayakin
791cce011d add ClientIpAddressTestCase 2023-03-29 16:35:06 +03:00
Hasan Ramezani
779fdf496b Adopt test based on Django security release for CVE-2023-24580 2023-02-26 13:59:27 +02:00
Petr Dlouhý
f2d3009279 add user_agent test, fix get_client_parameters tests 2022-11-24 21:58:57 +02:00
Simon Kern
556b56a84b update testconfig: use AxesStandaloneBackend 2022-08-18 16:32:00 +03:00
Simon Kern
5590419f81 Use new backend base class in checks
In 5c4bca6cb6 a new backend  base class was introduced. However the check and its corresponding tests still reference the old base class, thus triggering a warning on setups using the new backend base class.

resolves #907
2022-08-18 16:32:00 +03:00
Aleksi Häkli
4490013111 Migrate MD5 hashing to SHA256
Continue using MD5 hashing in Axes test settings
as it offers better performance for test runs
without compromising security for users
2022-05-16 10:41:07 +03:00
Shaheed Haque
99e10cb714 Update expected test results. 2022-05-11 17:08:55 +03:00
Hasan Ramezani
dc98a7b2e3 Allow float values for AXES_COOLOFF_TIME(#868). 2022-04-13 17:51:10 +03:00
Antoine Dujardin
9c2ceb7eb7 Add option to keep current behavior for cooloff reset 2022-04-08 22:17:05 +03:00
Antoine Dujardin
1015bad451 Don't reset cooloff time in case of login attempt during lockout 2022-04-08 22:17:05 +03:00
Gregory DAVID
246d884b84 Tests for AccessFailureLog 2022-04-08 22:16:19 +03:00
Hasan Ramezani
e4e88e01a3 Fix #845 -- Rename test functions 2022-03-02 17:12:45 +02:00
Hasan Ramezani
03c6798ebe Add Django 4.0 to test matrix. 2021-12-14 21:29:34 +02:00
Asher Foa
13848bdb5f Fix typo in tests 2021-10-21 11:07:56 +03:30
Vasyl Dizhak
8c5c43f482 #750, fix lockout failure when providing AXES_USERNAME_CALLABLE 2021-10-11 20:59:06 +03:00