- Timestamp:
- 21/12/09 16:40:20 (11 years ago)
- Location:
- TI12-security/trunk/python/ndg_security_test/ndg/security/test
- Files:
-
- 2 added
- 3 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TI12-security/trunk/python/ndg_security_test/ndg/security/test/integration/authz_lite/securityservices.ini
r6127 r6202 181 181 #authkit.openid.ax.alias.firstName=first_name 182 182 #authkit.openid.ax.count.firstName=1 183 #authkit.openid.ax.required.firstName=True 183 184 authkit.openid.ax.typeuri.lastName=http://openid.net/schema/namePerson/last 185 authkit.openid.ax.required.lastName=True 184 186 authkit.openid.ax.typeuri.emailAddress=http://openid.net/schema/contact/internet/email 185 #authkit.openid.ax.required.emailAddress=True187 authkit.openid.ax.required.emailAddress=True 186 188 187 189 … … 209 211 # <meta http-equiv="x-xrds-location" content="..."> links if required but in 210 212 # this implementation it set to return 404 not found - see 211 # ndg.security.server.wsgi.openid.provider.renderinginterface. buffet.BuffetRendering213 # ndg.security.server.wsgi.openid.provider.renderinginterface.genshi.GenshiRendering 212 214 # class 213 215 openid.provider.path.id=/OpenID/Provider/id/${userIdentifier} -
TI12-security/trunk/python/ndg_security_test/ndg/security/test/unit/wsgi/myproxy/test_myproxy.py
r6107 r6202 16 16 import urllib2 17 17 import base64 18 18 19 import paste.fixture 19 20 from paste.deploy import loadapp 21 22 from M2Crypto import X509 23 20 24 from ndg.security.test.unit import BaseTestCase 21 25 from ndg.security.common.utils.configfileparsers import \ … … 129 133 BaseTestCase.__init__(self, *args, **kwargs) 130 134 135 # Thread separate Paster based service 136 self.addService(app=self.wsgiapp, 137 port=MyProxyLogonMiddlewareTestCase.SERVICE_PORTNUM) 138 131 139 def test01PasteFixtureInvalidCredentials(self): 132 140 username = '_test' … … 160 168 print response 161 169 162 def test03Urllib2Client(self): 163 # Thread separate Paster based service 164 self.addService(app=self.wsgiapp, 165 port=MyProxyLogonMiddlewareTestCase.SERVICE_PORTNUM) 166 167 username = self.username 168 if self.password is None: 169 from getpass import getpass 170 password = getpass('test03Urllib2Client: MyProxy pass-phrase for ' 171 '%r: ' % username) 170 def test03Urllib2ClientGET(self): 171 172 username = self.username 173 if self.password is None: 174 from getpass import getpass 175 password = getpass('test03Urllib2ClientGET: MyProxy pass-phrase ' 176 'for %r: ' % username) 172 177 else: 173 178 password = self.password … … 186 191 print (response) 187 192 188 def test04WGetClient(self): 193 def test04Urllib2ClientPOST(self): 194 195 username = self.username 196 if self.password is None: 197 from getpass import getpass 198 password = getpass('test04Urllib2ClientPOST: MyProxy pass-phrase ' 199 'for %r: ' % username) 200 else: 201 password = self.password 202 203 url = 'http://localhost:%d/test_200' % \ 204 MyProxyLogonMiddlewareTestCase.SERVICE_PORTNUM 205 206 req = urllib2.Request(url) 207 base64String = base64.encodestring('%s:%s' % (username, password))[:-1] 208 authHeader = "Basic %s" % base64String 209 req.add_header("Authorization", authHeader) 210 211 # Create key pair 212 keys = RSA.gen_key(nBitsForKey, m2.RSA_F4) 213 certReq = X509.Request() 214 215 # Create public key object 216 pubKey = EVP.PKey() 217 pubKey.assign_rsa(keys) 218 219 # Add the public key to the request 220 certReq.set_version(0) 221 certReq.set_pubkey(pubKey) 222 223 x509Name = X509.X509_Name() 224 certReq.set_subject_name(x509Name) 225 226 certReq.sign(pubKey, messageDigest) 227 228 pemCertReq = certReq.as_pem() 229 230 handle = urllib2.urlopen(req, data=pemCertReq) 231 232 response = handle.read() 233 print (response) 234 235 def test05WGetClient(self): 189 236 uri = ('http://localhost:%d/test_200' % 190 237 MyProxyLogonMiddlewareTestCase.SERVICE_PORTNUM)
Note: See TracChangeset
for help on using the changeset viewer.