Skip to content

Commit

Permalink
Bring feature fallback metadata stream back in line with production m…
Browse files Browse the repository at this point in the history
…etadata, with a validity window of 14 days.
  • Loading branch information
iay committed Sep 16, 2009
1 parent 0615136 commit 9b4f11a
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion build/uk_master_back.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,27 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wayf="http://sdss.ac.uk/2006/06/WAYF"
xmlns:uklabel="http://ukfederation.org.uk/2006/11/label"

xmlns:date="http://exslt.org/dates-and-times"
xmlns:mdxDates="xalan://uk.ac.sdss.xalan.md.Dates"
extension-element-prefixes="date mdxDates"

xmlns="urn:oasis:names:tc:SAML:2.0:metadata"
exclude-result-prefixes="wayf">

<!--Force UTF-8 encoding for the output.-->
<xsl:output omit-xml-declaration="no" method="xml" encoding="UTF-8" indent="yes"/>

<!--
validityDays
This parameter determines the number of days between the aggregation instant and the
end of validity of the signed metadata.
-->
<xsl:variable name="validityDays" select="14"/>

<xsl:variable name="now" select="date:date-time()"/>
<xsl:variable name="validUntil" select="mdxDates:dateAdd($now, $validityDays)"/>

<!--
Document root.
Expand All @@ -43,12 +56,15 @@
-->
<xsl:template match="/md:EntitiesDescriptor">
<xsl:copy>
<xsl:attribute name="validUntil">
<xsl:value-of select="$validUntil"/>
</xsl:attribute>
<xsl:apply-templates select="@*"/>
<xsl:call-template name="document.comment"/>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>

<!--
Comment to be added to the top of the document, and just inside the document element.
-->
Expand All @@ -61,6 +77,12 @@
<xsl:text>&#9;Aggregate built </xsl:text>
<xsl:value-of select="$now"/>
<xsl:text>&#10;</xsl:text>
<xsl:text>&#10;</xsl:text>
<xsl:text>&#9;Aggregate valid for </xsl:text>
<xsl:value-of select="$validityDays"/>
<xsl:text> days, until </xsl:text>
<xsl:value-of select="$validUntil"/>
<xsl:text>&#10;</xsl:text>
</xsl:comment>
</xsl:template>

Expand Down

0 comments on commit 9b4f11a

Please sign in to comment.