Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Unbundle the check for entityID prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed May 6, 2016
1 parent 4f808bc commit 2d22f7b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 12 deletions.
33 changes: 33 additions & 0 deletions mdx/_rules/check_entityid_prefix.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_entityid_prefix.xsl
Checking that entityID attributes start with one of a whitelist of prefixes.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

<!--
Common support functions.
-->
<xsl:import href="check_framework.xsl"/>


<!--
Entity IDs should start with one of "http://", "https://" or "urn:mace:".
-->
<xsl:template match="md:EntityDescriptor[not(starts-with(@entityID, 'urn:mace:'))]
[not(starts-with(@entityID, 'http://'))]
[not(starts-with(@entityID, 'https://'))]">
<xsl:call-template name="error">
<xsl:with-param name="m">entity ID <xsl:value-of select="@entityID"/> does not start with acceptable prefix</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
12 changes: 0 additions & 12 deletions mdx/_rules/check_misc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@
</xsl:template>


<!--
Entity IDs should start with one of "http://", "https://" or "urn:mace:".
-->
<xsl:template match="md:EntityDescriptor[not(starts-with(@entityID, 'urn:mace:'))]
[not(starts-with(@entityID, 'http://'))]
[not(starts-with(@entityID, 'https://'))]">
<xsl:call-template name="error">
<xsl:with-param name="m">entity ID <xsl:value-of select="@entityID"/> does not start with acceptable prefix</xsl:with-param>
</xsl:call-template>
</xsl:template>


<!--
Check for OrganizationDisplayName elements containing line breaks.
-->
Expand Down
1 change: 1 addition & 0 deletions mdx/uk/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
<ref bean="check_adfs"/>
<ref bean="check_algsupport"/>
<ref bean="check_bindings"/>
<ref bean="check_entityid_prefix"/>
<ref bean="check_hoksso"/>
<ref bean="check_idpdisc"/>
<ref bean="check_incmd"/>
Expand Down
7 changes: 7 additions & 0 deletions mdx/validation-beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@
-->
<bean id="check_cr" parent="CRDetectionStage"/>

<!--
check_entityid_prefix
-->
<bean id="check_entityid_prefix" parent="XSLValidationStage"
p:XSLResource="classpath:_rules/check_entityid_prefix.xsl"/>

<!--
check_misc
-->
Expand Down Expand Up @@ -572,6 +578,7 @@
<ref bean="check_algsupport"/>
<ref bean="check_bindings"/>
<ref bean="check_cr"/>
<ref bean="check_entityid_prefix"/>
<ref bean="check_hoksso"/>
<ref bean="check_idpdisc"/>
<ref bean="check_incmd"/>
Expand Down

0 comments on commit 2d22f7b

Please sign in to comment.