Changeset 968
- Timestamp:
- 19/05/06 18:40:30 (15 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 6 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/NDG/Gatekeeper.py
r964 r968 18 18 # Alter system path for dynamic import of resource interface class 19 19 import sys 20 21 # Expand environment vars in paths 22 import os 20 23 21 24 from AttCert import * … … 38 41 Certificate can access a given resource.""" 39 42 40 __validKeys = ( 'resrc URI',43 __validKeys = ( 'resrcID', 41 44 'resrcModFilePath', 42 45 'resrcModName', … … 100 103 # Check class inherits from GatekeeperResrc abstract base class 101 104 if not issubclass(resrcClass, GatekeeperResrc): 102 raise GatekeeperError (\103 "Resource URI interface class %s must be derived from " +\104 "GatekeeperResrc" % self.__prop['resrcClassName'])105 raise GatekeeperError, \ 106 "Resource interface class %s must be derived from " % \ 107 self.__prop['resrcClassName'] + "GatekeeperResrc" 105 108 106 109 … … 140 143 141 144 # Copy properties from file as dictionary 142 self.__prop = dict([(elem.tag, elem.text) for elem in elems]) 145 # 146 # Nb. # Allow for environment variables in paths 147 self.__prop.update(dict([(elem.tag, 148 os.path.expandvars(elem.text.strip())) \ 149 for elem in elems if elem.text is not None])) 143 150 144 151 … … 169 176 # Check signature of AttCert 170 177 try: 171 attCert.isValid(raiseExcep=True,178 input.isValid(raiseExcep=True, 172 179 certFilePathList=self.__prop['caCertFilePath']) 173 180 except Exception, e: 174 raise Gate KeeperError, "Access denied for input: %s" % str(e)181 raise GatekeeperError, "Access denied for input: %s" % str(e) 175 182 176 183 return input.getRoles() … … 241 248 242 249 #_____________________________________________________________________________ 243 class GatekeeperResrcError(Gate KeeperError):250 class GatekeeperResrcError(GatekeeperError): 244 251 """Exception handling for NDG Gatekeeper Resource interface class 245 252 class.""" -
TI12-security/trunk/python/Tests/AttAuthorityClientTest.py
r848 r968 40 40 41 41 42 def getPubKeyTest(self):42 def testGetPubKey(self): 43 43 try: 44 44 # Request an attribute certificate from an Attribute Authority … … 59 59 60 60 61 def getTrustedHostInfoTest(self):61 def testGetTrustedHostInfo(self): 62 62 63 63 try: … … 67 67 68 68 69 def reqAuthorisationTest(self):69 def testReqAuthorisation(self): 70 70 """Request authorisation from NDG Attribute Authority Web Service.""" 71 71 … … 105 105 106 106 except IOError, ioErr: 107 raise "Error reading attribute certificate file \"%s\": %s" % 107 raise "Error reading attribute certificate file \"%s\": %s" %\ 108 108 (ioErr.filename, ioErr.strerror) 109 109 else: … … 130 130 map = map(attAuthorityClientTestCase, 131 131 ( 132 " getTrustedHostInfoTest",133 " reqAuthorisationTest",134 " getPubKeyTest",132 "testGetTrustedHostInfo", 133 "testReqAuthorisation", 134 "testGetPubKey", 135 135 )) 136 136 unittest.TestSuite.__init__(self, map) -
TI12-security/trunk/python/Tests/SecurityClientTest.py
r964 r968 85 85 def cookieConnectTest(self): 86 86 87 userName = ' pjkersha'87 userName = 'lawrence' 88 88 try: 89 89 # Connect as if acting as a browser client - a cookie is returned … … 101 101 def proxyCertConnectTest(self): 102 102 103 userName = ' pjkersha'103 userName = 'lawrence' 104 104 105 105 try: -
TI12-security/trunk/python/bin/LogServer.py
r917 r968 89 89 dest="logFilePath", 90 90 help=\ 91 "file path for log file to log to - default is $NDG_DIR/log s")91 "file path for log file to log to - default is $NDG_DIR/log") 92 92 93 93 parser.add_option("-d",
Note: See TracChangeset
for help on using the changeset viewer.