Early draft of upgrade script, handles everything but Applications section.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 19 Feb 2008 05:30:55 +0000 (05:30 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Tue, 19 Feb 2008 05:30:55 +0000 (05:30 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2739 cb58f699-b61c-0410-a6fe-9272a202ed29

configs/upgrade.xsl [new file with mode: 0644]

diff --git a/configs/upgrade.xsl b/configs/upgrade.xsl
new file mode 100644 (file)
index 0000000..bdd5b09
--- /dev/null
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
+    xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
+    xmlns:oldconf="urn:mace:shibboleth:target:config:1.0"
+    xmlns:cred="urn:mace:shibboleth:credentials:1.0"
+    xmlns="urn:mace:shibboleth:2.0:native:sp:config"
+    xmlns:saml1="urn:oasis:names:tc:SAML:1.0:assertion"
+    xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
+    xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
+    exclude-result-prefixes="oldconf cred saml1">
+
+    <!-- Add a comment to the start of the output file. -->
+    <xsl:template match="/">
+        <xsl:comment>
+            <xsl:text>&#160;Generated by upgrade utility: check carefully before deploying.&#160;</xsl:text>
+        </xsl:comment>
+        <xsl:apply-templates/>
+    </xsl:template>
+    
+    <!--Force UTF-8 encoding for the output.-->
+    <xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>
+
+    <xsl:template match="oldconf:SPConfig">
+        <SPConfig logger="{@logger}" clockSkew="{@clockSkew}">
+            <xsl:text>&#10;</xsl:text>
+            <xsl:apply-templates select="oldconf:Global"/>
+            <xsl:text>&#10;</xsl:text>
+            <xsl:apply-templates select="oldconf:Local"/>
+            <xsl:text>&#10;</xsl:text>
+            <xsl:apply-templates select="oldconf:Global/oldconf:UnixListener"/>
+            <xsl:apply-templates select="oldconf:Global/oldconf:TCPListener"/>
+            <xsl:text>&#10;</xsl:text>
+   &#160;<xsl:comment>
+           <xsl:text>&#160;This set of components stores sessions and other persistent data in daemon memory.&#160;</xsl:text>
+       </xsl:comment>
+   &#160;<StorageService type="Memory" id="mem" cleanupInterval="900"/>
+   &#160;<SessionCache type="StorageService" StorageService="mem" cacheTimeout="{oldconf:Global/oldconf:MemorySessionCache/@cacheTimeout}" inprocTimeout="900" cleanupInterval="900"/>
+   &#160;<ReplayCache StorageService="mem"/>
+   &#160;<ArtifactMap artifactTTL="180"/>
+           <xsl:text>&#10;</xsl:text>
+   &#160;<xsl:comment>
+           <xsl:text>&#160;This set of components stores sessions and other persistent data in an ODBC database.&#160;</xsl:text>
+       </xsl:comment>
+   &#160;<xsl:comment>
+            <xsl:text>
+   &#160;&lt;StorageService type="ODBC" id="db" cleanupInterval="900"&gt;
+       &#160;&lt;ConnectionString&gt;DRIVER=drivername;SERVER=dbserver;UID=shibboleth;PWD=password;DATABASE=shibboleth;APP=Shibboleth&lt;/ConnectionString&gt;
+   &#160;&lt;/StorageService&gt;
+   &#160;&lt;SessionCache type="StorageService" StorageService="db" cacheTimeout="3600" inprocTimeout="900" cleanupInterval="900"/&gt;
+   &#160;&lt;ReplayCache StorageService="db"/&gt;
+   &#160;&lt;ArtifactMap StorageService="db" artifactTTL="180"/&gt;
+    </xsl:text>
+       </xsl:comment>
+            <xsl:text>&#10;</xsl:text>
+            <xsl:apply-templates select="oldconf:Local/oldconf:RequestMapProvider"/>
+            <xsl:text>&#10;</xsl:text>
+            <xsl:apply-templates select="oldconf:Applications"/>
+        </SPConfig>
+    </xsl:template>
+    
+    <!-- Turn <Global> into <OutOfProcess> with the ODBC extension commented out. -->
+    <xsl:template match="oldconf:Global">
+   &#160;<OutOfProcess logger="{@logger}">
+       &#160;<xsl:comment>
+               <xsl:text>
+       &#160;&lt;Extensions&gt;
+           &#160;&lt;Library path="odbc-store.so" fatal="true"/&gt;
+        &lt;/Extensions&gt;
+        </xsl:text>
+        </xsl:comment>
+   &#160;</OutOfProcess>
+    </xsl:template>
+
+    <xsl:template match="oldconf:Local">
+   &#160;<InProcess logger="{@logger}">
+            
+   &#160;</InProcess>
+    </xsl:template>
+
+    <xsl:template match="oldconf:Global/oldconf:UnixListener">
+   &#160;<UnixListener address="shibd.sock"/>
+    </xsl:template>
+
+    <xsl:template match="oldconf:Global/oldconf:TCPListener">
+   &#160;<TCPListener address="{@address}" port="{@port}" acl="{@acl}"/>
+    </xsl:template>
+
+    <!-- Transplant old RequestMap into the new namespace, but just copy all the settings. -->
+    <xsl:template match="oldconf:RequestMapProvider">
+   &#160;<RequestMapper type="Native">
+       <xsl:apply-templates select="oldconf:RequestMap"/>
+   &#160;</RequestMapper>
+    </xsl:template>
+    <xsl:template match="oldconf:RequestMap">
+       &#160;<RequestMap>
+            <xsl:apply-templates select="@*"/>
+            <xsl:for-each select="oldconf:Host">
+           &#160;<Host>
+                <xsl:apply-templates select="@*"/>
+                <xsl:apply-templates select="oldconf:Path"/>
+           &#160;</Host>
+            </xsl:for-each>
+       &#160;</RequestMap>
+    </xsl:template>
+    <xsl:template match="oldconf:Path">
+               &#160;<Path>
+                        <xsl:apply-templates select="@*"/>
+                        <xsl:apply-templates select="oldconf:Path"/>
+               &#160;</Path>
+    </xsl:template>
+
+    <xsl:template match="oldconf:Applications">
+   &#160;<ApplicationDefaults>
+        <!-- Step up and pull in credentials from the top level. -->
+        <xsl:apply-templates select="../oldconf:CredentialsProvider"/>
+   &#160;</ApplicationDefaults>
+    </xsl:template>
+    
+    <!-- Map legacy <FileResolver> elements to CredentialResolver plugins. -->
+    <xsl:template match="oldconf:CredentialsProvider">
+        <xsl:apply-templates select="//cred:FileResolver"/>
+    </xsl:template>
+    <xsl:template match="cred:FileResolver">
+       &#160;<CredentialResolver type="File" key="{cred:Key/cred:Path/text()}" certificate="{cred:Certificate/cred:Path/text()}" keyName="{@Id}"/>
+    </xsl:template>
+
+    <xsl:template match="@*">
+        <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
+    </xsl:template>
+
+    <xsl:template match="text()"/>
+
+</xsl:stylesheet>