Skip to content

Commit

Permalink
Move URL-encoding check out of the general set and apply it only for …
Browse files Browse the repository at this point in the history
…the import transform and on already registered UKf metadata. This means that it will no longer be applied to metadata imported from partners such as eduGAIN.
  • Loading branch information
iay committed Sep 12, 2013
1 parent 00ec357 commit 80041f1
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 11 deletions.
11 changes: 0 additions & 11 deletions mdx/_rules/check_misc.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@
</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>


<!--
Check for Locations that don't start with https://
Expand Down
14 changes: 14 additions & 0 deletions mdx/uk/beans.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,19 @@
</bean>


<!--
check_uk_urlenc
-->
<bean id="check_uk_urlenc" parent="XSLValidationStage"
p:id="check_uk_urlenc">
<property name="xslResource">
<bean parent="FilesystemResource">
<constructor-arg value="#{ systemProperties['basedir'] }/mdx/uk/check_uk_urlenc.xsl"/>
</bean>
</property>
</bean>


<!--
uk_trustRootsDocument
Expand Down Expand Up @@ -375,6 +388,7 @@
<ref bean="checkSchemas"/>
<ref bean="CHECK_std"/>
<ref bean="check_ukreg"/>
<ref bean="check_uk_urlenc"/>
<ref bean="mdui_dn_en_present"/>
<ref bean="mdui_dn_en_match"/>
<ref bean="check_dup_display"/>
Expand Down
32 changes: 32 additions & 0 deletions mdx/uk/check_uk_urlenc.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_uk_urlenc.xsl
UKf-specific check for endpoint locations that include a '%' character,
which is symptomatic of their being URL-encoded instead of entity-encoded.
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:shibmd="urn:mace:shibboleth:metadata:1.0"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">

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


<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>
1 change: 1 addition & 0 deletions mdx/uk/verbs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
<ref bean="check_shibboleth"/>
<ref bean="check_uk_trust"/>

<ref bean="check_uk_urlenc"/>
<ref bean="check_future"/>
<ref bean="check_imported"/>
<ref bean="check_vhosts"/>
Expand Down

0 comments on commit 80041f1

Please sign in to comment.