Commit graph

580 commits

Author SHA1 Message Date
Uli Klank
a88366f251 Prevent unnecessary save for created object 2021-06-29 16:49:12 +03:00
Uli Klank
8b5b921b71 Initiallize failures since start correctly 2021-06-29 16:49:12 +03:00
Uli Klank
93341a4d04 Handle race conditions for multiple workers
The creation of several entries is possible due to race conditions between different worker processes, which can later break the usage of get in this situation.
This change should help to prevent this race condition using the database.
2021-06-29 16:49:12 +03:00
Aleksi Häkli
11c8a837ab
Add missing Polish translation keys in English 2021-06-16 10:52:12 +03:00
Michał (Quadric) Sieradzki
111b9650b8 polish locale 2021-06-16 10:46:00 +03:00
Zakatell Kanda
876b6f3dc4 use autofield for now, otherwise we have to bump min version to 3.2 2021-06-09 19:35:29 +03:00
Zakatell Kanda
b4a71de81f use the new django bigautofield, fixes a warning 2021-06-09 19:35:29 +03:00
Nikolai Røed Kristiansen
2e074eebc5 Fix default_app_config deprecation
Django 3.2 automatically detects AppConfig and therefore this setting is no longer required.

https://docs.djangoproject.com/en/dev/releases/3.2/#automatic-appconfig-discovery
2021-06-05 18:44:11 +03:00
smtydn
a26c5109ed Fix formatting 2021-05-19 20:54:57 +03:00
smtydn
1a8d96e242 Add AXES_CLIENT_STR_CALLABLE setting 2021-05-19 20:54:57 +03:00
Michael O'Connor
170dacc112 Integrate AXS_SENSITIVE_PARAMETERS functionality with AXES_PASSWORD_FORM_FIELD 2021-05-03 17:10:45 +03:00
Michael O'Connor
f54c4f095b Add option to cleanse sensitive GET and POST params in database handler 2021-05-03 17:10:45 +03:00
Hasan Ramezani
6b2da1f152 Add support for Django 3.2 2021-04-06 20:11:14 +03:00
Ashok Argent-Katwala
bdffe67bd8 Add trailing period for consistency.
The other lock-out message has whole sentences, and two of the three translations do.
2021-02-24 19:02:40 +02:00
Christian Bundy
2241dbe011 Set AXES_VERBOSE default to AXES_ENABLED
Problem: When `AXES_ENABLED == False` we still see log output because `AXES_VERBOSE == True`.

Solution: Change `AXES_VERBOSE` default so that if django-axes is disabled then we don't output to stdout.
2021-02-20 15:30:59 +02:00
Nat Gordon
d4e97123f2 Add support to reset attempts on the cache handler 2021-02-15 20:20:49 +02:00
Aleksi Häkli
b6b26e492f Optimize imports as part of cleanup round 2021-01-07 18:23:33 +02:00
Aleksi Häkli
a5045f62fe Move tests outside project source folder 2021-01-07 18:23:33 +02:00
Hasan Ramezani
0eecff2e57 Use override_settings instead decorator context manager. 2021-01-06 23:46:54 +02:00
Clifton Barnes
d1cf5059e4 Fix formatting 2021-01-06 23:23:21 +02:00
Clifton Barnes
cff3a9254c Prevent cache entry for None username 2021-01-06 23:23:21 +02:00
Vladimir Knobel
64b53d55ae Black run on code to comply with py38-qa 2021-01-05 15:18:59 +02:00
Vladimir Knobel
cf51e09d75 Fix indentation 2021-01-05 15:18:59 +02:00
Vladimir Knobel
3d1e77298d Update conf.py
adds new AXES_ALLOWED_CORS_ORIGINS setting
2021-01-05 15:18:59 +02:00
Vladimir Knobel
55438c14bd Update helpers.py
chnage ALLOWED_CORS_ORIGINS to AXES_ALLOWED_CORS_ORIGINS
2021-01-05 15:18:59 +02:00
Vladimir Knobel
4a981f9972 Update helpers.py 2021-01-05 15:18:59 +02:00
Aleksi Häkli
10f6e621ce Add missing @wraps decorator
This keeps the original function name and docstring for the decorated function
2021-01-05 11:57:53 +02:00
Aleksi Häkli
1ba5c2bcbb
Remove unused imports 2021-01-04 19:02:04 +02:00
Hasan Ramezani
ab327f7b59 Add DEFAULT_AUTO_FIELD to test settings. 2021-01-04 18:13:43 +02:00
Aleksi Häkli
59bcbd8816 Move DRF integration into signals
Add documentation on how to enable the integration
and remove the logic from global middleware.

