source: TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/openid/securityservicesapp.py @ 5046

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.test/ndg/security/test/integration/openid/securityservicesapp.py@5046
Revision 5046, 1.0 KB checked in by pjkersha, 10 years ago (diff)

Added integration test for OpenID Relying Party and OpenID Provider in same WSGI stack.

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   
35    app = loadapp('config:%s' % cfgFilePath)
36    serve(app, host='0.0.0.0', port=port)
Note: See TracBrowser for help on using the repository browser.