Skip to content

Commit

Permalink
Introduce the validUntil attribute (at 28 days from signing) to the p…
Browse files Browse the repository at this point in the history
…roduction metadata stream.
  • Loading branch information
iay committed Jul 27, 2009
1 parent a5846fb commit 9181404
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion build/uk_master_unsigned.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,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:ukfxd="xalan://uk.org.ukfederation.xalan.Dates"
extension-element-prefixes="date ukfxd"

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="28"/>

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

<!--
Document root.
Expand All @@ -39,12 +52,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 @@ -55,6 +71,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 9181404

Please sign in to comment.