commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue common/src/dbdrivers/appserver/DBdriver.py...


From: Jan Ischebeck
Subject: gnue common/src/dbdrivers/appserver/DBdriver.py...
Date: Wed, 05 Jun 2002 15:15:59 -0400

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jan Ischebeck <address@hidden>  02/06/05 15:15:59

Modified files:
        common/src/dbdrivers/appserver: DBdriver.py 
        common/src     : GConditions.py 
        appserver/src  : geasSession.py geasRpcServer.py 
        appserver      : ROADMAP 
        appserver/samples: setup-pgsql.sh 
Added files:
        appserver/src  : geasAuthentification.py 
        appserver      : TODO 

Log message:
        add authentification agent to appserver
        small patches

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/dbdrivers/appserver/DBdriver.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/common/src/GConditions.py.diff?tr1=1.15&tr2=1.16&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasAuthentification.py?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasSession.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/src/geasRpcServer.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/TODO?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/ROADMAP.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/appserver/samples/setup-pgsql.sh.diff?tr1=1.1&tr2=1.2&r1=text&r2=text

Patches:
Index: gnue/appserver/ROADMAP
diff -c gnue/appserver/ROADMAP:1.3 gnue/appserver/ROADMAP:1.4
*** gnue/appserver/ROADMAP:1.3  Sun Jun  2 18:07:25 2002
--- gnue/appserver/ROADMAP      Wed Jun  5 15:15:58 2002
***************
*** 29,31 ****
--- 29,32 ----
  
  * transaction/locking support in the appserver itself    (required for 1.0)
  
+ * status monitoring support (memory usage, current querys, current sessions, 
..)
Index: gnue/appserver/samples/setup-pgsql.sh
diff -c gnue/appserver/samples/setup-pgsql.sh:1.1 
gnue/appserver/samples/setup-pgsql.sh:1.2
*** gnue/appserver/samples/setup-pgsql.sh:1.1   Mon May  6 16:27:57 2002
--- gnue/appserver/samples/setup-pgsql.sh       Wed Jun  5 15:15:58 2002
***************
*** 4,9 ****
--- 4,17 ----
  
  createdb gnue
  psql gnue << EOF
