Skip to content

Commit

Permalink
Shunt the characteristics of the current test aggregate over to the m…
Browse files Browse the repository at this point in the history
…ain production aggregate, the WAYF aggregate derived from that and the export aggregate.
  • Loading branch information
iay committed Jul 30, 2010
1 parent 0114808 commit 0bc2383
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 34 deletions.
17 changes: 11 additions & 6 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,19 @@
<echo>Generating unsigned UK metadata files.</echo>
<!-- [19] -->
<XALAN x="uk_master_unsigned.xsl" i="${uk.master.file}"
o="${md.prod.unsigned}" />
o="${md.prod.unsigned}" />
<MDNORM i="${md.prod.unsigned}"/>

<!-- [27] -->
<XALAN x="uk_master_test.xsl" i="${uk.master.file}"
o="${md.test.unsigned}" />
<MDNORM i="${md.test.unsigned}"/>
<MDNORM i="${md.test.unsigned}"/>

<!-- [29] -->
<XALAN x="uk_master_export.xsl" i="${uk.master.file}"
o="${md.export.unsigned}" />
o="${md.export.unsigned}" />
<MDNORM i="${md.export.unsigned}"/>

<!-- [31] -->
<XALAN x="uk_master_back.xsl" i="${uk.master.file}"
o="${md.back.unsigned}" />
Expand Down Expand Up @@ -722,7 +727,7 @@
<attribute name="i"/>
<attribute name="o"/>
<sequential>
<MDT.SIGN.uk i="@{i}" o="@{o}"/>
<XMLSECTOOL.SIGN.uk i="@{i}" o="@{o}"/>
</sequential>
</macrodef>

Expand All @@ -740,15 +745,15 @@

<echo>Signing UK test metadata.</echo>
<!-- [28] -->
<XMLSECTOOL.SIGN.uk i="${md.test.unsigned}" o="${md.test.signed}"/>
<SIGN.uk i="${md.test.unsigned}" o="${md.test.signed}"/>

<echo>Signing UK export metadata.</echo>
<!-- [30] -->
<SIGN.uk i="${md.export.unsigned}" o="${md.export.signed}"/>

<echo>Signing UK fallback metadata.</echo>
<!-- [32] -->
<SIGN.uk i="${md.back.unsigned}" o="${md.back.signed}"/>
<MDT.SIGN.uk i="${md.back.unsigned}" o="${md.back.signed}"/>

<echo>Generated signed UK metadata.</echo>
</target>
Expand Down
90 changes: 76 additions & 14 deletions build/uk_master_export.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:elab="http://eduserv.org.uk/labels"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
Expand All @@ -25,7 +29,7 @@
extension-element-prefixes="date exsl mdxDates"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
exclude-result-prefixes="wayf">
exclude-result-prefixes="md">

<!--Force UTF-8 encoding for the output.-->
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>
Expand Down Expand Up @@ -67,7 +71,7 @@
Document element.
-->
<xsl:template match="/md:EntitiesDescriptor">
<xsl:copy>
<EntitiesDescriptor>
<xsl:attribute name="validUntil">
<xsl:value-of select="$validUntil"/>
</xsl:attribute>
Expand All @@ -77,13 +81,13 @@
<xsl:apply-templates select="@*"/>
<xsl:call-template name="document.comment"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</EntitiesDescriptor>
</xsl:template>

<!--
Comment to be added to the top of the document, and just inside the document element.
-->
<xsl:template name="document.comment">
<xsl:template name="document.comment">
<xsl:text>&#10;</xsl:text>
<xsl:comment>
<xsl:text>&#10;&#9;U K F E D E R A T I O N M E T A D A T A&#10;</xsl:text>
Expand All @@ -100,7 +104,7 @@
<xsl:value-of select="$validUntil"/>
<xsl:text>&#10;</xsl:text>
</xsl:comment>
<xsl:text>&#10;</xsl:text>
<xsl:text>&#10;</xsl:text>
</xsl:template>

<!--
Expand Down Expand Up @@ -157,13 +161,19 @@
</xsl:template>

<!--
Pass through certain ukfedlabel namespace elements.
Normalise and pass through certain ukfedlabel namespace elements.
-->
<xsl:template match="ukfedlabel:UKFederationMember |
ukfedlabel:AccountableUsers">
<xsl:copy>

<xsl:template match="ukfedlabel:UKFederationMember">
<xsl:element name="ukfedlabel:UKFederationMember">
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:element>
</xsl:template>

<xsl:template match="ukfedlabel:AccountableUsers">
<xsl:element name="ukfedlabel:AccountableUsers">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>

<!--
Expand All @@ -172,16 +182,68 @@
<xsl:template match="ukfedlabel:*">
<!-- do nothing -->
</xsl:template>

<!--
Normalise namespace on IdP discovery elements.
-->

<xsl:template match="idpdisc:DiscoveryResponse">
<idpdisc:DiscoveryResponse>
<xsl:apply-templates select="node()|@*"/>
</idpdisc:DiscoveryResponse>
</xsl:template>

<!--
Normalise namespace on Athens PUID elements.
-->

<xsl:template match="elab:AthensPUIDAuthority">
<elab:AthensPUIDAuthority>
<xsl:apply-templates select="node()|@*"/>
</elab:AthensPUIDAuthority>
</xsl:template>

<!--
Normalise namespace on Shibboleth metadata elements.
-->

<xsl:template match="shibmd:Scope">
<shibmd:Scope>
<xsl:apply-templates select="node()|@*"/>
</shibmd:Scope>
</xsl:template>

<xsl:template match="shibmd:KeyAuthority">
<shibmd:KeyAuthority>
<xsl:apply-templates select="node()|@*"/>
</shibmd:KeyAuthority>
</xsl:template>

