Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Latest commit b171fdf Apr 16, 2024 History
From commit hash ukf/ukf-testbed/dc8075c2e363823cf8bd9ea1fa286be51e007435

See ukf/ukf-meta#416 for details
1 contributor

Users who have contributed to this file

70 lines (55 sloc) 2.53 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
check_mdattr.xsl
Checking ruleset containing rules associated with the SAML V2.0 Metadata
Extension for Entity Attributes Version 1.0, see:
https://wiki.oasis-open.org/security/SAML2MetadataAttr
This ruleset reflects Committee Specification 01, 04-Aug-2009.
Author: Ian A. Young <ian@iay.org.uk>
-->
<xsl:stylesheet version="1.0"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdattr="urn:oasis:names:tc:SAML:metadata:attribute"
xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
<!--
Common support functions.
-->
<xsl:import href="check_framework.xsl"/>
<!--
Section 2.3
The specification only defines the meaning of EntityAttributes within the Extensions of either
EntitiesDescriptor or EntityDescriptor.
-->
<xsl:template match="mdattr:EntityAttributes[not(parent::md:Extensions)]">
<xsl:call-template name="error">
<xsl:with-param name="m">EntityAttributes must only appear within an Extensions element</xsl:with-param>
</xsl:call-template>
</xsl:template>
<xsl:template match="md:Extensions[mdattr:EntityAttributes]
[not(parent::md:EntityDescriptor or parent::md:EntitiesDescriptor)]">
<xsl:call-template name="error">
<xsl:with-param name="m">EntityAttributes must only appear within Extensions of EntityDescriptor or EntitiesDescriptor</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!--
Section 2.3 line 176.
Assertions not permitted in the context of an EntitiesDescriptor.
-->
<xsl:template match="md:EntitiesDescriptor/md:Extensions/mdattr:EntityAttributes/saml:Assertion">
<xsl:call-template name="error">
<xsl:with-param name="m">Assertion may not appear in the EntityAttributes for an EntitiesDescriptor</xsl:with-param>
</xsl:call-template>
</xsl:template>
<!--
Section 2.3 line 182.
EntityAttributes MUST NOT appear more than once within a given <md:Extensions> element.
-->
<xsl:template match="md:Extensions/mdattr:EntityAttributes[position()>1]">
<xsl:call-template name="error">
<xsl:with-param name="m">more than one EntityAttributes element in an Extensions element</xsl:with-param>
</xsl:call-template>
</xsl:template>
</xsl:stylesheet>