source: TI12-security/trunk/python/ndg.security.server/ndg/security/server/paster_templates/template.py @ 4773

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/python/ndg.security.server/ndg/security/server/paster_templates/template.py@4773
Revision 4773, 2.2 KB checked in by pjkersha, 12 years ago (diff)
  • Added Paster template ndgsecurity_services_with_sso - the saem as default_deployment but includes config for the Single Sign On service as well.
  • Fix to default deployment - include test cert and key for WS-Security Signature Handler
  • Fixes to Single Sign On service: openIDEnabled flag in config now enables/disables OpenID div in wayf.kid + return to URL now correctly initialised to
  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2
3from paste.script.templates import Template, var, _skip_variables
4import os
5import socket
6_hostTuple = socket.gethostbyaddr(socket.gethostname())
7try:
8    # Get first alias from list if present
9    _hostname = _hostTuple[1][0]
10except TypeError:
11    # ... or default to hostname
12    _hostname = _hostTuple[0]
13   
14vars = [
15    var('siteName', 
16        ('Full name for this site used by the Attribute Authority to describe '
17         'this site'),
18        default='NDG Partner Site'),
19    var('attributeAuthorityID', 
20        ('Unique identity by which this Attribute Authority will be known by '
21         'other trusted sites'),
22        default=_hostname)
23]
24
25class DefaultDeploymentTemplate(Template):
26    _template_dir = 'default_deployment'
27    summary = 'NERC DataGrid Security services deployment template'
28    vars = vars
29
30# Single Sign On Service not included in this template
31#    def write_files(self, command, output_dir, vars):
32#        '''Extend to enable substitutions for Single Sign On Service config
33#        file'''
34#        if output_dir.startswith('./'):
35#            outDir = output_dir.lstrip('./')
36#        else:
37#            outDir = output_dir
38#           
39#        vars['ssoConfigDir'] = os.path.join(os.getcwd(), outDir, 'sso')
40#        super(DefaultDeploymentTemplate, self).write_files(command,
41#                                                           output_dir,
42#                                                           vars)
43       
44class FullDeploymentTemplate(Template):
45    _template_dir = 'full_deployment'
46    summary = ('NERC DataGrid Security services full deployment template '
47               'including the Single Sign On Service')
48    vars = vars
49
50    def write_files(self, command, output_dir, vars):
51        '''Extend to enable substitutions for Single Sign On Service config
52        file'''
53        if output_dir.startswith('./'):
54            outDir = output_dir.lstrip('./')
55        else:
56            outDir = output_dir
57           
58        vars['installDir'] = os.path.join(os.getcwd(), outDir)
59        super(FullDeploymentTemplate, self).write_files(command, 
60                                                        output_dir, 
61                                                        vars)
Note: See TracBrowser for help on using the repository browser.