allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: Extra logging around sessions
Date Wed, 16 Apr 2014 21:37:53 GMT
Repository: allura
Updated Branches:
  refs/heads/debug_sessions [created] a98fc17aa


Extra logging around sessions


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/a98fc17a
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/a98fc17a
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/a98fc17a

Branch: refs/heads/debug_sessions
Commit: a98fc17aa350b5d82bbd331ce77c5ed98bc37a5e
Parents: 914f548
Author: Dave Brondsema <dave@brondsema.net>
Authored: Wed Apr 16 17:37:49 2014 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Apr 16 17:37:49 2014 -0400

----------------------------------------------------------------------
 Allura/allura/lib/plugin.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/a98fc17a/Allura/allura/lib/plugin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/plugin.py b/Allura/allura/lib/plugin.py
index 2a09d73..a4e08f9 100644
--- a/Allura/allura/lib/plugin.py
+++ b/Allura/allura/lib/plugin.py
@@ -70,6 +70,7 @@ class AuthenticationProvider(object):
     forgotten_password_process = False
 
     def __init__(self, request):
+        log.info('new AuthProvider for %s', request)
         self.request = request
 
     @classmethod
@@ -84,11 +85,14 @@ class AuthenticationProvider(object):
 
     @LazyProperty
     def session(self):
-        return self.request.environ['beaker.session']
+        s = self.request.environ['beaker.session']
+        log.info('session value: %s %s', s, self.request)
+        return s
 
     def authenticate_request(self):
         from allura import model as M
         user = M.User.query.get(_id=self.session.get('userid', None))
+        log.info('authenticated as %s', user._id if user else '*anon')
         if user is None:
             return M.User.anonymous()
         if user.disabled:
@@ -118,6 +122,7 @@ class AuthenticationProvider(object):
         try:
             if user is None:
                 user = self._login()
+            log.info('login set session to %s', user._id)
             self.session['userid'] = user._id
             self.session.save()
             g.zarkov_event('login', user=user)


Mime
View raw message