summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Lördal <anders@lordal.se>2015-09-11 09:22:54 +0200
committerAnders Lördal <anders@lordal.se>2015-09-11 09:22:54 +0200
commit076d1510e961a701f3af717b267c69c61bc2e25c (patch)
tree9f4067917f0c51a5b9b533c37443bb6035791e2d
parente1d4549e9d68d944c194740a569a2c99ecf23847 (diff)
Added fix to de-dupe SWAMID entities in metadata
Renamed file to correct name standard Added URL rewrite for %2F in entityids in import of interfederations
-rwxr-xr-xscripts/pull-and-verify.sh5
-rw-r--r--swamid-2.0/login.idp.eduid.se-idp.xml.xml (renamed from swamid-2.0/login.idp.eduid.se-idp.xml)0
-rw-r--r--swamid-edugain-idp-1.0.mxml2
-rw-r--r--xslt/import-metadata.xsl34
4 files changed, 36 insertions, 5 deletions
diff --git a/scripts/pull-and-verify.sh b/scripts/pull-and-verify.sh
index 6e63e855..b8b1e223 100755
--- a/scripts/pull-and-verify.sh
+++ b/scripts/pull-and-verify.sh
@@ -23,7 +23,10 @@ echo "<EntitiesDescriptor xmlns=\"urn:oasis:names:tc:SAML:2.0:metadata\" xmlns:x
T=`mktemp`
for md in $DIR/*.xml; do
xsltproc xslt/clean-entitydescriptor.xsl $md > $T && mv $T $md
- echo "<xi:include href=\"$md\"/>"
+ test=`echo $md | cut -d/ -f2-`
+ if [ ! -f "swamid-2.0/$test" ]; then
+ echo "<xi:include href=\"$md\"/>"
+ fi
done
rm -f $T
echo "</EntitiesDescriptor>"
diff --git a/swamid-2.0/login.idp.eduid.se-idp.xml b/swamid-2.0/login.idp.eduid.se-idp.xml.xml
index 6ee867bf..6ee867bf 100644
--- a/swamid-2.0/login.idp.eduid.se-idp.xml
+++ b/swamid-2.0/login.idp.eduid.se-idp.xml.xml
diff --git a/swamid-edugain-idp-1.0.mxml b/swamid-edugain-idp-1.0.mxml
index 6f2e7983..a09ca97d 100644
--- a/swamid-edugain-idp-1.0.mxml
+++ b/swamid-edugain-idp-1.0.mxml
@@ -46,7 +46,7 @@
<xi:include href="swamid-2.0/weblogin.uu.se-idp-shibboleth.xml"/>
<xi:include href="swamid-2.0/login.idp.hhs.se-idp-shibboleth.xml"/>
<xi:include href="swamid-2.0/saml.sys.kth.se-idp-shibboleth.xml"/>
- <xi:include href="swamid-2.0/login.idp.eduid.se-idp.xml"/>
+ <xi:include href="swamid-2.0/login.idp.eduid.se-idp.xml.xml"/>
<xi:include href="swamid-2.0/idp.sics.se-idp-shibboleth.xml"/>
<xi:include href="swamid-2.0/idp.kkh.se-idp-shibboleth.xml"/>
</md:EntitiesDescriptor>
diff --git a/xslt/import-metadata.xsl b/xslt/import-metadata.xsl
index 5a99c8bd..2edf7ed2 100644
--- a/xslt/import-metadata.xsl
+++ b/xslt/import-metadata.xsl
@@ -11,6 +11,26 @@
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
+ <xsl:template name="string-replace-all">
+ <xsl:param name="text" />
+ <xsl:param name="replace" />
+ <xsl:param name="by" />
+ <xsl:choose>
+ <xsl:when test="contains($text, $replace)">
+ <xsl:value-of select="substring-before($text,$replace)" />
+ <xsl:value-of select="$by" />
+ <xsl:call-template name="string-replace-all">
+ <xsl:with-param name="text" select="substring-after($text,$replace)" />
+ <xsl:with-param name="replace" select="$replace" />
+ <xsl:with-param name="by" select="$by" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$text" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
<xsl:template match="/md:EntitiesDescriptor">
<xsl:apply-templates select="md:EntityDescriptor">
<!-- xsl:with-param name="output"><xsl:value-of select="$output"/></xsl:with-param -->
@@ -27,14 +47,22 @@
<xsl:otherwise><xsl:value-of select="@entityID"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
-
+
+ <xsl:variable name="hostStr">
+ <xsl:call-template name="string-replace-all">
+ <xsl:with-param name="text" select="$uri" />
+ <xsl:with-param name="replace" select="'%2F'" />
+ <xsl:with-param name="by" select="'/'" />
+ </xsl:call-template>
+ </xsl:variable>
+
<xsl:variable name="host">
- <xsl:value-of select="normalize-space(translate($uri,'/?=:','----'))"/>
+ <xsl:value-of select="normalize-space(translate($hostStr,'/?=:','----'))"/>
</xsl:variable>
<xsl:variable name="file" select="concat($output,'/',$host,'.xml')"/>
<exsl:document method="xml" indent="yes" href="{$file}">
<xsl:copy>
- <xsl:apply-templates select="node()|@*"/>
+ <xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</exsl:document>
</xsl:template>