Commit graph

479 commits

Author SHA1 Message Date
Gert Van Gool
9ae2cdb168 Check the headers attribute on requests
The oauth2_provider package stores a (custom) set of headers on the
headers attribute instead of the default META attribute. Let's use it to
look up our expected keys.
2020-12-23 10:26:22 -08:00
Gert Van Gool
ef5b645da2 Bump version (3.0.5) 2020-11-20 18:28:50 -08:00
Gert Van Gool
7f6ec94e66 Handle libraries that use badly mocked HttpRequest
In our (7Geese) case, this is oauthlib (v3.0.2) that has a request-like
object that doesn't implement the `META` attribute.
2020-11-20 18:26:23 -08:00
Gert Van Gool
08b0a77c44 Bump version (3.0.4) 2020-11-20 17:54:54 -08:00
Gert Van Gool
308b6554be Credentials doesn't always have username key 2020-11-20 17:54:54 -08:00
Camilo Nova
e40d28ff41 Bump version 2017-11-23 17:23:47 -05:00
Camilo Nova
01cc28360c Removed outdated documentation. Fixes #272 2017-11-23 17:21:21 -05:00
Camilo Nova
ba54a857b2
Merge pull request #271 from pope1ni/cleanup
Various minor packaging-related changes.
2017-11-23 17:18:20 -05:00
Camilo Nova
c9005addd8
Merge pull request #269 from pope1ni/python34
Test against Python 3.4.
2017-11-23 17:17:40 -05:00
Nick Pope
f0a7ee28e1 Fix url in setup.py to point to correct repository. 2017-11-23 14:17:04 +00:00
Nick Pope
6e164ddb0f Added trove classifiers for supported versions of Django. 2017-11-23 14:16:47 +00:00
Nick Pope
24f5fb1997 Fix testing against Python 2.7
This was missed in in #268 which was merged, but tests were not actually
executed on Travis CI for Python 2.7!
2017-11-23 13:11:14 +00:00
Nick Pope
60c88aa47f Test against Python 3.4
As discussed in #264.
2017-11-23 13:11:14 +00:00
Camilo Nova
66b5f17811 Rename parameter. Fixes #267 2017-11-23 07:52:58 -05:00
Camilo Nova
a7764766e1
Merge pull request #268 from mbaechtold/python27
Test against Python 2.7.
2017-11-23 07:49:40 -05:00
Martin Bächtold
687e51eae0
Test against Python 2.7.
As discussed in https://github.com/jazzband/django-axes/issues/264 and https://github.com/jazzband/django-axes/issues/266.

We need to install `mock` when testing against Python 2.7 because `mock` has been added to the standard lib only starting with Python 3.3.
2017-11-23 07:44:15 +01:00
Jannis Leidel
a42243fdb3
Enable releases via Jazzband. 2017-11-22 18:57:11 +01:00
Camilo Nova
7e91a24f8c Added release on jazzband 2017-11-21 17:13:02 -05:00
Camilo Nova
d0eb21c32e Bump version 2017-11-21 17:08:55 -05:00
Camilo Nova
04f9b43221 Fixes bad import 2017-11-21 16:59:42 -05:00
Camilo Nova
726214df05 Added form_invalid decorator. Fixes #265 2017-11-21 16:51:59 -05:00
Camilo Nova
b31610df6c Added python 3.5 support. Fixes #264 2017-11-20 09:17:18 -05:00
Camilo Nova
5e313601f0 Renamed middleware setting. Fixes #263 2017-11-20 09:04:15 -05:00
Camilo Nova
12e66a3f4e Bump version 2017-11-17 18:31:21 -05:00
Camilo Nova
f1474d683b Remove support for python 2.x 2017-11-17 18:30:48 -05:00
Camilo Nova
1be6356dde Fix DeprecationWarning for logger warning 2017-11-17 18:21:00 -05:00
Camilo Nova
d55af8e966 Improve tests and fix global lockout. Fixes #261 2017-11-17 18:12:30 -05:00
Adam Taylor
790a106f2a Changed the way output is handled in the management commands 2017-11-17 17:34:03 -05:00
Camilo Nova
850401d67f
Merge pull request #240 from jazzband/django-1.11
Axes 3.0.0. Fixes #215 #223 #233 #236
2017-11-17 17:17:04 -05:00
Camilo Nova
ba37442252 Added support for Django signals, big code refactor and improvements 2017-11-17 17:15:34 -05:00
Camilo Nova
85ece72541 Bump version 2017-07-20 12:20:54 -05:00
Camilo Nova
f9258b6f35 Merge pull request #232 from HuntedCodes/pr-decorator-typo
Typo fixup.
2017-05-23 07:46:30 -05:00
Jack Sullivan
6f1e1c1d34 Fixed extra typo. 2017-05-17 12:19:43 -07:00
Camilo Nova
4835e90990 Merge pull request #229 from HuntedCodes/logging-conf
Logging respects configuration settings
2017-05-16 15:01:59 -05:00
Jack Sullivan
4711fb88ff Boosting code coverage 2017-05-13 13:24:23 -07:00
Jack Sullivan
25e5757aff Merge branch 'master' into logging-conf
Conflicts:
	axes/tests.py
