summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2016-02-14 13:54:52 +0100
committerLeif Johansson <leifj@sunet.se>2016-02-14 13:54:52 +0100
commit333eb6555dcfeeffbadab702b9d3fadc6b5dd904 (patch)
tree7d600c5a08a2425c1c5b4f711d665e157949eb43
parente46df227f84d56c681b76c3c55ea42594d559745 (diff)
remove all traces of saml-md-tools and implement publicationinfo
-rw-r--r--Makefile5
-rw-r--r--xslt/normalize.xsl17
2 files changed, 17 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 836dc4a5..8fe2dda3 100644
--- a/Makefile
+++ b/Makefile
@@ -7,12 +7,13 @@ SRCDIRS=swamid-2.0
DAYS:=15
DATE=$(shell perl scripts/expiration_date.pl $(DAYS))
+NOW=$(shell perl scripts/now_date.pl)
RPI=false
CONTACTS=false
TOU=true
ORG=true
TRANSFORM=xslt/normalize.xsl
-XSLTDEFS := --stringparam org $(ORG) --stringparam tou $(TOU) --stringparam rpi $(RPI) --stringparam defaultContact $(CONTACTS) --stringparam date $(DATE)
+XSLTDEFS := --stringparam org $(ORG) --stringparam tou $(TOU) --stringparam rpi $(RPI) --stringparam defaultContact $(CONTACTS) --stringparam date $(DATE) --stringparam now $(NOW)
all: update clean sign clean
@@ -26,7 +27,7 @@ MXML=$(shell echo *.mxml)
sign: keys swamid swamid-testing swamid-testing-idp upstream projects swamid-ki-sll
%.sig: %.mxml
- xsltproc $(XSLTDEFS) --xinclude $(TRANSFORM) $< > $*.n
+ xsltproc $(XSLTDEFS) --stringparam target "http://md.swamid.se/md/$*.xml" --xinclude $(TRANSFORM) $< > $*.n
xsltproc $(XSLTDEFS) --xinclude xslt/sign.xsl $*.n > $*.tbs
xmlsec1 --sign --privkey-pem $(KEY),$(CERT) --pwd $(PASS) --output $@ $*.tbs
xmllint --xinclude --nowarning --noout --path schema --schema schema.xsd $@
diff --git a/xslt/normalize.xsl b/xslt/normalize.xsl
index 2ae8a1e1..e24907d1 100644
--- a/xslt/normalize.xsl
+++ b/xslt/normalize.xsl
@@ -40,6 +40,9 @@ If You do not accept these Terms, then You must not continue to use this Metadat
</xsl:if>
<xsl:apply-templates/>
</md:EntitiesDescriptor>
+ <xsl:if test="$target='true'">
+ <md:Extensions><xsl:call-template name="add-swamid-pi"/></md:Extensions>
+ </xsl:if>
</xsl:template>
<xsl:template match="md:EntityDescriptor">
@@ -61,7 +64,7 @@ If You do not accept these Terms, then You must not continue to use this Metadat
<md:EntityDescriptor>
<xsl:apply-templates select="@*"/>
<xsl:if test="$rpi='true' and not(md:Extensions)">
- <md:Extensions><xsl:call-template name="add-swamid-rpi"/></md:Extensions>
+ <md:Extensions><xsl:call-template name="add-swamid-ri"/></md:Extensions>
</xsl:if>
<xsl:apply-templates select="text()|comment()|md:Extensions|md:RoleDescriptor|md:IDPSSODescriptor|md:SPSSODescriptor|md:AuthnAuthorityDescriptor|md:AttributeAuthorityDescriptor|md:PDPDescriptor|md:AffiliationDescriptor"/>
<xsl:if test="$org='true' and not(md:Organization)">
@@ -78,12 +81,12 @@ If You do not accept these Terms, then You must not continue to use this Metadat
<xsl:template match="md:EntityDescriptor/md:Extensions">
<md:Extensions>
- <xsl:call-template name="add-swamid-rpi"/>
+ <xsl:call-template name="add-swamid-ri"/>
<xsl:apply-templates select="text()|comment()|node()"/>
</md:Extensions>
</xsl:template>
- <xsl:template name="add-swamid-rpi">
+ <xsl:template name="add-swamid-ri">
<xsl:if test="$rpi='true' and not(mdrpi:RegistrationInfo[@registrationAuthority='http://swamid.se/'])">
<mdrpi:RegistrationInfo registrationAuthority="http://www.swamid.se/">
<mdrpi:RegistrationPolicy xml:lang="en">http://www.swamid.se/download/18.248ad5af12aa8136533800012293/SWAMID+Metadata+Registration+Practice+Statement-20110714.pdf</mdrpi:RegistrationPolicy>
@@ -91,6 +94,14 @@ If You do not accept these Terms, then You must not continue to use this Metadat
</xsl:if>
</xsl:template>
+ <xsl:template name="add-swamid-pi">
+ <mdrpi:PublicationInfo>
+ <xsl:attribute Name="creationInstant"><xsl:value-of select="$now"/></xsl:attribute>
+ <xsl:attribute Name="publisher"><xsl:value-of select="$target"/></xsl:attribute>
+ <mdrpi:UsagePolicy xml:lang="en">https://www.sunet.se/wp-content/uploads/2015/12/SWAMID-Terms-of-Use-20110714.pdf</mdrpi:UsagePolicy>
+ </mdrpi:PublicationInfo>
+ </xsl:template>
+
<xsl:template match="@xml:base|@ID|@validUntil|@cacheDuration"/>
<xsl:template match="text()|comment()|@*">