Skip to content

Commit

Permalink
Migrate the mailing list check to using the new flow.uk.collect syste…
Browse files Browse the repository at this point in the history
…m rather than the file that came out by accident in the old system.

This requires not removing administrative contacts prematurely during fragment processing but instead doing that explicitly via a new XSLT stage during the generate flow.
  • Loading branch information
iay committed Jul 25, 2011
1 parent 615e9b2 commit 9c5fefb
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@
<!--
Check mailing list against current metadata
-->
<target name="check.mailing.list" depends="gen.uk.master">
<target name="check.mailing.list" depends="flow.uk.collect">
<echo>Checking mailing list entries.</echo>
<exec executable="perl" dir="${build.dir}">
<arg value="${build.dir}/addresses.pl"/>
Expand Down
2 changes: 1 addition & 1 deletion build/addresses.pl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#
# UK addresses
#
open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-master.xml -XSL extract_addresses.xsl|") || die "could not open input file";
open(XML, xalanCall . " -IN ../mdx/uk/collected.xml -XSL extract_addresses.xsl|") || die "could not open input file";
while (<XML>) {
if (/<EmailAddress>(mailto:)?(.*)<\/EmailAddress>/) {
$metadata{$2} = 1;
Expand Down
16 changes: 16 additions & 0 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@
</bean>


<!--
uk_stripAdminContacts
Remove any md:ContactPerson elements with contactType of "administrative".
-->
<bean id="uk_stripAdminContacts" class="net.shibboleth.metadata.dom.XSLTransformationStage"
init-method="initialize" lazy-init="true">
<property name="id" value="uk_stripAdminContacts"/>
<property name="xslResource">
<bean class="org.opensaml.util.resource.FilesystemResource">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/uk/strip_admin.xsl"/>
</bean>
</property>
</bean>


<!--
uk_performFixups
Expand Down
6 changes: 0 additions & 6 deletions mdx/uk/fragment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
<xsl:template match="@xsi:schemaLocation"/>


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


<!--
Discard various ds:X509 elements. Several of these are known to
cause problems with software systems, and they don't affect trust
Expand Down
5 changes: 5 additions & 0 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@
-->
<ref bean="uk_registeredEntities"/>

<!--
Remove all "administrative" contacts.
-->
<ref bean="uk_stripAdminContacts"/>

<!--
Fork into new pipelines for the export aggregate and for
the registrar statistics.
Expand Down
48 changes: 48 additions & 0 deletions mdx/uk/strip_admin.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
strip_admin.xsl
Remove any "administrative" ContactPerson elements from metadata.
-->
<xsl:stylesheet version="1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xsi xsl">

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


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


<!--
*********************************************
*** ***
*** D E F A U L T T E M P L A T E S ***
*** ***
*********************************************
-->


<!--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 9c5fefb

Please sign in to comment.