Fixes #673
2020-12-18 19:42:43 +02:00
Ashok Argent-Katwala
3a7d154f65 Adjust formatting to match the lint check. 2020-12-02 17:55:30 +02:00
Ashok Argent-Katwala
146d7a20b7 Only do the work in the middleware if axes is enabled. 2020-12-02 17:55:30 +02:00
Hasan Ramezani
22c564743d Prevent AccessAttempt creation for None username. 2020-11-05 20:06:49 +02:00
Anatoly
baf2349adb Apply Black for py36 2020-10-16 11:15:40 +03:00
Anatoly
d0a1338eb4 Update documentation of AxesMiddleware 2020-10-16 11:15:40 +03:00
Anatoly
f17971d339 Update documentation of AxesMiddleware 2020-10-16 11:15:40 +03:00
Anatoly
660963345a Cover AxesMiddleware with more tests 2020-10-16 11:15:40 +03:00
Anatoly
ae49f3bdae Update django request in the AxesMiddleware if drf is used 2020-10-16 11:15:40 +03:00
Aleksi Häkli
ce846bf4eb Fix GitHub code editor whitespaces 2020-09-27 17:08:01 +03:00
Aleksi Häkli
aae0e295ef Add QA skip for import ordering 2020-09-27 17:08:01 +03:00
Aleksi Häkli
f213a87c00 Add @toggleable decorator to signal handler
Conform to the toggleable logic for the AccessAttempt event handling
2020-09-27 17:08:01 +03:00
Aleksi Häkli
122f387171 Adjust init verbose and enabled mode handling
Reduce complexity and leave the enabled mode to be used
with the toggleable decorator that disables functionality
when AXES_ENABLED is set to False for testing etc.

This conforms with the previous behaviour and logic flow.
2020-09-27 17:08:01 +03:00
Aleksi Häkli
4cac338138 Add AXES_LOGGER deprecation notice to checks 2020-09-27 17:08:01 +03:00
Aleksi Häkli
00635d3ad0 Update initial module imports 2020-09-27 17:08:01 +03:00
Aleksi Häkli
b569cdb991 Deprecate settings.AXES_LOGGER configuration flag
Fixes #634

The Django import system seems to produce errors
in certain configurations and especially when
MIGRATION_MODULES configuration is set globally.

This is most probably caused by misbehaving or cyclic
Python module imports in the Django application
instrumentatation chain that come up when the
MIGRATION_MODULES configuration is altered.

This patch migrates to the standard Python logging system
use and has less overhead and complexity for users as well.

Having a configurable logging prefix does not produce
a lot of benefits and is less flexible than having
all individual module logging configurations accessible
through the module __name__ parameter in Axes.

For example axes.handlers.* or axes.backends.*
are separately configurable in the new scheme
whereas they would have been both bundled under
the AXES_LOGGER log configuration.
2020-09-26 21:44:56 +03:00
Aleksi Häkli
eedba80ef9 Roll back axes_reset_username style update 2020-09-20 22:00:59 +03:00
David Smith
baed1377f2 Split requirements files and bumped black/mypy versions 2020-09-17 15:06:07 +03:00
Aleksi Häkli
8b619dfdef Deprecate django-appconf 2020-09-12 17:03:50 +03:00
David Smith
d96a3e4625 black formatting 2020-09-11 11:03:15 +03:00
David Smith
96d34c1b95 request.is_ajax() is deprecated 2020-09-11 11:03:15 +03:00