16 NoSelectableObject, RepositoryError) |
16 NoSelectableObject, RepositoryError) |
17 from cubicweb.cwconfig import CubicWebConfiguration |
17 from cubicweb.cwconfig import CubicWebConfiguration |
18 from cubicweb.cwvreg import CubicWebRegistry |
18 from cubicweb.cwvreg import CubicWebRegistry |
19 from cubicweb.web import (LOGGER, StatusResponse, DirectResponse, Redirect, NotFound, |
19 from cubicweb.web import (LOGGER, StatusResponse, DirectResponse, Redirect, NotFound, |
20 RemoteCallFailed, ExplicitLogin, InvalidSession) |
20 RemoteCallFailed, ExplicitLogin, InvalidSession) |
21 from cubicweb.web.component import SingletonComponent |
21 from cubicweb.web.component import Component |
22 |
22 |
23 # make session manager available through a global variable so the debug view can |
23 # make session manager available through a global variable so the debug view can |
24 # print information about web session |
24 # print information about web session |
25 SESSION_MANAGER = None |
25 SESSION_MANAGER = None |
26 |
26 |
27 class AbstractSessionManager(SingletonComponent): |
27 class AbstractSessionManager(Component): |
28 """manage session data associated to a session identifier""" |
28 """manage session data associated to a session identifier""" |
29 id = 'sessionmanager' |
29 id = 'sessionmanager' |
30 |
30 |
31 def __init__(self): |
31 def __init__(self): |
32 self.session_time = self.vreg.config['http-session-time'] or None |
32 self.session_time = self.vreg.config['http-session-time'] or None |
85 corrupted...) |
85 corrupted...) |
86 """ |
86 """ |
87 raise NotImplementedError() |
87 raise NotImplementedError() |
88 |
88 |
89 |
89 |
90 class AbstractAuthenticationManager(SingletonComponent): |
90 class AbstractAuthenticationManager(Component): |
91 """authenticate user associated to a request and check session validity""" |
91 """authenticate user associated to a request and check session validity""" |
92 id = 'authmanager' |
92 id = 'authmanager' |
93 |
93 |
94 def authenticate(self, req): |
94 def authenticate(self, req): |
95 """authenticate user and return corresponding user object |
95 """authenticate user and return corresponding user object |