From: Mark Huang Date: Tue, 31 Oct 2006 23:07:43 +0000 (+0000) Subject: - node sessions do not expire X-Git-Tag: pycurl-7_13_1~403 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=0eeacfff481ef1b15ee18b242e726dcda8cf2936;p=plcapi.git - node sessions do not expire --- diff --git a/PLC/Auth.py b/PLC/Auth.py index ee1c418f..87d0446e 100644 --- a/PLC/Auth.py +++ b/PLC/Auth.py @@ -4,12 +4,13 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id: Auth.py,v 1.4 2006/10/25 14:22:14 mlhuang Exp $ +# $Id: Auth.py,v 1.5 2006/10/27 15:32:29 mlhuang Exp $ # import crypt import sha import hmac +import time from PLC.Faults import * from PLC.Parameter import Parameter, Mixed @@ -49,7 +50,7 @@ class SessionAuth(Auth): assert auth.has_key('session') # Get session record - sessions = Sessions(method.api, [auth['session']]).values() + sessions = Sessions(method.api, [auth['session']], expires = None).values() if not sessions: raise PLCAuthenticationFailure, "No such session" session = sessions[0] @@ -66,7 +67,7 @@ class SessionAuth(Auth): method.caller = node - elif session['person_id'] is not None: + elif session['person_id'] is not None and session['expires'] > time.time(): persons = Persons(method.api, [session['person_id']], enabled = True).values() if not persons: raise PLCAuthenticationFailure, "No such account"