2017-05-13 11:55:53 -07:00
Camilo Nova
8b4ca6e538 Added pytz as a requirement. Fixes #230 2017-05-09 18:52:18 -05:00
Camilo Nova
49cbf128e5 Merge pull request #228 from HuntedCodes/block-configs
Fixes #222, and robust testing for lockout conditions
2017-05-09 09:35:22 -05:00
Camilo Nova
a64b479817 Merge pull request #225 from aleksihakli/xff
Fixed #224 -- Add AXES_NUM_PROXIES setting
2017-05-09 09:34:21 -05:00
Jack Sullivan
3b4f8fb7b3 Handles successful AJAX logins. 2017-04-26 14:17:24 -07:00
Jack Sullivan
95917a951e In tests, only set cooldown if testing it
The results for the cache unit tests were inconsistent, sometimes
blocking and other time allowing. The source of the non-determinism
was the COOLDOWN_TIME set to 2 seconds in the test. If a test took
slightly longer than the cooldown time, it would fail. Testing times
on Travis CI vary with each build, and would produce unreliable
results.

Now all tests have no cooldown period, except when the cooldown
itself is being tested. This ensures accurate and predicable test
results.
2017-04-26 12:49:44 -07:00
Jack Sullivan
98b82dd27d Fixed path_info formatting. 2017-04-26 09:37:11 -07:00
Jack Sullivan
4783787c6d Fixed UTF-8 encoding bug. 2017-04-26 09:11:11 -07:00
Jack Sullivan
082c6ac35d Boosting code coverage. 2017-04-25 15:21:41 -07:00
Jack Sullivan
ebf9ca89ee Added user agent and verbose logging. 2017-04-25 14:47:33 -07:00
Jack Sullivan
765fddb64a Log successful auth if configured
When AXES_DISABLE_SUCCESS_ACCESS_LOG=False, write a log that
successful authentication has happened, along with client info.
2017-04-25 13:49:43 -07:00
Jack Sullivan
4d4b1d233f Factored out logging into functions 2017-04-25 12:50:24 -07:00
Jack Sullivan
55e83bd629 Log messages based on config settings 2017-04-25 12:49:53 -07:00
Jack Sullivan
c86ad06d9d Fixed #222, cache blocks by user only and ip+user
Cache hash keys now include usernames. The axes settings
AXES_ONLY_USER_FAILURES and LOCK_OUT_BY_COMBINATION_USER_AND_IP
are checked to decide which request attributes to include in
generated cache hash keys.
2017-04-22 19:19:48 -07:00
Jack Sullivan
1ed448d02f Test blocking configs, using the cache.
Added 12 tests that verify lockouts for default, AXES_ONLY_USER_FAILURES,
and LOCK_OUT_BY_COMBINATION_USER_AND_IP settings, under four conditions
each: same/different user, and same/different IP address. These tests
verify the cache functionality.
2017-04-22 18:59:32 -07:00