Skip to content

Commit

Permalink
Go the whole hog and split the future tests down to one test per file.
Browse files Browse the repository at this point in the history
Move the future tests to the mdx folder.
Extend the future test system to 10 possible files, so that we don't need to change configuration when we add or remove minor tests.
Add a simple test for md:*/@Binding values.  This will need to be more closely targeted on individual elements before being promoted to production.
  • Loading branch information
iay committed Mar 15, 2012
1 parent 4fad832 commit ada0037
Show file tree
Hide file tree
Showing 11 changed files with 332 additions and 49 deletions.
15 changes: 2 additions & 13 deletions build/check_future.xsl → mdx/check_future_0.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future.xsl
check_future_0.xsl
Checking ruleset containing rules that we don't currently implement,
but which we may implement in the future.
Expand All @@ -27,7 +27,7 @@
<!--
Common support functions.
-->
<xsl:import href="check_framework.xsl"/>
<xsl:import href="../build/check_framework.xsl"/>


<!--
Expand All @@ -43,15 +43,4 @@
</xsl:call-template>
</xsl:template>

<!--
Check for endpoint locations that include a '%' character,
which is symptomatic of their being URL-encoded instead of entity-encoded.
-->

<xsl:template match="@Location[contains(., '%')]">
<xsl:call-template name="error">
<xsl:with-param name="m">URL-encoded Location attribute; should be entity-encoded</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
24 changes: 1 addition & 23 deletions build/check_future_1.xsl → mdx/check_future_1.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,9 @@
<!--
Common support functions.
-->
<xsl:import href="check_framework.xsl"/>
<xsl:import href="../build/check_framework.xsl"/>


<!--
***************************
*** ***
*** S A M L 2 I N T ***
*** ***
***************************
-->

<!--
Section 6.
Expand All @@ -53,18 +45,4 @@
</xsl:call-template>
</xsl:template>

<!--
Section 6.
Check for SAML 2.0 IdPs which exclude the transient SAML 2 name identifier format.
-->
<xsl:template match="md:IDPSSODescriptor
[contains(@protocolSupportEnumeration, 'urn:oasis:names:tc:SAML:2.0:protocol')]
[md:NameIDFormat]
[not(md:NameIDFormat[.='urn:oasis:names:tc:SAML:2.0:nameid-format:transient'])]">
<xsl:call-template name="error">
<xsl:with-param name="m">IdP excludes SAML 2 transient name identifier format</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
12 changes: 2 additions & 10 deletions build/check_future_2.xsl → mdx/check_future_2.xsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_1.xsl
check_future_2.xsl
Checking ruleset containing rules that we don't currently implement,
but which we may implement in the future.
Expand All @@ -27,17 +27,9 @@
<!--
Common support functions.
-->
<xsl:import href="check_framework.xsl"/>
<xsl:import href="../build/check_framework.xsl"/>


<!--
***************************
*** ***
*** S A M L 2 I N T ***
*** ***
***************************
-->

<!--
Section 9.1
Expand Down
44 changes: 44 additions & 0 deletions mdx/check_future_3.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_3.xsl
Checking ruleset containing rules that we don't currently implement,
but which we may implement in the future.
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:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:set="http://exslt.org/sets"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"

xmlns:mdxURL="xalan://uk.ac.sdss.xalan.md.URLchecker"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


<!--
Check for endpoint locations that include a '%' character,
which is symptomatic of their being URL-encoded instead of entity-encoded.
-->

<xsl:template match="@Location[contains(., '%')]">
<xsl:call-template name="error">
<xsl:with-param name="m">URL-encoded Location attribute; should be entity-encoded</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
47 changes: 47 additions & 0 deletions mdx/check_future_4.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_4.xsl
Checking ruleset containing rules that we don't currently implement,
but which we may implement in the future.
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:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns:set="http://exslt.org/sets"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"

xmlns:mdxURL="xalan://uk.ac.sdss.xalan.md.URLchecker"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


<!--
Section 6.
Check for SAML 2.0 IdPs which exclude the transient SAML 2 name identifier format.
-->
<xsl:template match="md:IDPSSODescriptor
[contains(@protocolSupportEnumeration, 'urn:oasis:names:tc:SAML:2.0:protocol')]
[md:NameIDFormat]
[not(md:NameIDFormat[.='urn:oasis:names:tc:SAML:2.0:nameid-format:transient'])]">
<xsl:call-template name="error">
<xsl:with-param name="m">IdP excludes SAML 2 transient name identifier format</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
49 changes: 49 additions & 0 deletions mdx/check_future_5.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_5.xsl
Checking ruleset containing rules that we don't currently implement,
but which we may implement in the future.
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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:set="http://exslt.org/sets"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


<xsl:template match="md:*
[@Binding != 'http://schemas.xmlsoap.org/ws/2003/07/secext']
[@Binding != 'urn:mace:shibboleth:1.0:profiles:AuthnRequest']
[@Binding != 'urn:oasis:names:tc:SAML:1.0:bindings:SOAP-binding']
[@Binding != 'urn:oasis:names:tc:SAML:1.0:profiles:artifact-01']
[@Binding != 'urn:oasis:names:tc:SAML:1.0:profiles:browser-post']
[@Binding != 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact']
[@Binding != 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST']
[@Binding != 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST-SimpleSign']
[@Binding != 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect']
[@Binding != 'urn:oasis:names:tc:SAML:2.0:bindings:PAOS']
[@Binding != 'urn:oasis:names:tc:SAML:2.0:bindings:SOAP']
">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:text>invalid @Binding='</xsl:text>
<xsl:value-of select="@Binding"/>
<xsl:text>' on </xsl:text>
<xsl:value-of select="name()"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>
25 changes: 25 additions & 0 deletions mdx/check_future_6.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_6.xsl
Checking ruleset that checks SAML 2.0 metadata Binding values.
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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:set="http://exslt.org/sets"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


</xsl:stylesheet>
25 changes: 25 additions & 0 deletions mdx/check_future_7.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_7.xsl
Checking ruleset that checks SAML 2.0 metadata Binding values.
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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:set="http://exslt.org/sets"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


</xsl:stylesheet>
25 changes: 25 additions & 0 deletions mdx/check_future_8.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_8.xsl
Checking ruleset that checks SAML 2.0 metadata Binding values.
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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:set="http://exslt.org/sets"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


</xsl:stylesheet>
25 changes: 25 additions & 0 deletions mdx/check_future_9.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_future_9.xsl
Checking ruleset that checks SAML 2.0 metadata Binding values.
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:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:idpdisc="urn:oasis:names:tc:SAML:profiles:SSO:idp-discovery-protocol"
xmlns:set="http://exslt.org/sets"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


</xsl:stylesheet>
Loading

0 comments on commit ada0037

Please sign in to comment.