source: TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/paster_templates/Makefile @ 7817

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/paster_templates/Makefile@7817
Revision 7817, 11.4 KB checked in by pjkersha, 9 years ago (diff)

Incomplete - task 16: NDG Security 2.x.x - incl. updated Paster templates

  • major progress on independent OpenID Provider template. Requires some fixes to Yadis templates to complete.
Line 
1#
2# Makefile to copy ndg.security.test.integration configurations and make them
3# into templates.  This is intended for use preparing a distribution, not
4# for post-installation use.
5#
6# @author P J Kershaw 16/11/10
7#
8# @copyright: (C) 2010 STFC
9#
10# @license: BSD - LICENSE file
11#
12# $Id$
13
14# Settings for all Templates
15ROOT_FILEPATH = ../../../../../
16DEST_DIR = ./
17TEST_DIR = ${ROOT_FILEPATH}ndg_security_test/ndg/security/test/
18TEST_CONFIG_SRC_DIR = ${TEST_DIR}config/
19PKI_SRC_DIR = ${TEST_CONFIG_SRC_DIR}pki/
20CA_SRC_DIR = ${PKI_SRC_DIR}ca/
21SERVER_CERT_SRC_FILEPATH = ${PKI_SRC_DIR}localhost.crt
22SERVER_KEY_SRC_FILEPATH = ${PKI_SRC_DIR}localhost.key
23INTEGRATION_TEST_DIR = ${TEST_DIR}integration/
24
25USERDB_FILENAME = user.db
26USERDB_FILEPATH = ${TEST_CONFIG_SRC_DIR}${USERDB_FILENAME}
27
28
29# OpenID Provider Specific Settings
30OP_SERVER_YADIS_TMPL_SRC_FILENAME = serveryadis.xml
31OP_YADIS_TMPL_SRC_FILENAME = yadis.xml
32
33# Generic Services Template Settings
34SERVICE_SRC_DIRNAME = full_system/
35SERVICE_DEST_DIRNAME = services/
36SERVICE_SRC_DIR = ${INTEGRATION_TEST_DIR}${SERVICE_SRC_DIRNAME}
37SERVICE_DEST_DIR = ${DEST_DIR}${SERVICE_DEST_DIRNAME}
38SERVICE_SRC_INI_FILENAME = securityservices.ini
39SERVICE_SRC_INI_FILEPATH = ${SERVICE_SRC_DIR}${SERVICE_SRC_INI_FILENAME}
40SERVICE_INI_FILEPATH_TMP = ${SERVICE_DEST_DIR}${SERVICE_SRC_INI_FILENAME}
41SERVICE_INI_TMPL_FILEPATH = ${SERVICE_DEST_DIR}service.ini_tmpl
42SERVICE_PKI_DEST_DIR = ${SERVICE_DEST_DIR}pki/
43SERVICE_CA_DEST_DIR = ${SERVICE_PKI_DEST_DIR}ca/
44SERVICE_SURPLUS_FILES = README __init__.* attributeinterface.* securedapp.* \
45        securityservicesapp.* request-filter.xml pep_result_handler *.pyc \
46        authn/* openidprovider/associations/  openidprovider/beaker/ \
47        openidprovider/README openidprovider/nonces/ openidprovider/temp/ \
48        openidrelyparty/store/ openidrelyparty/__init__.* \
49        pip-session-cache/*
50SERVICE_OP_DIRNAME = openidprovider/
51SERVICE_OP_DIR = ${SERVICE_DEST_DIR}${SERVICE_OP_DIRNAME}
52SERVICE_OP_TMPL_DIR = ${SERVICE_OP_DIR}templates/
53SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP = ${SERVICE_OP_TMPL_DIR}serveryadis.xml
54SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH = ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP}_tmpl
55SERVICE_OP_YADIS_TMPL_FILEPATH_TMP = ${SERVICE_OP_TMPL_DIR}yadis.xml
56SERVICE_OP_YADIS_TMPL_FILEPATH = ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP}_tmpl
57
58       
59service_tmpl: ${SERVICE_SRC_DIR}
60        @-echo Preparing Generic Services template ...
61        @-echo
62        @-echo Copying configuration files ...
63        @-cp -r ${SERVICE_SRC_DIR} ${SERVICE_DEST_DIR} 2> /dev/null
64        @-echo Clear out SVN directories ...
65        @-find ${SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
66        @-echo Remove unneeded files ...
67        for i in ${SERVICE_SURPLUS_FILES} ; do \
68                rm -rf ${SERVICE_DEST_DIR}$$i ; \
69        done ;
70        @-echo Making substitutions for ini file template variables ...
71        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
72        -e s/'baseURI =.*'/'baseURI = %%\{baseURI}'/ \
73        -e s/'saml\.soapbinding\.mountPath.*'/'saml.soapbinding.mountPath = %%\{attributeServiceMountPoint\}'/ \
74        -e s/'saml\.mountPath.*'/'saml.mountPath = %%\{authorisationServiceMountPoint\}'/ \
75        -e s/'saml\.soapbinding\.issuerName =.*'/'saml.soapbinding.issuerName = %%\{attributeServiceIssuerName}'/ \
76        -e s/'saml\.issuerName =.*'/'samlIssuerName = %%\{authorisationServiceIssuerName}'/ \
77        -e s/'saml\.soapbinding\.issuerFormat =.*'/'saml.soapbinding.issuerFormat = %%\{attributeServiceIssuerFormat}'/ \
78        -e s/'saml\.issuerFormat =.*'/'saml.issuerFormat = %%\{authorisationServiceIssuerFormat}'/ \
79        -e s/'authkitCookieSecret =.*'/'authkitCookieSecret = %%\{authkitCookieSecret}'/ \
80        -e s/'beakerSessionCookieSecret =.*'/'beakerSessionCookieSecret = %%\{beakerSessionCookieSecret}'/ \
81        -e s/'authkit.openid.session.secret = .*'/'authkit.openid.session.secret = %%\{openidRelyingPartyCookieSecret}'/ \
82        -e s/'testConfigDir = .*'// \
83        -e s/testConfigDir/here/g \
84        -e s/'# Revision:.*'//g \
85                ${SERVICE_INI_FILEPATH_TMP} > ${SERVICE_INI_TMPL_FILEPATH}
86        rm -f ${SERVICE_INI_FILEPATH_TMP}
87        @-echo Making substitutions for OpenID Provider Yadis templates ...
88        @-echo Removing unneeded XRD entries ...
89        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
90        -e s/'<XRD>'/'%%\{extraXrdEntries}\n    <XRD>'/ \
91                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \
92                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH}
93        rm -f ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP}
94        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
95        -e s/'<XRD>'/'%%\{extraXrdEntries}\n    <XRD>'/ \
96                ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP} > \
97                ${SERVICE_OP_YADIS_TMPL_FILEPATH}
98        rm -f ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP}
99        @-echo
100        @-echo Create PKI directory and copying files ...
101        -mkdir ${SERVICE_PKI_DEST_DIR}
102        cp ${SERVER_CERT_SRC_FILEPATH} ${SERVICE_PKI_DEST_DIR}
103        cp ${SERVER_KEY_SRC_FILEPATH} ${SERVICE_PKI_DEST_DIR}
104        -mkdir ${SERVICE_CA_DEST_DIR}
105        cp ${CA_SRC_DIR}* ${SERVICE_CA_DEST_DIR}
106        @-echo Copying test SQLite user database ...
107        cp ${USERDB_FILEPATH} ${SERVICE_DEST_DIR}
108        @-echo
109        @-echo Done.
110       
111service_tmpl_clean:
112        @-echo Clearing Services template ...
113        rm -rf ${SERVICE_DEST_DIR}
114
115
116# Authorisation Service Template Settings
117AUTHZ_SERVICE_DIRNAME = authorisationservice/
118AUTHZ_SERVICE_SRC_DIR = ${TEST_CONFIG_SRC_DIR}${AUTHZ_SERVICE_DIRNAME}
119AUTHZ_SERVICE_DEST_DIR = ${DEST_DIR}${AUTHZ_SERVICE_DIRNAME}
120AUTHZ_SERVICE_INI_FILENAME = authorisation-service.ini
121AUTHZ_SERVICE_INI_FILEPATH_TMP = ${AUTHZ_SERVICE_DEST_DIR}/${AUTHZ_SERVICE_INI_FILENAME}
122AUTHZ_SERVICE_INI_TMPL_FILEPATH = ${AUTHZ_SERVICE_INI_FILEPATH_TMP}_tmpl
123AUTHZ_SERVICE_PKI_DEST_DIR = ${AUTHZ_SERVICE_DEST_DIR}pki/
124AUTHZ_SERVICE_CA_DEST_DIR = ${AUTHZ_SERVICE_PKI_DEST_DIR}ca/
125
126
127authorisation_service_tmpl:
128        @-echo Preparing Authorisation Service template ...
129        @-echo
130        @-echo Copying test ini file and other configuration files ...
131        mkdir ${AUTHZ_SERVICE_DEST_DIR}
132        cp -r ${AUTHZ_SERVICE_SRC_DIR}* ${AUTHZ_SERVICE_DEST_DIR}
133        @-echo Making substitutions for template variables ...
134        sed -e s/'# Description:.*'/'# Description: Paster template'/ \
135        -e s/'saml\.mountPath.*'/'saml.mountPath = %%\{mountPoint\}'/ \
136        -e s/'samlIssuerName =.*'/'samlIssuerName = %%\{issuerName}'/ \
137        -e s/'samlIssuerFormat =.*'/'samlIssuerFormat = %%\{issuerFormat}'/ \
138        -e s/'testConfigDir = \.\.\/\.\.\/\.\.\/config'// \
139        -e s/testConfigDir/here/g \
140        ${AUTHZ_SERVICE_INI_FILEPATH_TMP} > ${AUTHZ_SERVICE_INI_TMPL_FILEPATH}
141        rm -f ${AUTHZ_SERVICE_INI_FILEPATH_TMP}
142        @-echo
143        @-echo Create PKI directory and copying files ...
144        cp ${SERVER_CERT_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
145        cp ${SERVER_KEY_SRC_FILEPATH} ${AUTHZ_SERVICE_PKI_DEST_DIR}
146        cp ${CA_SRC_DIR}* ${AUTHZ_SERVICE_CA_DEST_DIR}
147        @-echo Clear out SVN directories ...
148        @-find ${AUTHZ_SERVICE_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
149        @-echo
150        @-echo Done.
151       
152authorisation_service_tmpl_clean:
153        @-echo Clearing Authorisation Service template ...
154        rm -rf ${AUTHZ_SERVICE_DEST_DIR}
155
156
157# Attribute Service Template
158ATTR_SERVICE_DIRNAME = attributeservice/
159ATTR_SERVICE_SRC_DIR = ${TEST_CONFIG_SRC_DIR}attributeauthority/sitea/
160ATTR_SERVICE_SRC_INI_FILENAME = site-a.ini
161ATTR_SERVICE_SRC_INI_FILEPATH = ${ATTR_SERVICE_SRC_DIR}${ATTR_SERVICE_SRC_INI_FILENAME}
162ATTR_SERVICE_DEST_DIR = ${DEST_DIR}${ATTR_SERVICE_DIRNAME}
163ATTR_SERVICE_INI_FILENAME = attribute-service.ini
164ATTR_SERVICE_INI_FILEPATH_TMP = ${ATTR_SERVICE_DEST_DIR}${ATTR_SERVICE_INI_FILENAME}
165ATTR_SERVICE_INI_TMPL_FILEPATH = ${ATTR_SERVICE_INI_FILEPATH_TMP}_tmpl
166ATTR_SERVICE_PKI_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}pki/
167ATTR_SERVICE_CA_DEST_DIR = ${ATTR_SERVICE_PKI_DEST_DIR}ca/
168
169
170attribute_service_tmpl:
171        @-echo Preparing Attribute Service template ...
172        @-echo
173        @-echo Copying test ini file ...
174        -mkdir ${ATTR_SERVICE_DEST_DIR}
175        cp -r ${ATTR_SERVICE_SRC_INI_FILEPATH} ${ATTR_SERVICE_INI_FILEPATH_TMP}
176        @-echo Making substitutions for template variables ...
177        sed -e s/'# Description:.*'/'# Description: Paster template for SAML Attribute Service'/ \
178        -e s/'saml\.soapbinding\.mountPath.*'/'saml.soapbinding.mountPath = %%\{mountPoint\}'/ \
179        -e s/'saml\.soapbinding\.issuerName.*'/'saml.soapbinding.issuerName = %%\{issuerName}'/ \
180        -e s/'saml\.soapbinding\.issuerFormat.*'/'saml\.soapbinding\.issuerFormat = %%\{issuerFormat}'/ \
181        -e s/'testConfigDir = \.\.\/\.\.\/\.\.\/config'// \
182        -e s/testConfigDir/here/g \
183        ${ATTR_SERVICE_INI_FILEPATH_TMP} > ${ATTR_SERVICE_INI_TMPL_FILEPATH}
184        rm -f ${ATTR_SERVICE_INI_FILEPATH_TMP}
185        @-echo
186        @-echo Create PKI directory and copying files ...
187        -mkdir ${ATTR_SERVICE_PKI_DEST_DIR}
188        cp ${SERVER_CERT_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
189        cp ${SERVER_KEY_SRC_FILEPATH} ${ATTR_SERVICE_PKI_DEST_DIR}
190        -mkdir ${ATTR_SERVICE_CA_DEST_DIR}
191        cp ${CA_SRC_DIR}* ${ATTR_SERVICE_CA_DEST_DIR}
192        @-echo Copying test SQLite user database ...
193        cp ${USERDB_FILEPATH} ${ATTR_SERVICE_DEST_DIR}
194        @-echo
195        @-echo Done.
196       
197attribute_service_tmpl_clean:
198        @-echo Clearing Attribute Service template ...
199        rm -rf ${ATTR_SERVICE_DEST_DIR}
200       
201
202# Settings to create OpenID Provider template
203OP_DIRNAME = openidprovider/
204OP_SRC_DIR = ${INTEGRATION_TEST_DIR}${OP_DIRNAME}
205OP_DEST_DIR = ${DEST_DIR}${OP_DIRNAME}
206OP_INI_FILENAME = service.ini
207OP_INI_FILEPATH_TMP = ${OP_DEST_DIR}openidprovider.ini
208OP_INI_TMPL_FILEPATH = ${OP_DEST_DIR}${OP_INI_FILENAME}_tmpl
209OP_PKI_DEST_DIR = ${OP_DEST_DIR}pki/
210OP_CA_DEST_DIR = ${OP_PKI_DEST_DIR}ca/
211OP_CONFIG_FILES = templates openidprovider.ini public
212OP_TMPL_DIR = ${OP_DEST_DIR}templates/
213OP_SERVER_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}serveryadis.xml
214OP_SERVER_YADIS_TMPL_FILEPATH = ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}_tmpl
215OP_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}yadis.xml
216OP_YADIS_TMPL_FILEPATH = ${OP_YADIS_TMPL_FILEPATH_TMP}_tmpl
217
218
219openidprovider_tmpl:
220        @-echo Preparing OpenID Provider template ...
221        @-echo
222        @-echo Copying templates, CSS and graphics and ini file ...
223        mkdir ${OP_DEST_DIR}
224        mkdir ${OP_DEST_DIR}log
225        @-echo Copying files ...
226        for i in ${OP_CONFIG_FILES} ; do \
227                cp -r ${OP_SRC_DIR}$$i ${OP_DEST_DIR}; \
228        done ;
229        @-echo Making substitutions for template variables ...
230        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \
231        -e s/'baseURI =.*'/'baseURI = %%\{baseURI}'/ \
232        -e s/'testConfigDir = %(here)s\/\.\.\/\.\.\/config'// \
233        -e s/testConfigDir/here/g \
234        -e s/'# Revision:.*'// \
235        -e s/'beaker.session.secret =.*'/'beaker.session.secret = %%\{beakerSessionCookieSecret}'/ \
236        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\'/ \
237        ${OP_INI_FILEPATH_TMP} > ${OP_INI_TMPL_FILEPATH}
238        rm -f ${OP_INI_FILEPATH_TMP}
239        @-echo Making substitutions for Yadis templates ...
240        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
241        -e s/'<XRD>'/'%%\{extraXrdEntries}\n    <XRD>'/ \
242                ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \
243                ${OP_SERVER_YADIS_TMPL_FILEPATH}
244        rm -f ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP}
245        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \
246        -e s/'<XRD>'/'%%\{extraXrdEntries}\n    <XRD>'/ \
247                ${OP_YADIS_TMPL_FILEPATH_TMP} > \
248                ${OP_YADIS_TMPL_FILEPATH}
249        rm -f ${OP_YADIS_TMPL_FILEPATH_TMP}
250        @-echo
251        @-echo
252        @-echo Copying test SQLite user database ...
253        cp ${USERDB_FILEPATH} ${OP_DEST_DIR}
254        @-echo
255        @-echo Create PKI directory and copying files ...
256        -mkdir ${OP_PKI_DEST_DIR}
257        cp ${SERVER_CERT_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
258        cp ${SERVER_KEY_SRC_FILEPATH} ${OP_PKI_DEST_DIR}
259        -mkdir ${OP_CA_DEST_DIR}
260        cp ${CA_SRC_DIR}* ${OP_CA_DEST_DIR}
261        @-echo Clear out SVN directories ...
262        @-find ${OP_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf
263        @-echo
264        @-echo Done.
265       
266openidprovider_tmpl_clean:
267        @-echo Clearing OpenID Provider template ...
268        rm -rf ${OP_DEST_DIR}
269
270       
271clean: service_tmpl_clean authorisation_service_tmpl_clean \
272                attribute_service_tmpl_clean openidprovider_tmpl_clean
273
Note: See TracBrowser for help on using the repository browser.