Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg-security/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, 11 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 |
---|
3 | application |
---|
4 | |
---|
5 | NERC 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 #] |
---|
18 | if __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.