Changeset 970
- Timestamp:
- 22/05/06 09:38:21 (15 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/NDG/TestGatekeeperResrc.py
r968 r970 31 31 # In practice, roles and permissions may be derived from the resource 32 32 # itself id'd by resrcID 33 self.__permissionsLUT = {'ecmwfop': ('r'), 'ecmwfopAdmin': ('r', 'w')} 33 self.__permissionsLUT = { 'ecmwfop': ('r'), 34 'ecmwfopAdmin': ('r', 'w'), 35 'pum': ('w', 'x') } 34 36 35 37 -
TI12-security/trunk/python/NDG/gatekeeper_services_server.py
r968 r970 62 62 # and return the corresponding role 63 63 for role, bAccess in self.__srv.executeAccess(attCert).items(): 64 if bAccess: break65 66 response._matchingRole = role64 if bAccess: 65 response._matchingRole = role 66 break 67 67 68 68 except Exception, e: … … 95 95 # keyed by role name. Find the first where access is True 96 96 # and return the corresponding role 97 for role, bAccess in self.__srv. executeAccess(attCert).items():98 if bAccess: break99 100 response._matchingRole = role97 for role, bAccess in self.__srv.readAccess(attCert).items(): 98 if bAccess: 99 response._matchingRole = role 100 break 101 101 102 102 except Exception, e: … … 129 129 # keyed by role name. Find the first where access is True 130 130 # and return the corresponding role 131 for role, bAccess in self.__srv. executeAccess(attCert).items():132 if bAccess: break133 134 response._matchingRole = role131 for role, bAccess in self.__srv.writeAccess(attCert).items(): 132 if bAccess: 133 response._matchingRole = role 134 break 135 135 136 136 except Exception, e: -
TI12-security/trunk/python/Tests/GatekeeperClientTest.py
r968 r970 16 16 import os 17 17 import sys 18 import glob 18 19 19 20 from NDG.GatekeeperClient import * … … 28 29 #traceFile=sys.stderr) 29 30 30 self.attCertFilePath = 'ac-bFpx4Q.xml' #'./ac-y_i5fI.xml'31 self.attCertFilePath = glob.glob('ac-*.xml')[0] 31 32 self.sAttCert = open(self.attCertFilePath).read().strip() 32 33 self.attCert = AttCertParse(self.sAttCert) … … 43 44 44 45 try: 45 print "Role for read access: %s" % \46 print "Role for read access: '%s'" % \ 46 47 self.gkClnt.readAccess(attCertFilePath=self.attCertFilePath) 47 48 … … 53 54 54 55 try: 55 print "Role for write access: %s" % \56 print "Role for write access: '%s'" % \ 56 57 self.gkClnt.writeAccess(self.sAttCert) 57 58 … … 62 63 def testExecuteAccessForRapid(self): 63 64 64 import pdb65 pdb.set_trace()66 65 try: 67 print "Role for execute access: %s" % \66 print "Role for execute access: '%s'" % \ 68 67 self.gkClnt.executeAccess(self.attCert) 69 68 -
TI12-security/trunk/python/Tests/GatekeeperTest.py
r930 r970 19 19 20 20 21 class GkResrc URIinterface(GatekeeperResrcURI):21 class GkResrcinterface(GatekeeperResrc): 22 22 """Gatekeeper interface test class""" 23 23 … … 39 39 def setUp(self): 40 40 try: 41 self.gk = Gatekeeper(resrc URI='somewhere',42 resrc URImodFilePath='./GatekeeperTest.py',43 resrc URImodName='GatekeeperTest',44 resrc URIclassName='GkResrcURIinterface')41 self.gk = Gatekeeper(resrcID='somewhere', 42 resrcModFilePath='./GatekeeperTest.py', 43 resrcModName='GatekeeperTest', 44 resrcClassName='GkResrcinterface') 45 45 except Exception, e: 46 46 self.fail(str(e)) … … 66 66 try: 67 67 self.gk.readProperties('gatekeeperProperties.xml') 68 self.gk.initResrc URIinterface()68 self.gk.initResrcinterface() 69 69 70 70 print "Role List Permissions: %s" % self.gk(['nextmap', 'synop'])
Note: See TracChangeset
for help on using the changeset viewer.