From 0eeacfff481ef1b15ee18b242e726dcda8cf2936 Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Tue, 31 Oct 2006 23:07:43 +0000 Subject: [PATCH] - node sessions do not expire --- PLC/Auth.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PLC/Auth.py b/PLC/Auth.py index ee1c418..87d0446 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" -- 2.43.0