Commit graph

162 commits

Author SHA1 Message Date
Yurii Parfinenko
289af19ce9
Use redis cache in get_approx_account_lockouts_from_login_attempts (#250)
Some checks failed
Test / build (3.10, 5) (push) Has been cancelled
Test / build (3.10, 6) (push) Has been cancelled
Test / build (3.10, 7) (push) Has been cancelled
Test / build (3.11, 5) (push) Has been cancelled
Test / build (3.11, 6) (push) Has been cancelled
Test / build (3.11, 7) (push) Has been cancelled
Test / build (3.12, 5) (push) Has been cancelled
Test / build (3.12, 6) (push) Has been cancelled
Test / build (3.12, 7) (push) Has been cancelled
Test / build (3.13, 5) (push) Has been cancelled
Test / build (3.13, 6) (push) Has been cancelled
Test / build (3.13, 7) (push) Has been cancelled
Test / build (3.9, 5) (push) Has been cancelled
Test / build (3.9, 6) (push) Has been cancelled
Test / build (3.9, 7) (push) Has been cancelled
* Use redis cache in `get_approx_account_lockouts_from_login_attempts`

* use django_redis in ci

* Add `django_redis` and `redis` to requirements.txt

* Fix an issue detected by tests: clear redis cache upon block reset

* Remove the unnecessary `if`
2026-01-29 12:53:21 -05:00
Attila
37e5dd3123
Fixed circumventing blocking by appending whitespace to username (#248) 2025-07-01 11:23:24 -04:00
Ken Cochrane
83ad7ce338 Bump 0.9.8 2024-02-15 16:40:06 -05:00
Adam
07555abd29
Improved the "Blocked Logins" page's admin integration (#239) 2024-02-14 18:10:03 -05:00
Adam
c290b5a673
Updated app_index.html (#238) 2024-02-14 18:07:30 -05:00
Adam
4bea010b65
Prevent the "Reverse for 'defender_blocks_view' not found" error (#237) 2024-02-14 18:06:30 -05:00
Roman Gorbil
1e0aa91952
Fix watch_login with custom username (#228)
Previously using of custom `get_username` function with disabled IP
lockout caused unhandled exception
Exception("Invalid state requested")
2023-11-09 06:41:49 -06:00
dkr-sahar
ba548fa9c3
Use redis parse_url method instead of a custom one (#234)
* Use redis parse_url method instead of a custom one

The custom method defined here has no real advantage

- the redis lib implements it better and have support for many use cases
- maintaining this implementation is error-prone and unnecessary work for overworked open-source contributors :)

Especially, when you want to pass query parameters here, they are not supported (for eg a custom certificate authority)

* remove test about url parsing
* remove unused imports
2023-10-12 13:20:58 -04:00
Shen Li
8d4c6840e9
Replace datetime.now with timezone.now (#232)
Use `timezone.now` instead of `datetime.now` when constructing datetime objects. `timezone.now` ensures the timezone-awareness to be consistent with `settings.USE_TZ`
2023-07-13 16:58:47 -04:00
Ken Cochrane
6111eb81da Bump version 0.9.7 2023-02-27 17:39:23 -05:00
Ken Cochrane
b0f90e690a
fixing issue #219 don't add redis username by default (#227)
* fixing issue #219 don't add Redis username by default
2023-02-23 09:59:52 -05:00
Dashgin
a4b3f9f332 remove_prefix method working same for all python versions 2023-02-21 11:01:20 -05:00
Dashgin
d90dfa8db7 added test for remove_prefix method 2023-02-21 11:01:20 -05:00
Dashgin
428968b238 Bugfix strip_keys method (returns wrong response method when there is string containing in key_list) 2023-02-21 11:01:20 -05:00
Ken Cochrane
ac36751561 bump version to 0.9.6 2022-11-29 08:21:40 -05:00
djmore4
afa2066ba0 Add pragma: no cover comments even though some of this stuff is covered... 2022-11-13 11:09:53 -05:00
djmore4
374971bfc5 Remove incorrect tests 2022-11-13 11:09:53 -05:00
djmore4
5139005106 Fix test name and correct logic in data.py 2022-11-13 11:09:53 -05:00
djmore4
359ee90082 I think we're finally done here 2022-11-13 11:09:53 -05:00
djmore4
b9b067472c Whoops, they worked I guess. Let's see if they still do or we need more changes. Also improve coverage 2022-11-13 11:09:53 -05:00
djmore4
de1c876b99 Using assertEquals and an exception to test where the logic is going wrong 2022-11-13 11:09:53 -05:00
djmore4
717d44aa7d Update README further and make another adjustment to the tests 2022-11-13 11:09:53 -05:00
djmore4
1bf9d6e7d1 Refactor once again 2022-11-13 11:09:53 -05:00
djmore4
a280c90bc0 Refactor once again 2022-11-13 11:09:53 -05:00
djmore4
7121db4b0f another different approach 2022-11-13 11:09:53 -05:00
djmore4
be523281ab Hopefully this clears up the issues in the tests 2022-11-13 11:09:53 -05:00
djmore4
2d288b247a Try some new things 2022-11-13 11:09:53 -05:00
djmore4
bbe7687abd Added changes and fixed small bug 2022-11-13 11:09:53 -05:00
djmore4
177f2ecce8 Add new config options and update logic/tests to account for them 2022-11-13 11:09:53 -05:00
cbh
bb122f24b9 add username option to redis config 2022-06-06 13:15:55 +03:00
Jona Andersen
0b96c53245 Bump to 0.9.4 2022-05-01 16:09:52 -04:00
Jona Andersen
44ecbee250 Strip port number from IP address in X-Forwarded-For 2022-05-01 14:22:28 -04:00
Hasan Ramezani
fdf37feb54 Drop Django 2.2 support 2022-04-13 17:46:42 +03:00
Hasan Ramezani
7c544d1cf8 Drop Django 3.1 support. 2021-12-16 16:40:44 -05:00
Williams Mendez
c8a2586892 Define AppConfig.default_auto_field to match the initial migration
This patch removes a warning but also prevents creating migrations in projects
where DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField".
2021-12-13 21:00:46 +01:00
Hasan Ramezani
55ab5c6961 Replace assertEquals with assertEqual. 2021-10-13 21:47:34 +03:30
Ryan Bales
e5edaf3b5d bugfix for IP backdoor to DEFENDER_LOCK_OUT_BY_IP_AND_USERNAME 2021-08-01 15:19:34 -04:00
Ken Cochrane
5d625dd273 release version 0.9.1 2021-07-18 09:31:51 -04:00
Jonathan Willitts
5f5b34d50e Fix failing tests to work with Django (4.0) main dev branch 2021-04-29 06:50:36 -04:00
Ken Cochrane
d413e60847 released version 0.9.0 2021-04-25 19:36:10 -04:00
Jannis Leidel
b4a5f886d4
Migrate to GitHub Actions. (#174)
* Add GitHub Actions test workflow.

* Add release workflow.

* Remove Travis cruft and update changelog.

* Fix deps.

* Remove Celery version restriction.

* Relax installation requirements a bit.

* Update README.rst

* Update tox.ini
2020-12-21 14:18:53 +01:00
Hasan Ramezani
9a322c4729 Add support for Python 3.9 2020-11-27 16:32:46 +01:00
Hasan Ramezani
cc06ab33fd Drop support Django < 2.2 and add support for Django > 3 2020-11-27 16:32:46 +01:00
Hasan Ramezani
5e6e52fcbb Drop Python2.7 support. 2020-11-23 17:30:46 +01:00
Hasan Ramezani
1f9b3dec7c Fix version. 2020-11-23 09:08:40 +01:00
Jorge
7124e4b156 make password quote optional in the funciton signature 2020-10-27 12:35:39 -03:00
Ivan Pereira
6354df0a8a
dynamic load celery (#163) 2020-09-04 15:11:19 -04:00
calmkart
71312eb841
FIX: support for special character in redis password(such like '@') (#155)
* FIX: if special character in redis password, we can set DEFENDER_REDIS_PASSWORD_QUOTE to True, and use quote password

* MOD:add test cases with password_quota = True
2020-03-13 08:13:54 -04:00
Ken Cochrane
8daa2d168d Added changes for release 0.7.0 2020-02-23 15:23:52 -05:00
David Nugent
cb59d1c481 Fixes for django 3.0+
As python 2i is no longer supported, stub reference to python_2_unicode_compatible
2020-02-23 14:25:15 -05:00