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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_test/ndg/security/test/integration/openidrelyingparty_withapp/securedapp.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 authorisation middleware used to secure an
3application
4
5NERC DataGrid Project
6"""
7__author__ = "P J Kershaw"
8__date__ = "20/11/08"
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$"
13
14   
15# To start run
16# $ paster serve services.ini or run this file as a script
17# $ ./securedapp.py [port #]
18if __name__ == '__main__':
19    import sys
20    import os
21    from os.path import dirname, abspath
22    import logging
23    logging.basicConfig(level=logging.DEBUG)
24
25    if len(sys.argv) > 1:
26        port = int(sys.argv[1])
27    else:
28        port = 7080
29       
30    cfgFilePath = os.path.join(dirname(abspath(__file__)), 'securedapp.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.