Skip to content

Commit

Permalink
Initial cut at the "test" and "export" metadata streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Dec 15, 2008
1 parent 43c90c3 commit db8faf5
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 1 deletion.
27 changes: 26 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@
-->
<property name="uk.metadata.unsigned" value="ukfederation-metadata-unsigned.xml"/>

<!--
In addition, the UK federation master file acts as the parent to two
other metadata streams, the "test" and "export" streams. These have their
own XSLT transforms, and their own unsigned files ([27] and [29]).
-->
<property name="uk.metadata.test.unsigned" value="ukfederation-test-unsigned.xml"/>
<property name="uk.metadata.export.unsigned" value="ukfederation-export-unsigned.xml"/>

<!--
From there, the process (with indentation implying the creation
hierarchy) is:
Expand All @@ -93,6 +101,11 @@
[25] ukfederation-wayf-unsigned.xml
[26] ukfederation-wayf.xml
[27] ukfederation-test-unsigned.xml
[28] ukfederation-test.xml
[29] ukfederation-export-unsigned.xml
[30] ukfederation-export.xml
The numbers in brackets are duplicated in the script where the file in
question is created. Some numbers are missing because some old format
files are no longer being generated.
Expand Down Expand Up @@ -312,10 +325,16 @@
</target>

<target name="gen.uk.unsigned" depends="gen.uk.master">
<echo>Generating unsigned UK metadata file.</echo>
<echo>Generating unsigned UK metadata files.</echo>
<!-- [19] -->
<XALAN x="uk_master_unsigned.xsl" i="${uk.master.file}"
o="${uk.metadata.unsigned}" />
<!-- [27] -->
<XALAN x="uk_master_test.xsl" i="${uk.master.file}"
o="${uk.metadata.test.unsigned}" />
<!-- [29] -->
<XALAN x="uk_master_export.xsl" i="${uk.master.file}"
o="${uk.metadata.export.unsigned}" />
</target>

<target name="gen.uk.1.2">
Expand Down Expand Up @@ -446,6 +465,12 @@
<echo>Verifying signed UK WAYF metadata.</echo>
<VFY.uk i="ukfederation-wayf.xml"/>

<echo>Verifying signed UK test metadata.</echo>
<VFY.uk i="ukfederation-test.xml"/>

<echo>Verifying signed UK export metadata.</echo>
<VFY.uk i="ukfederation-export.xml"/>

<echo>Verification completed.</echo>
</target>

Expand Down
54 changes: 54 additions & 0 deletions build/uk_master_export.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
uk_master_unsigned.xsl
XSL stylesheet that takes the UK federation master file containing all information
about UK federation entities and processes them for the "export" metadata stream.
This is initially the same as the production metadata stream, and not for publication.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:uklabel="http://ukfederation.org.uk/2006/11/label"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
exclude-result-prefixes="wayf">

<!--Force UTF-8 encoding for the output.-->
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>

<!--
Strip uklabel:Software elements entirely.
-->
<xsl:template match="uklabel:Software|uklabel:Software">
<!-- do nothing -->
</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()|@*">
<xsl:copy/>
</xsl:template>

<!--By default, copy all elements from the input to the output, along with their attributes and contents.-->
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>
55 changes: 55 additions & 0 deletions build/uk_master_test.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
uk_master_test.xsl
XSL stylesheet that takes the UK federation master file containing all information
about UK federation entities and processes them for the "test" metadata stream.
This is normally the same as the production metadata stream, except when we are
testing some modification and wish to publish alternate metadata.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:uklabel="http://ukfederation.org.uk/2006/11/label"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
exclude-result-prefixes="wayf">

<!--Force UTF-8 encoding for the output.-->
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>

<!--
Strip uklabel:Software elements entirely.
-->
<xsl:template match="uklabel:Software|uklabel:Software">
<!-- do nothing -->
</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()|@*">
<xsl:copy/>
</xsl:template>

<!--By default, copy all elements from the input to the output, along with their attributes and contents.-->
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>

</xsl:stylesheet>

0 comments on commit db8faf5

Please sign in to comment.