source: TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/integration/openidprovider/securityservicesapp.py @ 7077

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/integration/openidprovider/securityservicesapp.py@7077
Revision 7077, 1.1 KB checked in by pjkersha, 9 years ago (diff)
  • Property svn:keywords set to Id
Line 
1#!/usr/bin/env python
2"""NDG Security test harness for securing an application with OpenID middleware
3
4NERC DataGrid Project
5
6"""
7__author__ = "P J Kershaw"
8__date__ = "26/02/09"
9__copyright__ = "(C) 2009 Science and Technology Facilities Council"
10__license__ = "BSD - See top-level directory for LICENSE file."
11__contact__ = "Philip.Kershaw@stfc.ac.uk"
12__revision__ = "$Id$"
13import os
14from os.path import dirname, abspath, join
15   
16# To start run
17# $ paster serve securityservices.ini or run this file as a script
18# $ ./securityservicesapp.py [port #]
19if __name__ == '__main__':
20    import sys
21    import logging
22    logging.basicConfig(level=logging.DEBUG)
23
24    if len(sys.argv) > 1:
25        port = int(sys.argv[1])
26    else:
27        port = 9443
28       
29    cfgFilePath = os.path.join(dirname(abspath(__file__)), 
30                               'securityservices.ini')
31       
32    from paste.httpserver import serve
33    from paste.deploy import loadapp
34    from paste.script.util.logging_config import fileConfig
35   
36    fileConfig(cfgFilePath)
37    app = loadapp('config:%s' % cfgFilePath)
38    serve(app, host='0.0.0.0', port=port)
Note: See TracBrowser for help on using the repository browser.