Skip to content

Commit

Permalink
Bugzilla 898 - add mdrpi boilerplate during registration import trans…
Browse files Browse the repository at this point in the history
…form

Also arranges for any such information to be stripped (for now) from the production, WAYF and fallback aggregates.
It *will* appear in the test and export aggregates.
  • Loading branch information
iay committed Feb 17, 2012
1 parent 7453da5 commit c883602
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 11 deletions.
35 changes: 34 additions & 1 deletion build/import.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:init="urn:oasis:names:tc:SAML:profiles:SSO:request-init"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"

xmlns:date="http://exslt.org/dates-and-times"
xmlns:mdxDates="xalan://uk.ac.sdss.xalan.md.Dates"
xmlns:mdxTextUtils="xalan://uk.ac.sdss.xalan.md.TextUtils"
extension-element-prefixes="mdxDates mdxTextUtils"
extension-element-prefixes="date mdxDates mdxTextUtils"

xmlns:xalan="http://xml.apache.org/xalan"

Expand All @@ -61,6 +63,7 @@
<EntityDescriptor ID="uk000000_CHANGE_THIS"
xsi:schemaLocation="urn:oasis:names:tc:SAML:2.0:metadata ../xml/saml-schema-metadata-2.0.xsd
urn:oasis:names:tc:SAML:metadata:algsupport ../xml/sstc-saml-metadata-algsupport-v1.0.xsd
urn:oasis:names:tc:SAML:metadata:rpi ../xml/saml-metadata-rpi-v1.0.xsd
urn:oasis:names:tc:SAML:metadata:ui ../xml/sstc-saml-metadata-ui-v1.0.xsd
urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol ../xml/sstc-saml-idp-discovery.xsd
urn:oasis:names:tc:SAML:profiles:SSO:request-init ../xml/sstc-request-initiation.xsd
Expand Down Expand Up @@ -129,6 +132,19 @@
-->
<xsl:apply-templates select="md:Extensions/*"/>

<!--
Add registration information consisting of the registration instant
and an identifier for the registrar.
Any RegistrationInfo on the input document is discarded by a rule below.
-->
<xsl:element name="mdrpi:RegistrationInfo">
<xsl:attribute name="registrationInstant">
<xsl:value-of select="mdxDates:dateAdd(date:date-time(), 0)"/>
</xsl:attribute>
<xsl:attribute name="registrationAuthority">http://ukfederation.org.uk</xsl:attribute>
</xsl:element>

</Extensions>

<!--
Expand Down Expand Up @@ -267,6 +283,23 @@
</xsl:template>


<!--
*****************************************
*** ***
*** M D R P I N A M E S P A C E ***
*** ***
*****************************************
-->

<!--
mdrpi:RegistrationInfo
By definition, any RegistrationInfo element appearing within the input
document should be discarded, as this is a new registration.
-->
<xsl:template match="mdrpi:RegistrationInfo"/>


<!--
*********************************************
*** ***
Expand Down
2 changes: 1 addition & 1 deletion build/ns_norm_fragment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
xmlns:ukfedlabel="http://ukfederation.org.uk/2006/11/label"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"

exclude-result-prefixes="alg elab md mdrpi mdattr saml"
exclude-result-prefixes="alg elab md mdattr saml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
Expand Down
30 changes: 21 additions & 9 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,21 @@
</constructor-arg>
</bean>

<!--
Parent (template) for namespace stripping stages.
-->
<bean id="stripNamespace_parent" abstract="true"
class="uk.org.ukfederation.mda.NamespaceStrippingStage"
init-method="initialize" lazy-init="true"/>

<!--
stripElabNamespace
Remove the Eduserv label namespace.
-->
<bean id="stripElabNamespace" p:id="stripElabNamespace"
p:namespace="http://eduserv.org.uk/labels"
class="uk.org.ukfederation.mda.NamespaceStrippingStage"
init-method="initialize" lazy-init="true"/>
parent="stripNamespace_parent"/>

<!--
stripMdattrNamespace
Expand All @@ -66,8 +72,16 @@
-->
<bean id="stripMdattrNamespace" p:id="stripMdattrNamespace"
p:namespace="urn:oasis:names:tc:SAML:metadata:attribute"
class="uk.org.ukfederation.mda.NamespaceStrippingStage"
init-method="initialize" lazy-init="true"/>
parent="stripNamespace_parent"/>

<!--
stripMdrpiNamespace
Remove the namespace used by the registration and publication metdata extension.
-->
<bean id="stripMdrpiNamespace" p:id="stripMdrpiNamespace"
p:namespace="urn:oasis:names:tc:SAML:metadata:rpi"
parent="stripNamespace_parent"/>

<!--
stripUkfedlabelNamespace
Expand All @@ -76,18 +90,16 @@
-->
<bean id="stripUkfedlabelNamespace" p:id="stripUkfedlabelNamespace"
p:namespace="http://ukfederation.org.uk/2006/11/label"
class="uk.org.ukfederation.mda.NamespaceStrippingStage"
init-method="initialize" lazy-init="true"/>

parent="stripNamespace_parent"/>

<!--
stripWayfNamespace
Remove the UK federation WAYF namespace.
-->
<bean id="stripWayfNamespace" p:id="stripWayfNamespace"
p:namespace="http://sdss.ac.uk/2006/06/WAYF"
class="uk.org.ukfederation.mda.NamespaceStrippingStage"
init-method="initialize" lazy-init="true"/>
parent="stripNamespace_parent"/>

<!--
normaliseNamespaces
Expand Down
3 changes: 3 additions & 0 deletions mdx/uk/generate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
<property name="stages">
<list>
<ref bean="uk_assemble"/>
<ref bean="stripMdrpiNamespace"/>
<ref bean="uk_addTrustRoots"/>
<ref bean="uk_finaliseProduction"/>
<ref bean="uk_normaliseNamespaces"/>
Expand Down Expand Up @@ -186,6 +187,7 @@
<property name="stages">
<list>
<ref bean="uk_assemble"/>
<ref bean="stripMdrpiNamespace"/>
<ref bean="uk_finaliseProduction"/>
<ref bean="uk_normaliseNamespaces"/>

Expand Down Expand Up @@ -238,6 +240,7 @@
<property name="stages">
<list>
<ref bean="uk_assemble"/>
<ref bean="stripMdrpiNamespace"/>
<ref bean="uk_addTrustRoots"/>
<ref bean="uk_finaliseFallback"/>
<ref bean="uk_normaliseNamespaces"/>
Expand Down

0 comments on commit c883602

Please sign in to comment.