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

Commit

Permalink
Extend Location checks to ResponseLocation
Browse files Browse the repository at this point in the history
Resolves ukf/ukf-meta#117.
  • Loading branch information
iay committed Feb 17, 2017
1 parent 547057d commit cfca00b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
12 changes: 11 additions & 1 deletion mdx/_rules/check_idp_tls.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> Location does not start with https://</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="md:IDPSSODescriptor//*[@ResponseLocation and not(starts-with(@ResponseLocation,'https://'))]">
<xsl:call-template name="error">
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> ResponseLocation does not start with https://</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="md:AttributeAuthorityDescriptor//*[@Location and not(starts-with(@Location,'https://'))]">
<xsl:call-template name="error">
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> Location does not start with https://</xsl:with-param>
</xsl:call-template>
</xsl:template>

<xsl:template match="md:AttributeAuthorityDescriptor//*[@ResponseLocation and not(starts-with(@ResponseLocation,'https://'))]">
<xsl:call-template name="error">
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> ResponseLocation does not start with https://</xsl:with-param>
</xsl:call-template>
</xsl:template>

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


<!--
@ResponseLocation attributes should not contain space characters.
This may be a little strict, and might be better confined to md:* elements.
At present, however, this produces no false positives.
-->
<xsl:template match="*[contains(@ResponseLocation, ' ')]">
<xsl:call-template name="error">
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> ResponseLocation contains space character</xsl:with-param>
</xsl:call-template>
</xsl:template>


<!--
@Binding attributes should not contain space characters.
Expand Down
14 changes: 14 additions & 0 deletions mdx/_rules/check_saml2meta.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@
</xsl:template>


<!--
Check for ResponseLocation attributes that aren't valid URLs.
-->
<xsl:template match="md:*[@ResponseLocation and mdxURL:invalidURL(@ResponseLocation)]">
<xsl:call-template name="error">
<xsl:with-param name="m">
<xsl:value-of select='local-name()'/>
<xsl:text> ResponseLocation is not a valid URL: </xsl:text>
<xsl:value-of select="mdxURL:whyInvalid(@ResponseLocation)"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>


<!--
Check for OrganizationURLs that aren't valid URLs.
-->
Expand Down
7 changes: 6 additions & 1 deletion mdx/_rules/check_sp_tls.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,10 @@
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> Location does not start with https://</xsl:with-param>
</xsl:call-template>
</xsl:template>

<xsl:template match="md:SPSSODescriptor//*[@ResponseLocation and not(starts-with(@ResponseLocation,'https://'))]">
<xsl:call-template name="error">
<xsl:with-param name="m"><xsl:value-of select='local-name()'/> ResponseLocation does not start with https://</xsl:with-param>
</xsl:call-template>
</xsl:template>

</xsl:stylesheet>

0 comments on commit cfca00b

Please sign in to comment.