<!--
Remove administrative contacts.
-->
<xsl:template match="md:ContactPerson[@contactType='administrative']">
<!-- do nothing -->
</xsl:template>

<!--By default, copy text blocks, comments and attributes unchanged.-->
<xsl:template match="text()|comment()|@*">

<!--
Retain only certain comments.
-->

<xsl:template match="md:EntityDescriptor/comment()">
<xsl:copy/>
</xsl:template>

<xsl:template match="shibmd:KeyAuthority//comment()">
<xsl:copy/>
</xsl:template>

<!--
Strip all other comments.
-->

<!--By default, copy text blocks and attributes unchanged.-->
<xsl:template match="text()|@*">
<xsl:copy/>
</xsl:template>

Expand Down
109 changes: 95 additions & 14 deletions build/uk_master_unsigned.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:elab="http://eduserv.org.uk/labels"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
Expand All @@ -23,7 +27,7 @@
extension-element-prefixes="date exsl mdxDates"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
exclude-result-prefixes="wayf">
exclude-result-prefixes="md">

<!--Force UTF-8 encoding for the output.-->
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>
Expand All @@ -38,7 +42,21 @@

<xsl:variable name="now" select="date:date-time()"/>
<xsl:variable name="validUntil" select="mdxDates:dateAdd($now, $validityDays)"/>


<!--
documentID
This value is generated from a normalised version of the aggregation instant,
transformed so that it can be used as an XML ID value.
Strict conformance to the SAML 2.0 metadata specification (section 3.1.2) requires
that the signature explicitly references an identifier attribute in the element
being signed, in this case the document element.
-->
<xsl:variable name="normalisedNow" select="mdxDates:dateAdd($now, 0)"/>
<xsl:variable name="documentID"
select="concat('uk', translate($normalisedNow, ':-', ''))"/>

<!--
Document root.
-->
Expand All @@ -51,20 +69,24 @@
Document element.
-->
<xsl:template match="/md:EntitiesDescriptor">
<xsl:copy>
<EntitiesDescriptor>
<xsl:attribute name="validUntil">
<xsl:value-of select="$validUntil"/>
</xsl:attribute>
<xsl:attribute name="ID">
<xsl:value-of select="$documentID"/>
</xsl:attribute>
<xsl:apply-templates select="@*"/>
<xsl:call-template name="document.comment"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</EntitiesDescriptor>
</xsl:template>

<!--
Comment to be added to the top of the document, and just inside the document element.
-->
<xsl:template name="document.comment">
<xsl:template name="document.comment">
<xsl:text>&#10;</xsl:text>
<xsl:comment>
<xsl:text>&#10;&#9;U K F E D E R A T I O N M E T A D A T A&#10;</xsl:text>
<xsl:text>&#10;</xsl:text>
Expand All @@ -78,6 +100,7 @@
<xsl:value-of select="$validUntil"/>
<xsl:text>&#10;</xsl:text>
</xsl:comment>
<xsl:text>&#10;</xsl:text>
</xsl:template>

<!--
Expand All @@ -103,13 +126,19 @@
</xsl:template>

<!--
Pass through certain ukfedlabel namespace elements.
Normalise and pass through certain ukfedlabel namespace elements.
-->
<xsl:template match="ukfedlabel:UKFederationMember |
ukfedlabel:AccountableUsers">
<xsl:copy>

<xsl:template match="ukfedlabel:UKFederationMember">
<xsl:element name="ukfedlabel:UKFederationMember">
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:element>
</xsl:template>

<xsl:template match="ukfedlabel:AccountableUsers">
<xsl:element name="ukfedlabel:AccountableUsers">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:template>

<!--
Expand All @@ -118,16 +147,68 @@
<xsl:template match="ukfedlabel:*">
<!-- do nothing -->
</xsl:template>

<!--
Normalise namespace on IdP discovery elements.
-->

<xsl:template match="idpdisc:DiscoveryResponse">
<idpdisc:DiscoveryResponse>
<xsl:apply-templates select="node()|@*"/>
</idpdisc:DiscoveryResponse>
</xsl:template>

<!--
Normalise namespace on Athens PUID elements.
-->

<xsl:template match="elab:AthensPUIDAuthority">
<elab:AthensPUIDAuthority>
<xsl:apply-templates select="node()|@*"/>
</elab:AthensPUIDAuthority>
</xsl:template>

<!--
Normalise namespace on Shibboleth metadata elements.
-->

<xsl:template match="shibmd:Scope">
<shibmd:Scope>
<xsl:apply-templates select="node()|@*"/>
</shibmd:Scope>
</xsl:template>

<xsl:template match="shibmd:KeyAuthority">
<shibmd:KeyAuthority>
<xsl:apply-templates select="node()|@*"/>
</shibmd:KeyAuthority>
</xsl:template>

<!--
Remove administrative contacts.
-->
<xsl:template match="md:ContactPerson[@contactType='administrative']">
<!-- do nothing -->
</xsl:template>

<!--By default, copy text blocks, comments and attributes unchanged.-->
<xsl:template match="text()|comment()|@*">

<!--
Retain only certain comments.
-->

<xsl:template match="md:EntityDescriptor/comment()">
<xsl:copy/>
</xsl:template>

<xsl:template match="shibmd:KeyAuthority//comment()">
<xsl:copy/>
</xsl:template>

<!--
Strip all other comments.
-->

<!--By default, copy text blocks and attributes unchanged.-->
<xsl:template match="text()|@*">
<xsl:copy/>
</xsl:template>

Expand Down

0 comments on commit 0bc2383

Please sign in to comment.