Ignore:
Timestamp:
25/01/11 17:12:39 (9 years ago)
Author:
pjkersha
Message:

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

  • fixed yadis template syntax
  • updating securedapp template.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/NDGSecurity/python/ndg_security_server/ndg/security/server/paster_templates/Makefile

    r7843 r7845  
    2626USERDB_FILEPATH = ${TEST_CONFIG_SRC_DIR}${USERDB_FILENAME} 
    2727 
    28  
    2928# OpenID Provider Specific Settings 
    3029OP_SERVER_YADIS_TMPL_SRC_FILENAME = serveryadis.xml 
    3130OP_YADIS_TMPL_SRC_FILENAME = yadis.xml 
     31 
    3232 
    3333# Generic Services Template Settings 
     
    4242SERVICE_PKI_DEST_DIR = ${SERVICE_DEST_DIR}pki/ 
    4343SERVICE_CA_DEST_DIR = ${SERVICE_PKI_DEST_DIR}ca/ 
     44SERVICE_LOG_DEST_DIR = ${SERVICE_DEST_DIR}log/ 
     45SERVICE_LOG_FILEPATH = ${SERVICE_LOG_DEST_DIR}service.log 
    4446SERVICE_SURPLUS_FILES = README __init__.* attributeinterface.* securedapp.* \ 
    45         securityservicesapp.* request-filter.xml pep_result_handler *.pyc \ 
    46         authn/* openidprovider/associations/  openidprovider/beaker/ \ 
     47        request-filter.xml pep_result_handler *.pyc authn/* \ 
     48        openidprovider/associations/  openidprovider/beaker/ \ 
    4749        openidprovider/README openidprovider/nonces/ openidprovider/temp/ \ 
    4850        openidrelyparty/store/ openidrelyparty/__init__.* \ 
    49         pip-session-cache/* 
     51        pip-session-cache/* log 
    5052SERVICE_OP_DIRNAME = openidprovider/ 
    5153SERVICE_OP_DIR = ${SERVICE_DEST_DIR}${SERVICE_OP_DIRNAME} 
     
    6870                rm -rf ${SERVICE_DEST_DIR}$$i ; \ 
    6971        done ; 
     72        # Make an empty log file so that log directory is included in egg 
     73        @-echo Make log directory ... 
     74        mkdir ${SERVICE_DEST_DIR}log 
     75        touch ${SERVICE_LOG_FILEPATH} 
    7076        @-echo Making substitutions for ini file template variables ... 
    7177        sed -e s/'portNum = .*'/'portNum = %%\{portNumber}'/ \ 
     
    8692        rm -f ${SERVICE_INI_FILEPATH_TMP} 
    8793        @-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>'/'%%\{serveryadisExtraXrdEntries}\n    <XRD>'/ \ 
     94        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \ 
     95        -e s/'<\/XRD>'/'    %%\{serveryadisExtraServiceEndpoints}\n    <\/XRD>'/ \ 
    9196                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \ 
    9297                ${SERVICE_OP_SERVER_YADIS_TMPL_FILEPATH} 
    9398        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>'/'%%\{yadisExtraXrdEntries}\n    <XRD>'/ \ 
    96                 ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP} > \ 
    97                 ${SERVICE_OP_YADIS_TMPL_FILEPATH} 
     99        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \ 
     100        -e s/'<\/XRD>'/'    %%\{yadisExtraServiceEndpoints}\n    <\/XRD>'/ \ 
     101                ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP} > ${SERVICE_OP_YADIS_TMPL_FILEPATH} 
    98102        rm -f ${SERVICE_OP_YADIS_TMPL_FILEPATH_TMP} 
    99103        @-echo 
     
    113117        rm -rf ${SERVICE_DEST_DIR} 
    114118 
     119 
     120# Secured Application Template Settings 
     121SECUREDAPP_SRC_DIRNAME = full_system/ 
     122SECUREDAPP_DEST_DIRNAME = securedapp/ 
     123SECUREDAPP_SRC_DIR = ${INTEGRATION_TEST_DIR}${SECUREDAPP_SRC_DIRNAME} 
     124SECUREDAPP_DEST_DIR = ${DEST_DIR}${SECUREDAPP_DEST_DIRNAME} 
     125SECUREDAPP_SRC_INI_FILENAME = securedapp.ini 
     126SECUREDAPP_SRC_INI_FILEPATH = ${SECUREDAPP_SRC_DIR}${SECUREDAPP_SRC_INI_FILENAME} 
     127SECUREDAPP_INI_FILEPATH_TMP = ${SECUREDAPP_DEST_DIR}${SECUREDAPP_SRC_INI_FILENAME} 
     128SECUREDAPP_INI_TMPL_FILEPATH = ${SECUREDAPP_DEST_DIR}service.ini_tmpl 
     129SECUREDAPP_PKI_DEST_DIR = ${SECUREDAPP_DEST_DIR}pki/ 
     130SECUREDAPP_CA_DEST_DIR = ${SECUREDAPP_PKI_DEST_DIR}ca/ 
     131SECUREDAPP_LOG_DEST_DIR = ${SECUREDAPP_DEST_DIR}log/ 
     132SECUREDAPP_LOG_FILEPATH = ${SECUREDAPP_LOG_DEST_DIR}service.log 
     133SECUREDAPP_SURPLUS_FILES = README __init__.* attributeinterface.* \ 
     134        securityservicesapp.* *.pyc authn/* openidprovider/ openidrelyparty/store/ \ 
     135        openidrelyparty/__init__.* pip-session-cache/ log/ policy.xml 
     136SECUREDAPP_REQUEST_FILTER_FILENAME = request-filter.xml 
     137SECUREDAPP_REQUEST_FILTER_TMPL_FILENAME = ${SECUREDAPP_REQUEST_FILTER_FILENAME}_tmpl 
     138SECUREDAPP_REQUEST_FILTER_FILEPATH = ${SECUREDAPP_SRC_DIR}${SECUREDAPP_REQUEST_FILTER_FILENAME} 
     139SECUREDAPP_REQUEST_FILTER_TMPL_FILEPATH = ${SECUREDAPP_DEST_DIR}${SECUREDAPP_REQUEST_FILTER_TMPL_FILENAME} 
     140         
     141securedapp_tmpl: ${SECUREDAPP_SRC_DIR} 
     142        @-echo Preparing Secured Application template ... 
     143        @-echo 
     144        @-echo Copying configuration files ... 
     145        @-cp -r ${SECUREDAPP_SRC_DIR} ${SECUREDAPP_DEST_DIR} 2> /dev/null 
     146        @-echo Clear out SVN directories ... 
     147        @-find ${SECUREDAPP_DEST_DIR} -name ".svn" -print | xargs /bin/rm -rf 
     148        @-echo Remove unneeded files ... 
     149        for i in ${SECUREDAPP_SURPLUS_FILES} ; do \ 
     150                rm -rf ${SECUREDAPP_DEST_DIR}$$i ; \ 
     151        done ; 
     152        # Make an empty log file so that log directory is included in egg 
     153        @-echo Make log directory ... 
     154        mkdir ${SECUREDAPP_LOG_DEST_DIR} 
     155        touch ${SECUREDAPP_LOG_FILEPATH} 
     156        @-echo Making substitutions for ini file template variables ... 
     157        sed -e s/'port = .*'/'port = %%\{portNumber}'/ \ 
     158        -e s/'# Revision:.*'//g \ 
     159        -e s/'authN.redirectURI = .*'/'authN.redirectURI = %%{authnRedirectURI}'/ \ 
     160        -e s/'pep.authzServiceURI = .*'/'pep.authzServiceURI = %%{authzServiceURI}'/ \ 
     161    -e s/'pep\.authzDecisionQuery\.issuerName = .*'/'pep\.authzDecisionQuery\.issuerName = %%\{authzDecisionQueryIssuerName}'/ \ 
     162    -e s/'pep\.authzDecisionQuery\.issuerFormat = .*'/'pep\.authzDecisionQuery\.issuerFormat = %%\{authzDecisionQueryIssuerFormat}'/ \ 
     163        -e s/'authkit\.cookie\.secret =.*'/'authkit\.cookie\.secret = %%\{authkitCookieSecret}'/ \ 
     164        -e s/'beaker\.session\.secret =.*'/'beaker\.session\.secret = %%\{beakerSessionCookieSecret}'/ \ 
     165        -e s/'authkit.openid.session.secret = .*'/'authkit.openid.session.secret = %%\{openidRelyingPartyCookieSecret}'/ \ 
     166        -e s/'testConfigDir = .*'// \ 
     167        -e s/testConfigDir/here/g \ 
     168        -e s/\(os\.path\.join\(\'%\(here\)s\'/\(os.path.join\(\'%%\{outputDir}\'/ \ 
     169                ${SECUREDAPP_INI_FILEPATH_TMP} > ${SECUREDAPP_INI_TMPL_FILEPATH} 
     170        rm -f ${SECUREDAPP_INI_FILEPATH_TMP} 
     171        @-echo "Make template for ${SECUREDAPP_REQUEST_FILTER_FILENAME} ..." 
     172        sed -r -e s/'http:\/\/localhost:7080'/'%%\{baseURI}'/ \ 
     173                ${SECUREDAPP_REQUEST_FILTER_FILEPATH} > ${SECUREDAPP_REQUEST_FILTER_TMPL_FILEPATH} 
     174        @-echo 
     175        @-echo Create PKI directory and copying files ... 
     176        -mkdir ${SECUREDAPP_PKI_DEST_DIR} 
     177        cp ${SERVER_CERT_SRC_FILEPATH} ${SECUREDAPP_PKI_DEST_DIR} 
     178        cp ${SERVER_KEY_SRC_FILEPATH} ${SECUREDAPP_PKI_DEST_DIR} 
     179        -mkdir ${SECUREDAPP_CA_DEST_DIR} 
     180        cp ${CA_SRC_DIR}* ${SECUREDAPP_CA_DEST_DIR} 
     181        @-echo 
     182        @-echo Done. 
     183         
     184securedapp_tmpl_clean: 
     185        @-echo Clearing Secured App template ... 
     186        rm -rf ${SECUREDAPP_DEST_DIR} 
    115187 
    116188# Authorisation Service Template Settings 
     
    125197AUTHZ_SERVICE_PKI_DEST_DIR = ${AUTHZ_SERVICE_DEST_DIR}pki/ 
    126198AUTHZ_SERVICE_CA_DEST_DIR = ${AUTHZ_SERVICE_PKI_DEST_DIR}ca/ 
     199AUTHZ_SERVICE_LOG_DEST_DIR = ${AUTHZ_SERVICE_DEST_DIR}log/ 
     200AUTHZ_SERVICE_LOG_FILEPATH = ${AUTHZ_SERVICE_LOG_DEST_DIR}service.log 
    127201 
    128202 
     
    146220        rm -f ${AUTHZ_SERVICE_INI_FILEPATH_TMP} 
    147221        @-echo 
     222        # Make an empty log file so that log directory is included in egg 
    148223        @-echo Make log directory ... 
    149         -mkdir ${AUTHZ_SERVICE_DEST_DIR}log 
     224        mkdir ${AUTHZ_SERVICE_DEST_DIR}log 
     225        touch ${AUTHZ_SERVICE_LOG_FILEPATH} 
    150226        @-echo Create PKI directory and copying files ... 
    151227        mkdir -p ${AUTHZ_SERVICE_CA_DEST_DIR} 
     
    174250ATTR_SERVICE_PKI_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}pki/ 
    175251ATTR_SERVICE_CA_DEST_DIR = ${ATTR_SERVICE_PKI_DEST_DIR}ca/ 
     252ATTR_SERVICE_LOG_DEST_DIR = ${ATTR_SERVICE_DEST_DIR}log/ 
     253ATTR_SERVICE_LOG_FILEPATH = ${ATTR_SERVICE_LOG_DEST_DIR}service.log 
    176254 
    177255 
     
    201279        -mkdir ${ATTR_SERVICE_CA_DEST_DIR} 
    202280        cp ${CA_SRC_DIR}* ${ATTR_SERVICE_CA_DEST_DIR} 
     281        # Make an empty log file so that log directory is included in egg 
    203282        @-echo Make log directory ... 
    204         -mkdir ${ATTR_SERVICE_DEST_DIR}log 
     283        mkdir ${ATTR_SERVICE_DEST_DIR}log 
     284        touch ${ATTR_SERVICE_LOG_FILEPATH} 
    205285        @-echo Copying test SQLite user database ... 
    206286        cp ${USERDB_FILEPATH} ${ATTR_SERVICE_DEST_DIR} 
     
    230310OP_YADIS_TMPL_FILEPATH_TMP = ${OP_TMPL_DIR}yadis.xml 
    231311OP_YADIS_TMPL_FILEPATH = ${OP_YADIS_TMPL_FILEPATH_TMP}_tmpl 
     312OP_LOG_DEST_DIR = ${OP_DEST_DIR}log/ 
     313OP_LOG_FILEPATH = ${OP_LOG_DEST_DIR}service.log 
    232314 
    233315 
     
    237319        @-echo Copying templates, CSS and graphics and ini file ... 
    238320        mkdir ${OP_DEST_DIR} 
    239         mkdir ${OP_DEST_DIR}log 
     321        mkdir ${OP_LOG_DEST_DIR} 
     322        touch ${OP_LOG_FILEPATH} 
    240323        @-echo Copying files ... 
    241324        for i in ${OP_CONFIG_FILES} ; do \ 
     
    253336        rm -f ${OP_INI_FILEPATH_TMP} 
    254337        @-echo Making substitutions for Yadis templates ... 
    255         sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \ 
    256         -e s/'<XRD>'/'%%\{serveryadisExtraXrdEntries}\n    <XRD>'/ \ 
    257                 ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > \ 
    258                 ${OP_SERVER_YADIS_TMPL_FILEPATH} 
     338        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \ 
     339        -e s/'<\/XRD>'/'    %%\{serveryadisExtraServiceEndpoints}\n    <\/XRD>'/ \ 
     340                ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP} > ${OP_SERVER_YADIS_TMPL_FILEPATH} 
    259341        rm -f ${OP_SERVER_YADIS_TMPL_FILEPATH_TMP} 
    260         sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<XRD>'/d \ 
    261         -e s/'<XRD>'/'%%\{yadisExtraXrdEntries}\n    <XRD>'/ \ 
    262                 ${OP_YADIS_TMPL_FILEPATH_TMP} > \ 
    263                 ${OP_YADIS_TMPL_FILEPATH} 
     342        sed -r -e /'<Service priority=\"(1|19|30|20)\">'/,/'<\/Service>'/d \ 
     343        -e s/'<\/XRD>'/'    %%\{yadisExtraServiceEndpoints}\n    <\/XRD>'/ \ 
     344                ${OP_YADIS_TMPL_FILEPATH_TMP} > ${OP_YADIS_TMPL_FILEPATH} 
    264345        rm -f ${OP_YADIS_TMPL_FILEPATH_TMP} 
    265346        @-echo 
Note: See TracChangeset for help on using the changeset viewer.