annotate MoinMoin/auth/log.py @ 5829:a744f573fe30

advancedsearch: fix problem with non-ascii chars breaking up words for OR and NOT terms
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 04 Feb 2012 16:52:24 +0100
parents 70dfb3dea12d
children
rev   line source
776
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - logging auth plugin
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
5776
70dfb3dea12d fix auth.log docstring
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3125
diff changeset
5 This does nothing except logging the auth parameters.
70dfb3dea12d fix auth.log docstring
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3125
diff changeset
6 Be careful with the logs, they contain sensitive data.
70dfb3dea12d fix auth.log docstring
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 3125
diff changeset
7 Do not use this except for debugging auth problems.
776
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8
3125
40c4670c3410 refactored auth package to use own logger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2025
diff changeset
9 @copyright: 2006-2008 MoinMoin:ThomasWaldmann
776
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10 @license: GNU GPL, see COPYING for details.
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 """
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12
3125
40c4670c3410 refactored auth package to use own logger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2025
diff changeset
13 from MoinMoin import log
40c4670c3410 refactored auth package to use own logger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2025
diff changeset
14 logging = log.getLogger(__name__)
40c4670c3410 refactored auth package to use own logger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2025
diff changeset
15
2025
d919b7b7b3e9 auth framework: login() methods return an object now
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2009
diff changeset
16 from MoinMoin.auth import BaseAuth, ContinueLogin
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
17
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
18 class AuthLog(BaseAuth):
776
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 """ just log the call, do nothing else """
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
20 name = "log"
776
ab9cd47eb066 teared auth code into single files, basic built-in moin_login method and also session handling code is still in auth/__init__.py
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
22 def log(self, request, action, user_obj, kw):
3125
40c4670c3410 refactored auth package to use own logger
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2025
diff changeset
23 logging.info('%s: user_obj=%r kw=%r' % (action, user_obj, kw))
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
24
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
25 def login(self, request, user_obj, **kw):
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
26 self.log(request, 'login', user_obj, kw)
2025
d919b7b7b3e9 auth framework: login() methods return an object now
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 2009
diff changeset
27 return ContinueLogin(user_obj)
2009
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
28
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
29 def request(self, request, user_obj, **kw):
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
30 self.log(request, 'session', user_obj, kw)
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
31 return user_obj, True
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
32
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
33 def logout(self, request, user_obj, **kw):
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
34 self.log(request, 'logout', user_obj, kw)
1b14cc05a54a refactor authentication and split out session handling
Johannes Berg <johannes AT sipsolutions DOT net>
parents: 1918
diff changeset
35 return user_obj, True