+ create table appserver_users 
+ ( 
+   username varchar (20),
+   password varchar (20),
+   tablelist text
+ );
+ insert into appserver_users values ('test','test','person');
+ 
  create table person
  (
    name varchar (35),
Index: gnue/appserver/src/geasRpcServer.py
diff -c gnue/appserver/src/geasRpcServer.py:1.10 
gnue/appserver/src/geasRpcServer.py:1.11
*** gnue/appserver/src/geasRpcServer.py:1.10    Mon Jun  3 15:09:37 2002
--- gnue/appserver/src/geasRpcServer.py Wed Jun  5 15:15:58 2002
***************
*** 19,37 ****
  #
  # Copyright 2001-2002 Free Software Foundation
  #
! # $Id: geasRpcServer.py,v 1.10 2002/06/03 19:09:37 jcater Exp $
  
  from geasList import *
  from geasSession import *
  
  class geasSessionManager:
    def __init__(self):
      self._sessNo=0
  
    def getNewSession(self):
      self._sessNo=self._sessNo+1
      sess=geasSession (self._connections)
      sess._database=self._database
      return sess
  
    def setConnections(self,connections):
--- 19,41 ----
  #
  # Copyright 2001-2002 Free Software Foundation
  #
! # $Id: geasRpcServer.py,v 1.11 2002/06/05 19:15:58 siesel Exp $
  
  from geasList import *
  from geasSession import *
+ from geasAuthentification import *
  
  class geasSessionManager:
    def __init__(self):
      self._sessNo=0
+     # use DB for authetification
+     self._authAdapter=geasDBAuthAgent()
  
    def getNewSession(self):
      self._sessNo=self._sessNo+1
      sess=geasSession (self._connections)
      sess._database=self._database
+     sess._authAdapter=self._authAdapter
      return sess
  
    def setConnections(self,connections):
***************
*** 52,59 ****
      else:
        return "Running (%s session created)" % self._sessNo
  
! from gnue.common import GComm, openResource, GLoginHandler
! from gnue.common.GServerApp import GServerApp,GConfig
  import time,os,sys
  from gnue.appserver import VERSION
  
--- 56,63 ----
      else:
        return "Running (%s session created)" % self._sessNo
  
! from gnue.common import GComm, openResource, GLoginHandler, GConfig
! from gnue.common.GServerApp import GServerApp
  import time,os,sys
  from gnue.appserver import VERSION
  
***************
*** 134,141 ****
        servers[key].serveAsNewThread()      
  
      # wait for the servers shut down
!     while 1==1:
!       time.sleep(1999999)
      
  
    def requestSessionManager(self):
--- 138,148 ----
        servers[key].serveAsNewThread()      
  
      # wait for the servers shut down
!     try:
!       while 1==1:
!         time.sleep(1999999)
!     except KeyboardInterrupt:
!       print "Appserver is shuting down....ok"
      
  
    def requestSessionManager(self):
***************
*** 170,175 ****
--- 177,183 ----
      if sys.platform != 'win32':
        username = os.environ ["LOGNAME"]
      else:
+       # use getpass module function getUser instead
        username = "gnue"
        
      return {"_username": username, "_password": "(none)"}
Index: gnue/appserver/src/geasSession.py
diff -c gnue/appserver/src/geasSession.py:1.8 
gnue/appserver/src/geasSession.py:1.9
*** gnue/appserver/src/geasSession.py:1.8       Tue Jun  4 11:02:07 2002
--- gnue/appserver/src/geasSession.py   Wed Jun  5 15:15:58 2002
***************
*** 19,27 ****
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.8 2002/06/04 15:02:07 siesel Exp $
  
  import geasList
  
  # 
=============================================================================
  # Session class
--- 19,28 ----
  # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
! # $Id: geasSession.py,v 1.9 2002/06/05 19:15:58 siesel Exp $
  
  import geasList
+ import geasAuthentification 
  
  # 
=============================================================================
  # Session class
***************
*** 35,43 ****
--- 36,46 ----
  
    def __init__ (self, connections):
      self.loggedIn = 0
+     self._user = ""
      self._connections = connections
      self._database = "gnue"
      self._activelists = []
+     self._authAdapter = geasAuthentification.geasAuthAgent()
  
    # 
---------------------------------------------------------------------------
    # Log into the application server
***************
*** 45,58 ****
  
    def login (self, user, password):
      # This username/password is for the Application Server, not for the
!     # database.
!     self.loggedIn = 1
  
    # 
---------------------------------------------------------------------------
    # Logout from the application server
    # 
---------------------------------------------------------------------------
  
    def logout (self):
      self.loggedIn = 0
  
    # 
---------------------------------------------------------------------------
--- 48,65 ----
  
    def login (self, user, password):
      # This username/password is for the Application Server, not for the
!     # database.    
!     self._user = user
!     self.loggedIn = self._authAdapter.authentificate(self, user,
!                                                      {'password':password} )
!     return self.loggedIn
  
    # 
---------------------------------------------------------------------------
    # Logout from the application server
    # 
---------------------------------------------------------------------------
  
    def logout (self):
+     # should the authAdapter be contacted?
      self.loggedIn = 0
  
    # 
---------------------------------------------------------------------------
***************
*** 60,70 ****
    # 
---------------------------------------------------------------------------
  
    def createList (self, classname):
!     newlist=geasList.geasList (self, classname)
!     # every new list will be added to the _activelists list
!     # which will be parsed for commit and rollback actions
!     self._activelists.append(newlist)
!     return newlist;
  
    # 
---------------------------------------------------------------------------
    # Commit the active transaction
--- 67,85 ----
    # 
---------------------------------------------------------------------------
  
    def createList (self, classname):
!     
!     # check if user has access rights for this list
!     if self._authAdapter.hasAccess (self, self._user, classname):
!       
!       # create new List
!       newlist=geasList.geasList (self, classname)
!       # every new list will be added to the _activelists list
!       # which will be parsed for commit and rollback actions
!       self._activelists.append(newlist)
!       return newlist;
!     
!     else: # no access
!       return None
  
    # 
---------------------------------------------------------------------------
    # Commit the active transaction
Index: gnue/common/src/GConditions.py
diff -c gnue/common/src/GConditions.py:1.15 gnue/common/src/GConditions.py:1.16
*** gnue/common/src/GConditions.py:1.15 Tue Jun  4 11:02:07 2002
--- gnue/common/src/GConditions.py      Wed Jun  5 15:15:58 2002
***************
*** 123,130 ****
        paramcount.update({level:(paramcount[level]-1)})
        if paramcount[level]==0:
          level=level-1    
!     print "NAME: %s  VALUE: %s  LEVEL: %s PCOUNT: %s" % \
!           (i[0],i[1],level,paramcount[level])
      
    return parent[0];
  
--- 123,130 ----
        paramcount.update({level:(paramcount[level]-1)})
        if paramcount[level]==0:
          level=level-1    
! #    print "NAME: %s  VALUE: %s  LEVEL: %s PCOUNT: %s" % \
! #          (i[0],i[1],level,paramcount[level])
      
    return parent[0];
  
Index: gnue/common/src/dbdrivers/appserver/DBdriver.py
diff -c gnue/common/src/dbdrivers/appserver/DBdriver.py:1.6 
gnue/common/src/dbdrivers/appserver/DBdriver.py:1.7
*** gnue/common/src/dbdrivers/appserver/DBdriver.py:1.6 Tue Jun  4 11:02:07 2002
--- gnue/common/src/dbdrivers/appserver/DBdriver.py     Wed Jun  5 15:15:58 2002
***************
*** 29,35 ****
  # HISTORY:
  #
  
! VERSION="0.0.0.5"
  
  from gnue.common import GDataObjects, GDebug, GConditions, GComm
  import string
--- 29,35 ----
  # HISTORY:
  #
  
! VERSION="0.0.1"
  
  from gnue.common import GDataObjects, GDebug, GConditions, GComm
  import string
***************
*** 221,227 ****
          # TODO: (jcater)     allowGuestLogin = [0|1]
          # TODO: (jcater)     guestLogin = guest
          # TODO: (jcater)     allowBlankLogin = [0|1]
!         self._session.login(user,passwd)
        else:
  
          # TODO: (jcater) The GEAS docs say this is not supported and
--- 221,229 ----
          # TODO: (jcater)     allowGuestLogin = [0|1]
          # TODO: (jcater)     guestLogin = guest
          # TODO: (jcater)     allowBlankLogin = [0|1]
!         if not self._session.login(user,passwd):
!           # self._session.close()
!           raise GDataObjects.ConnectionError, "Error loging into appserver"
        else:
  
          # TODO: (jcater) The GEAS docs say this is not supported and
***************
*** 230,236 ****
          # TODO: (jcater) this will have to do for now (even though,
          # TODO: (jcater) IIRC, is does nothing to validate the user/pass
          # TODO: (jcater) supplied to it.)
!         self._session.login(user,passwd)
  
  #      self.triggerExtensions = TriggerExtensions(self._dataConnection)
        self.triggerExtensions = TriggerExtensions(self._session)
--- 232,240 ----
          # TODO: (jcater) this will have to do for now (even though,
          # TODO: (jcater) IIRC, is does nothing to validate the user/pass
          # TODO: (jcater) supplied to it.)
!         if not self._session.login(user,passwd):
!           # self._session.close()
!           raise GDataObjects.ConnectionError, "Error loging into appserver"
  
  #      self.triggerExtensions = TriggerExtensions(self._dataConnection)
        self.triggerExtensions = TriggerExtensions(self._session)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]