Commit graph

167 commits

Author SHA1 Message Date
Mariano Vassallo
a8cd749bd2 Support for floats in cooloff time (i.e: 0.1 == 6 minutes) 2014-05-28 16:22:06 -03:00
Enrico Tröger
7f57a86408 Reduce logging of reverse proxy IP lookup and use configured logger
Instead of logging the notice that django.axes looks for a HTTP header
set by a reverse proxy on each attempt, just log it one-time on first
module import.
Also use the configured logger (by default axes.watch_login) for the
message to be more consistent in logging.
2014-05-24 13:48:39 +02:00
Peter Kuma
b6c3eeeaed Limit amount of POST data logged (#73)
Limiting the length of value is not enough, as there could be arbitrary
number of them, or very long key names.
2014-05-22 10:07:24 +02:00
Camilo Nova
4daba3daa3 Limit the length of the values logged into the database. Refs #73 2014-05-10 12:38:04 -05:00
Camilo Nova
22a7d7e160 Refactored tests to be more stable and faster 2014-05-10 12:09:25 -05:00
Camilo Nova
6973609cae Clean client references 2014-05-10 10:34:05 -05:00
Camilo Nova
9c468ecb4e Fixed admin login url 2014-05-10 10:31:57 -05:00
Camilo Nova
33fe4f02b3 Fixed conflict 2014-05-10 09:44:52 -05:00
Camilo Nova
bbd688b4d2 Remove hardcoded url path 2014-05-05 16:11:54 -05:00
Andrew Crosio
298ba366b8 fixing tests for django 1.7 2014-04-25 14:55:58 +04:00
Andrew Crosio
cdb1866cbb fix for django 1.7 exception not existing 2014-04-25 14:55:46 +04:00
Camilo Nova
5cc1dd2215 Merge pull request #69 from amrhassan/master
Replaced u string literal prefixes with six.u() calls
2014-04-09 07:15:14 -05:00
Camilo Nova
4e2a9bd02d Fixes object type issue, response is not an string 2014-04-09 07:11:02 -05:00
Camilo Nova
26b8927c77 Fixed merge conflicts 2014-04-09 07:05:10 -05:00
Camilo Nova
6ea41bb624 Merge pull request #66 from nicois/master
Python 3 compatibility fix for db_reset
2014-04-09 06:54:41 -05:00
Mariano Vassallo
9e7b1f9767 Admin command to list login attemps 2014-03-20 13:13:52 -03:00
Amr Hassan
f6f494cc11 Replaced six imports with django.utils.six ones 2014-03-05 11:43:05 +02:00
Amr Hassan
c90ee0562a Replaced u string literal prefixes with six.u() calls to make it compatible with Python 3.2 2014-03-02 12:20:21 +02:00
Flavio Curella
0a1377866f replaced assertIns and assertNotIns with assertContains and assertNotContains 2014-02-26 23:52:28 +01:00
Nick Farrell
864508bd13 update test cases to be python3 compatible 2014-02-08 23:38:06 +11:00
Nick Farrell
3788b0d9bf Python 3 compatibility fix for db_reset 2014-02-08 22:54:35 +11:00
Camilo Nova
38689a550d Added missing import 2013-11-07 18:54:35 -05:00
Camilo Nova
20ffed0fc4 Fixed conflict 2013-11-07 18:45:56 -05:00
Camilo Nova
50408ba3aa Added AttributeError in case get_profile doesn't exist 2013-11-07 15:30:22 -05:00
Thomas Grainger
d524e3f3e9 pull version from the correct package 2013-11-01 12:02:56 +00:00
Thomas Grainger
e1af717ce1 reverse version loading direction to support zest.releaser 2013-11-01 11:20:02 +00:00
Alexander Schrijver
bf208944fd Add tests for the cooling off period and for the cooling off period with
trusted users.
2013-08-14 11:29:15 +02:00
Alexander Schrijver
60273bab90 Reload the queryset after certain objects have been deleted. 2013-08-14 11:23:47 +02:00
Alexander Schrijver
18191897d3 When the cooloff period has expired if the user is trusted: reset the
failure counter otherwise obliterate the user.
2013-08-14 11:22:39 +02:00
Camilo Nova
cf1091d411 Improved axes_reset command. Fixes #52 2013-07-27 12:16:54 -05:00
Virendra Rajput
7cec890411 added 'username' field to the Admin table 2013-07-01 16:27:31 +05:30
Camilo Nova
ef3f75e9df Removed fallback logging creation since logging cames by default on django 1.4 or later, if you don't have it is because you explicitly wanted. Fixes #45 2013-04-29 12:27:41 -05:00
Alex Clark ☺
f984f37fba Merge pull request #44 from camilonova/fix-tests
Fix an issue when a user logout
2013-04-28 04:34:20 -07:00
Camilo Nova
b557160c00 Better User model import method 2013-04-27 16:07:32 -05:00
Camilo Nova
02761c540b Use only one place to get the version number 2013-04-27 08:57:53 -05:00
Camilo Nova
2e29240381 Fixed an issue when a user on django 1.4 logout 2013-04-20 18:39:59 -05:00
Camilo Nova
5ed5c90b9c Handle exception if there is not user profile model set 2013-04-20 18:15:32 -05:00
Camilo Nova
61f3ec462c Made some cleanup and remove a pokemon exception handling 2013-04-20 18:07:31 -05:00
Camilo Nova
01edd72298 Improved tests so it really looks for the rabbit in the hole 2013-04-20 17:53:42 -05:00
Camilo Nova
9b3cbc6299 Match pypi version 2013-04-20 16:24:50 -05:00
Michal Horejsek
189536e34b Django 1.5 for username have method get_username 2013-04-14 12:44:22 +02:00
Michal Horejsek
7c0c20b86b Fixed log of args in decorator watch_login 2013-04-13 20:23:06 +02:00
Alex Clark ☺
22a6c43672 Merge pull request #40 from camilonova/remove-staff-member-required
Dropped support for Django versions older than 1.4 Fixes #4
2013-04-04 21:27:36 -07:00
Camilo Nova
8eb6f338d5 Dropped support for Django versions older than 1.4 Fixes #4 2013-04-04 19:38:34 -05:00
Camilo Nova
dacdb32d18 Make sure axes can handle weird user agents. Fixes #38 2013-04-04 19:19:52 -05:00
Alex Clark ☺
f502093a7d Merge pull request #37 from camilonova/add-django-1.5-support
Added support for Django 1.5. Fixes #34
2013-04-02 04:57:32 -07:00
Alex Clark ☺
0dad730640 Merge pull request #36 from camilonova/fix-issue-16
Tweaked failure limit so it would be more natural. Fixes #16
2013-04-02 04:57:21 -07:00
Alex Clark ☺
6c7c3506c7 Merge pull request #33 from camilonova/fix-duplicated-entries
Fix duplicated entries. Fixes #17
2013-04-02 04:42:10 -07:00
Camilo Nova
6a99b75918 Added support for Django 1.5. Since we are storing a username, no matter what it is, the only change needed is where checking the user lockable attribute. Fixes #34 2013-03-31 09:30:47 -05:00
Camilo Nova
e1e9d28134 Tweaked failure limit so it would be more natural. Fixes #16 2013-03-31 08:04:30 -05:00
Camilo Nova
3166adb9a4 Removed duplicated watching for the login function, because admin uses the login function from auth.views too. Fixes #17 2013-03-16 18:06:17 -05:00
Camilo Nova
a82ae1673a Improved code readability 2013-03-16 18:06:09 -05:00
Camilo Nova
eabb14cd0f Improved code readability 2013-03-16 18:06:01 -05:00
Camilo Nova
86bb31e195 Move travis.yml to root folder 2013-03-16 16:18:07 -05:00
Camilo Nova
f6914c3c08 Added travis support for testing 2013-03-16 16:15:54 -05:00
Camilo Nova
58c3a82881 Added better testing schema 2013-03-16 16:09:55 -05:00
Camilo Nova
cdb294f8f5 Updated version number 2013-03-16 11:52:28 -05:00
Christopher Ghormley
b3892da605 Refactor for better logical flow. 2013-02-20 23:08:28 +00:00
Christopher Ghormley
6888cf41cb Don't set up logging if settings module already has LOGGING defined.
If LOGGING is defined, you can add something like this to LOGGING.loggers:

        'axes.watch_login': {
            'handlers': ['syslog'],
            'level': 'INFO',
        },
2013-02-20 22:47:15 +00:00
Alex Clark
1ed2b5fb5a Release 1.2.9 2013-02-20 09:08:51 -05:00
Camilo Nova
1e2d521584 Added a test for a valid login case and make a better assert for the admin page because is not redirected to another url 2013-01-26 17:33:14 -05:00
Camilo Nova
cbc07d0f98 Cleaned up tests. Fixes #7 and closes #9 since it works with django-admin by default 2013-01-26 17:01:49 -05:00
Justin Slattery
184458416b Increased http accept header length per issue #24. 2013-01-22 08:38:29 -05:00
Robert Magee
1705188c99 Added warning if config is wrong when configured for reverse proxy. 2013-01-16 18:40:50 -07:00
Robert Magee
aea343c191 forgot to pass request... 2013-01-16 18:03:15 -07:00
Robert Magee
f24ce0bea2 oooops. 2013-01-16 18:00:34 -07:00
Robert Magee
112b61b97b added get_ip function 2013-01-16 17:56:51 -07:00
Robert Magee
f4a7469e0e Added fixes for reverse proxy. 2013-01-16 17:32:38 -07:00
Alex Clark
61b17b4d56 Release 1.2.6 2012-12-04 12:33:57 -05:00
Alex Clark
ae5934fbd1 Be more careful 2012-11-28 20:43:11 -05:00
Alex Clark
9bd1724aee Should be username not user, I think 2012-11-28 20:34:05 -05:00
Ken Cochrane
3b58e9bc16 fixed a couple of issues from previous commits, imported signals in models to load them correctly. 2012-11-25 19:41:55 -05:00
Ken Cochrane
82296db695 Added ability to flag user accounts as unlockable, by having a field in the UserProfile called nolockout and set to True, if not there it is ignored 2012-11-25 18:39:14 -05:00
Ken Cochrane
4e16a85aed added ipaddress as a param to the user_locked_out signal; also added a signal reciever for user_logged_out so that we can log when the user logs out in the accessLog table. 2012-11-25 18:20:56 -05:00
Ken Cochrane
2b77673336 added a signal for when a user gets locked out 2012-11-25 17:42:55 -05:00
Ken Cochrane
9682a39528 Added AccessLog model to log all access attempts. refactored the models so there is a common abstract base class. Also added the model to django admin 2012-11-25 15:46:45 -05:00
Josh VanderLinden
bd88ac1e7c Incorporating changes offered by kostrom in pull request #6 a flippin year ago... 2012-08-26 00:36:52 -06:00
Ben Konrath
9225835dd1 Use django timezone.now() to get current time.
Fallback to python datetime.now() when timezone is not available (Django <
1.4). This has been tested with Django 1.4 and 1.3.1.
2012-07-03 11:29:25 +02:00
Josh VanderLinden
f31a5227f5 Apparently 1.2.4-rc1 was already pushed to PyPI a while ago :) 2012-06-11 08:47:05 -06:00
Mike Blume
ed4b27c732 be careful about whether USE_TZ exists
should fix github issue #13
2012-06-10 21:23:23 -07:00
Ben Konrath
5cf1f2dd59 Update Django timezone support based on comments from Josh VanderLinden. 2012-05-16 19:33:08 +02:00
Ben Konrath
f85f3e001d Add Django timezone support to datetime when enabled. 2012-05-11 10:24:34 +02:00
Mike Blume
9a6f96c4be don't put this whole thing in a try 2011-04-12 21:05:32 +00:00
Mike Blume
b1b0cb390e lots of pep8 fixes 2011-04-12 21:05:32 +00:00
Mike Blume
5e022c56d1 version bump 2011-03-16 17:33:33 +00:00
Mike Blume
50733bce76 make failures a property 2011-03-16 15:13:06 +00:00
Mike Blume
887df1ac4b lose settings import -- we don't seem to be using it. 2011-03-16 15:12:51 +00:00
Mike Blume
e91600dbe2 separete RequestContext from context data we pass in 2011-03-16 15:12:30 +00:00
Mike Blume
8f7ac3fdbe version bump 2011-02-13 19:34:43 +00:00
Mike Blume
b74dec0151 fix kwargs bug 2011-02-13 19:33:23 +00:00
Mike Blume
30c4347a77 version bump 2011-02-13 17:26:52 +00:00
Mike Blume
50a3d4861f add reset management command 2011-01-25 21:41:06 +00:00
Josh VanderLinden
6cc216c14a Removing any passwords from the request data. (GC #2) 2010-12-27 22:16:08 -05:00
Josh VanderLinden
dc1235b6a9 Updating authors. Version bump.
--HG--
extra : rebase_source : 8fdd7f6c7a4c86df8074ea0f7222eff0c7a3b5ca
2010-12-27 21:51:51 -05:00
Mike Blume
7af0764340 Introduce (and document) replacement staff_member_required decorator. 2010-10-18 03:38:42 +00:00
Mike Blume
58453048a9 factor lockout_response into its own helper function 2010-10-18 03:33:50 +00:00
Mike Blume
aa1bc1456b provide more fine-grained control over login patching 2010-10-18 03:32:21 +00:00
Josh VanderLinden
2c066c7080 Merging in changes from MichaelBlume, with some modifications of my own. 2010-10-01 17:41:38 -04:00
Mike Blume
bd04aac6cd bump version 2010-09-27 17:44:57 +00:00
Mike Blume
aa411ddcd6 add reset command.
from axes.utils import reset

reset() will reset all lockouts and access records.
reset(ip) will clear lockout/records for ip

reset will print a message to std out if there is nothing to reset,
unless called with silent = True
2010-09-27 17:43:23 +00:00