source: TI12-security/trunk/python/ndg.security.server/ndg/security/server/sso/sso/config/environment.py @ 3914

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.server/ndg/security/server/sso/sso/config/environment.py@3914
Revision 3914, 1.5 KB checked in by pjkersha, 12 years ago (diff)
  • New ndg.security.common.zsi_util.httpproxy.ProxyHTTPConnection class replaces urllib2client - easier to fit into existing ZSI client framework.
  • Further OpenID integration into Single Sign On Service. User now authenticates OK but patches needed to AuthKit? + need to handle return_to URL dynamically according to page visited before WAYF call.
Line 
1"""Pylons environment configuration"""
2import os
3
4from pylons import config
5
6import sso.lib.app_globals as app_globals
7import sso.lib.helpers
8from sso.config.routing import make_map
9
10def load_environment(global_conf, app_conf):
11    """Configure the Pylons environment via the ``pylons.config``
12    object
13    """
14    # Pylons paths
15    root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
16    paths = dict(root=root,
17                 controllers=os.path.join(root, 'controllers'),
18                 static_files=os.path.join(root, 'public'),
19                 templates=[os.path.join(root, 'templates')])
20
21    # Initialize config with the basic options
22    config.init_app(global_conf, app_conf, package='sso',
23                    template_engine='kid', paths=paths)
24
25    config['routes.map'] = make_map()
26    config['pylons.g'] = app_globals.Globals()
27    config['pylons.h'] = sso.lib.helpers
28
29    # Customize templating options via this variable
30    tmpl_options = config['buffet.template_options']
31
32    # CONFIGURATION OPTIONS HERE (note: all config options will override
33    # any Pylons config options)
34   
35    # Make a dedicated alias for SSO Service templates to avoid possible
36    # conflicts when importing SSO Service code into another pylons project
37    kidopts = {'kid.assume_encoding':'utf-8', 'kid.encoding':'utf-8'}
38    config.add_template_engine('kid', 
39                               'ndg.security.server.sso.sso.templates', 
40                               kidopts,
41                               alias='ndg.security.kid')
Note: See TracBrowser for help on using the repository browser.