Changeset 941
- Timestamp:
- 17/05/06 14:23:02 (15 years ago)
- Location:
- TI12-security/trunk/python
- Files:
-
- 1 added
- 7 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/NDG/LogClient.py
r921 r941 21 21 #_____________________________________________________________________________ 22 22 class LogClientError(Exception): 23 """Exception handling for SessionClientclass"""23 """Exception handling for Logging class""" 24 24 def __init__(self, msg): 25 25 self.__msg = msg -
TI12-security/trunk/python/NDG/SecurityClient.py
r848 r941 700 700 701 701 if 'errMsg' in authResp and authResp['errMsg']: 702 raise AttAuthorityClientError( resp['errMsg'])702 raise AttAuthorityClientError(authResp['errMsg']) 703 703 704 704 return authResp -
TI12-security/trunk/python/NDG/Session.py
r930 r941 50 50 from NDG import AttAuthorityIO 51 51 52 # Use client package to allow reidrection of authorisation requests 53 from NDG.SessionClient import * 52 # Use client package to allow redirection of authorisation requests 53 from NDG.SecurityClient import SessionClient 54 from NDG.SecurityClient import SessionClientError 54 55 55 56 # Use to pipe output from ZSI ServiceProxy -
TI12-security/trunk/python/NDG/X509.py
r930 r941 254 254 255 255 if not isinstance(self.__dtNotBefore, datetime): 256 raise AttCertError("Not Before datetime is not set")256 raise X509CertError("Not Before datetime is not set") 257 257 258 258 if not isinstance(self.__dtNotAfter, datetime): 259 raise AttCertError("Not After datetime is not set")259 raise X509CertError("Not After datetime is not set") 260 260 261 261 dtNow = datetime.utcnow() … … 263 263 if raiseExcep: 264 264 if dtNow < self.__dtNotBefore: 265 raise X509 Error("Current time is before the " + \266 "certificate's Not Before Time")265 raise X509CertError("Current time is before the " + \ 266 "certificate's Not Before Time") 267 267 268 268 elif dtNow > self.__dtNotAfter: 269 raise X509 Error("Certificate has expired")269 raise X509CertError("Certificate has expired") 270 270 else: 271 271 return dtNow > self.__dtNotBefore and dtNow < self.__dtNotAfter -
TI12-security/trunk/python/Tests/SecurityClientTest.py
r848 r941 28 28 try: 29 29 # Session Manager WSDL 30 smWSDL = 'http://g abriel.bnsc.rl.ac.uk/sessionMgr.wsdl'30 smWSDL = 'http://glue.badc.rl.ac.uk/sessionMgr.wsdl' 31 31 32 32 # Public key of session manager used to encrypt requests … … 39 39 clntPubKeyFilePath = "./Junk-cert.pem" 40 40 clntPriKeyFilePath = "./Junk-key.pem" 41 traceFile = None#sys.stderr 41 42 42 43 # Initialise the Session Manager client connection … … 46 47 clntPubKeyFilePath=clntPubKeyFilePath, 47 48 clntPriKeyFilePath=clntPriKeyFilePath, 48 traceFile= sys.stderr)49 traceFile=traceFile) 49 50 50 51 # Attribute Authority client tests … … 56 57 clntPubKeyFilePath=clntPubKeyFilePath, 57 58 clntPriKeyFilePath=clntPriKeyFilePath, 58 traceFile= sys.stderr)59 traceFile=traceFile) 59 60 except Exception, e: 60 61 self.fail(str(e)) … … 65 66 66 67 67 def addUserTest(self):68 def testAddUser(self): 68 69 69 70 userName = 'pjkersha' … … 163 164 164 165 165 def getPubKeyTest(self):166 def testGetPubKey(self): 166 167 try: 167 168 # Request an attribute certificate from an Attribute Authority 168 169 # using the proxyCert returned from connect() 169 import pdb170 pdb.set_trace()171 170 pubKey = self.sessClnt.getPubKey() 172 171 … … 177 176 178 177 179 def aaGetTrustedHostInfo(self):178 def testAAgetTrustedHostInfo(self): 180 179 """Call Attribute Authority GetTrustedHostInfo""" 181 182 import pdb183 pdb.set_trace()184 180 185 181 role = 'rapid' … … 194 190 195 191 196 def aaReqAuthorisation(self):192 def testAAReqAuthorisation(self): 197 193 """Call Attribute Authority authorisation request""" 198 194 199 195 import pdb 200 196 pdb.set_trace() 201 202 203 197 try: 204 198 proxyCert = open("./proxy.pem").read().strip() … … 221 215 map = map(SecurityClientTestCase, 222 216 ( 223 " addUserTest",224 " connectTest",225 " reqAuthorisationTest",226 " getPubKeyTest",227 " aaGetTrustedHostInfo",228 " aaReqAuthorisation",217 "testAddUser", 218 "testConnect", 219 "testReqAuthorisation", 220 "testGetPubKey", 221 "testAAgetTrustedHostInfo", 222 "testAAReqAuthorisation", 229 223 )) 230 224 unittest.TestSuite.__init__(self, map) -
TI12-security/trunk/python/ndgSetup.sh
r737 r941 52 52 53 53 # Set DN explicitly to ensure match with server certificate 54 #export MYPROXY_SERVER_DN="<hostcert DN with '/' delimiters "54 #export MYPROXY_SERVER_DN="<hostcert DN with '/' delimiters>" 55 55 56 56 -
TI12-security/trunk/python/setup.py
r850 r941 18 18 { 19 19 'name': 'NDG-Security', 20 'version': '0.6 4',20 'version': '0.65', 21 21 'description': 'NERC DataGrid Security Utilities', 22 22 'author': 'P J Kershaw',
Note: See TracChangeset
for help on using the changeset viewer.