Skip to content

Commit

Permalink
Refactor so that there is only a single definition of each namespace,…
Browse files Browse the repository at this point in the history
… which is then referenced in multiple places. Make use of the c-prefix convention to make this reasonably compact.
  • Loading branch information
iay committed May 2, 2013
1 parent 7b02877 commit 922e0c8
Showing 1 changed file with 55 additions and 36 deletions.
91 changes: 55 additions & 36 deletions mdx/common-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
***********************************
-->

<!--
Java class parent shorthand beans.
-->
<bean id="String" abstract="true" class="java.lang.String"/>

<!--
component_parent
Expand Down Expand Up @@ -148,13 +153,32 @@
-->

<!--
icmd_namespace
Namespace URI beans.
Namespace URI for the icmd prefix: InCommon specific metadata.
One String bean for each of the common namespaces, named by its prefix.
-->
<bean id="icmd_namespace" class="java.lang.String">
<constructor-arg value="http://id.incommon.org/metadata"/>
</bean>
<bean id="alg_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:metadata:algsupport"/>
<bean id="ds_namespace" parent="String" c:_0="http://www.w3.org/2000/09/xmldsig#"/>
<bean id="dsig11_namespace" parent="String" c:_0="http://www.w3.org/2009/xmldsig11#"/>
<bean id="elab_namespace" parent="String" c:_0="http://eduserv.org.uk/labels"/>
<bean id="hoksso_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser"/>
<bean id="icmd_namespace" parent="String" c:_0="http://id.incommon.org/metadata"/>
<bean id="idpdisc_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"/>
<bean id="init_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:profiles:SSO:request-init"/>
<bean id="md_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:2.0:metadata"/>
<bean id="mdattr_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:metadata:attribute"/>
<bean id="mdrpi_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:metadata:rpi"/>
<bean id="mdui_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:metadata:ui"/>
<bean id="saml_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:2.0:assertion"/>
<bean id="samlp_namespace" parent="String" c:_0="urn:oasis:names:tc:SAML:2.0:protocol"/>
<bean id="shibmd_namespace" parent="String" c:_0="urn:mace:shibboleth:metadata:1.0"/>
<bean id="ukfedlabel_namespace" parent="String" c:_0="http://ukfederation.org.uk/2006/11/label"/>
<bean id="wayf_namespace" parent="String" c:_0="http://sdss.ac.uk/2006/06/WAYF"/>
<bean id="xenc_namespace" parent="String" c:_0="http://www.w3.org/2001/04/xmlenc#"/>
<bean id="xenc11_namespace" parent="String" c:_0="http://www.w3.org/2009/xmlenc11#"/>
<bean id="xs_namespace" parent="String" c:_0="http://www.w3.org/2001/XMLSchema"/>
<bean id="xsi_namespace" parent="String" c:_0="http://www.w3.org/2001/XMLSchema-instance"/>
<bean id="xsl_namespace" parent="String" c:_0="http://www.w3.org/1999/XSL/Transform"/>

