source: TI12-security/trunk/python/ndg_security_test/ndg/security/test/integration/authz_lite/securityservicesapp.py @ 6063

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg_security_test/ndg/security/test/integration/authz_lite/securityservicesapp.py@6063
Revision 6063, 1.6 KB checked in by pjkersha, 11 years ago (diff)

Working authz lite integration tests with integrated SAML Attribute Authority interface to authz middleware: the old NDG Attribute Authority SOAP/WSDL interface is completely removed as a dependency.

  • major fixes to ndg.security.common.credentialwallet NDGCredentialWallet and SAMLCredentialWallet for slots and pickling capability needed for beaker.session. NDGCredentialWallet is kept for the moment for backwards compatibility.
Line 
1#!/usr/bin/env python
2"""NDG Security test harness for security web services middleware stack
3
4NERC DataGrid Project
5
6"""
7__author__ = "P J Kershaw"
8__date__ = "20/11/08"
9__copyright__ = "(C) 2009 Science and Technology Facilities Council"
10__contact__ = "Philip.Kershaw@stfc.ac.uk"
11__revision__ = "$Id$"
12import os
13from os.path import dirname, abspath, join
14     
15from OpenSSL import SSL
16
17from ndg.security.test.unit import BaseTestCase
18from ndg.security.test.unit.wsgi import PasteDeployAppServer
19
20INI_FILEPATH = 'securityservices.ini'
21
22# To start run
23# $ paster serve services.ini or run this file as a script
24# $ ./securityservicesapp.py [port #]
25if __name__ == '__main__':
26    import sys
27    if len(sys.argv) > 1:
28        port = int(sys.argv[1])
29    else:
30        port = 7443
31       
32    cfgFileName = INI_FILEPATH
33    cfgFilePath = os.path.join(dirname(abspath(__file__)), cfgFileName) 
34   
35    certFilePath = os.path.join(BaseTestCase.NDGSEC_TEST_CONFIG_DIR, 
36                                'pki', 
37                                'localhost.crt')
38    priKeyFilePath = os.path.join(BaseTestCase.NDGSEC_TEST_CONFIG_DIR, 
39                                  'pki', 
40                                  'localhost.key')
41   
42    ssl_context = SSL.Context(SSL.SSLv23_METHOD)
43    ssl_context.set_options(SSL.OP_NO_SSLv2)
44
45    ssl_context.use_privatekey_file(priKeyFilePath)
46    ssl_context.use_certificate_file(certFilePath)
47
48    server = PasteDeployAppServer(cfgFilePath=cfgFilePath, 
49                                  port=port,
50                                  ssl_context=ssl_context) 
51    server.start()
Note: See TracBrowser for help on using the repository browser.