23 |
|
|
24 |
import geasSession |
import geasSession |
25 |
import geasAuthentication |
import geasAuthentication |
26 |
|
import geasTrigger |
27 |
import classrep |
import classrep |
28 |
|
|
29 |
# ============================================================================= |
# ============================================================================= |
47 |
self._connections = connections |
self._connections = connections |
48 |
self._sessNo = 0 |
self._sessNo = 0 |
49 |
self._sessions = {} |
self._sessions = {} |
50 |
# initialize Class Repository without Authentication |
self._buildInternalSess() |
51 |
self._authAdapter = geasAuthentication.geasAuthAgent () |
self._classRep = classrep.init (self) |
52 |
classrep.init (self) |
|
53 |
# use DB for authetification |
# TODO: load default authagent depending on config setting |
54 |
# self._authAdapter = geasAuthentification.geasDBAuthAgent() |
self._authAdapter = geasAuthentication.geasDBAuthAgent(self._internalSession) |
55 |
# Commented out as long as authentication classes are not fully defined |
|
56 |
|
self._triggerMg = geasTrigger.geasPythonDBTriggerMg(self) |
57 |
|
|
58 |
|
|
59 |
|
# --------------------------------------------------------------------------- |
60 |
|
# Build an internal session |
61 |
|
# --------------------------------------------------------------------------- |
62 |
|
|
63 |
|
def _buildInternalSess(self): |
64 |
|
self._internalSession = geasSession.geasSession (self._connections, |
65 |
|
geasAuthentication.geasAuthAgent(), |
66 |
|
None) |
67 |
|
self._internalSession.login(None,None) # fake login |
68 |
|
self._sessions[self._internalSession]=self._internalSession |
69 |
|
|
70 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
71 |
# Find a session from session ID |
# Find a session from session ID |
82 |
# --------------------------------------------------------------------------- |
# --------------------------------------------------------------------------- |
83 |
|
|
84 |
def open (self, authentication): |
def open (self, authentication): |
85 |
sess = geasSession.geasSession (self._connections) |
sess = geasSession.geasSession (self._connections, |
86 |
sess._authAdapter = self._authAdapter |
self._authAdapter, |
87 |
|
self._triggerMg) |
88 |
|
|
89 |
if not sess.login (authentication ['user'], |
if not sess.login (authentication ['user'], |
90 |
authentication ['password']): |
authentication ['password']): |
91 |
raise AuthError |
raise AuthError |