<!--
commonNamespaces
Expand All @@ -165,28 +189,28 @@
<bean id="commonNamespaces" class="net.shibboleth.utilities.java.support.xml.SimpleNamespaceContext">
<constructor-arg>
<util:map map-class="java.util.HashMap">
<entry key="alg" value="urn:oasis:names:tc:SAML:metadata:algsupport"/>
<entry key="ds" value="http://www.w3.org/2000/09/xmldsig#"/>
<entry key="dsig11" value="http://www.w3.org/2009/xmldsig11#"/>
<entry key="elab" value="http://eduserv.org.uk/labels"/>
<entry key="hoksso" value="urn:oasis:names:tc:SAML:2.0:profiles:holder-of-key:SSO:browser"/>
<entry key="alg" value-ref="alg_namespace"/>
<entry key="ds" value-ref="ds_namespace"/>
<entry key="dsig11" value-ref="dsig11_namespace"/>
<entry key="elab" value-ref="elab_namespace"/>
<entry key="hoksso" value-ref="hoksso_namespace"/>
<entry key="icmd" value-ref="icmd_namespace"/>
<entry key="idpdisc" value="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"/>
<entry key="init" value="urn:oasis:names:tc:SAML:profiles:SSO:request-init"/>
<entry key="md" value="urn:oasis:names:tc:SAML:2.0:metadata"/>
<entry key="mdattr" value="urn:oasis:names:tc:SAML:metadata:attribute"/>
<entry key="mdrpi" value="urn:oasis:names:tc:SAML:metadata:rpi"/>
<entry key="mdui" value="urn:oasis:names:tc:SAML:metadata:ui"/>
<entry key="saml" value="urn:oasis:names:tc:SAML:2.0:assertion"/>
<entry key="samlp" value="urn:oasis:names:tc:SAML:2.0:protocol"/>
<entry key="shibmd" value="urn:mace:shibboleth:metadata:1.0"/>
<entry key="ukfedlabel" value="http://ukfederation.org.uk/2006/11/label"/>
<entry key="wayf" value="http://sdss.ac.uk/2006/06/WAYF"/>
<entry key="xenc" value="http://www.w3.org/2001/04/xmlenc#"/>
<entry key="xenc11" value="http://www.w3.org/2009/xmlenc11#"/>
<entry key="xs" value="http://www.w3.org/2001/XMLSchema"/>
<entry key="xsi" value="http://www.w3.org/2001/XMLSchema-instance"/>
<entry key="xsl" value="http://www.w3.org/1999/XSL/Transform"/>
<entry key="idpdisc" value-ref="idpdisc_namespace"/>
<entry key="init" value-ref="init_namespace"/>
<entry key="md" value-ref="md_namespace"/>
<entry key="mdattr" value-ref="mdattr_namespace"/>
<entry key="mdrpi" value-ref="mdrpi_namespace"/>
<entry key="mdui" value-ref="mdui_namespace"/>
<entry key="saml" value-ref="saml_namespace"/>
<entry key="samlp" value-ref="samlp_namespace"/>
<entry key="shibmd" value-ref="shibmd_namespace"/>
<entry key="ukfedlabel" value-ref="ukfedlabel_namespace"/>
<entry key="wayf" value-ref="wayf_namespace"/>
<entry key="xenc" value-ref="xenc_namespace"/>
<entry key="xenc11" value-ref="xenc11_namespace"/>
<entry key="xs" value-ref="xs_namespace"/>
<entry key="xsi" value-ref="xsi_namespace"/>
<entry key="xsl" value-ref="xsl_namespace"/>
</util:map>
</constructor-arg>
</bean>
Expand All @@ -197,44 +221,39 @@
Remove the Eduserv label namespace.
-->
<bean id="stripElabNamespace" parent="stripNamespace_parent"
p:id="stripElabNamespace"
p:namespace="http://eduserv.org.uk/labels"/>
p:id="stripElabNamespace" p:namespace-ref="elab_namespace"/>

<!--
stripMdattrNamespace
Remove the namespace used by the entity attributes extension.
-->
<bean id="stripMdattrNamespace" parent="stripNamespace_parent"
p:id="stripMdattrNamespace"
p:namespace="urn:oasis:names:tc:SAML:metadata:attribute"/>
p:id="stripMdattrNamespace" p:namespace-ref="mdattr_namespace"/>

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

<!--
stripUkfedlabelNamespace
Remove the UK federation label namespace.
-->
<bean id="stripUkfedlabelNamespace" parent="stripNamespace_parent"
p:id="stripUkfedlabelNamespace"
p:namespace="http://ukfederation.org.uk/2006/11/label"/>
p:id="stripUkfedlabelNamespace" p:namespace-ref="ukfedlabel_namespace"/>

<!--
stripWayfNamespace
Remove the UK federation WAYF namespace.
-->
<bean id="stripWayfNamespace" parent="stripNamespace_parent"
p:id="stripWayfNamespace"
p:namespace="http://sdss.ac.uk/2006/06/WAYF"/>
p:id="stripWayfNamespace" p:namespace-ref="wayf_namespace"/>

<!--
normaliseNamespaces
Expand Down

0 comments on commit 922e0c8

Please sign in to comment.