-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'upstream' for incommon v11
- Loading branch information
Showing
118 changed files
with
3,957 additions
and
514 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env perl | ||
|
||
# | ||
# requestedattribute.pl | ||
# | ||
# Extracts statistics about SPs with RequestedAttribute elements from the published metadata. | ||
# | ||
use warnings; | ||
use lib "."; | ||
use Months; | ||
|
||
# Parse command line arguments | ||
use Getopt::Long; | ||
my $allMonths; | ||
my $oneYear; | ||
GetOptions('all' => \$allMonths, 'year' => \$oneYear); | ||
|
||
# By default, only show results for the most recent month | ||
if ($allMonths) { | ||
# leave table intact | ||
} elsif ($oneYear) { | ||
# reduce months table to just the last 12 entries | ||
@months = @months[-12..-1]; | ||
} else { | ||
# reduce months table to one element | ||
@months = @months[-1..-1]; | ||
} | ||
|
||
# print header. must be kept in sync with what comes out of requestedattribute.xsl | ||
print "# month, number of SPs, number with AttributeConsumingService, percent with ACS\n"; | ||
|
||
# ingest files | ||
foreach $month (@months) { | ||
my $fn = "cache/$month.xml"; | ||
open(TXT, "xsltproc requestedattribute.xsl $fn|") || die "could not open input file"; | ||
($sps, $acs) = split /\t/, <TXT>; | ||
chomp $acs; | ||
$proportion = 0; | ||
if ( $sps > 0 ) { $proportion = int (100 * $acs / $sps) ; } | ||
print "${month}\t${sps}\t${acs}\t${proportion}\n"; | ||
close TXT; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
requestedattribute.xsl | ||
Takes a metadata aggregate and gives statistics about RequestedAttribute | ||
elements in UKf-registered SPs. | ||
Note that UKf metadata started using mdrpi:RegistrationInfo in 2012-09 | ||
so statistics before that date cannot be generated by this script. | ||
--> | ||
<xsl:stylesheet | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
version="1.0"> | ||
|
||
<xsl:output method="text" omit-xml-declaration="yes"/> | ||
|
||
<xsl:template match="/md:EntitiesDescriptor"> | ||
|
||
<xsl:variable name="sps" select="//md:EntityDescriptor | ||
[descendant::mdrpi:RegistrationInfo/@registrationAuthority='http://ukfederation.org.uk'] | ||
[md:SPSSODescriptor] | ||
"/> | ||
<xsl:variable name="ACS" select="count($sps[md:SPSSODescriptor/md:AttributeConsumingService])"/> | ||
|
||
<xsl:value-of select="count($sps)"/> | ||
<xsl:text>	</xsl:text> | ||
<xsl:value-of select="$ACS"/> | ||
<xsl:text> </xsl:text> | ||
|
||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Checking ruleset for elements with duplicate xml:lang | ||
Originally reported in https://issues.shibboleth.net/jira/browse/IDP-1647 | ||
"Error with duplicate <ServiceDescription> with same xml:lang in the metadata" | ||
This set of checks is for all appropriate elements in the namespace | ||
urn:oasis:names:tc:SAML:2.0:metadata | ||
--> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
xmlns:set="http://exslt.org/sets" | ||
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"/> | ||
|
||
<!-- | ||
Check for uniqueness within an AttributeConsumingService element | ||
--> | ||
<xsl:template match="md:AttributeConsumingService"> | ||
<!-- unique xml:lang over ServiceName elements --> | ||
<xsl:call-template name="uniqueLang"> | ||
<xsl:with-param name="e" select="md:ServiceName"/> | ||
</xsl:call-template> | ||
|
||
<!-- unique xml:lang over ServiceDescription elements --> | ||
<xsl:call-template name="uniqueLang"> | ||
<xsl:with-param name="e" select="md:ServiceDescription"/> | ||
</xsl:call-template> | ||
|
||
<!-- handle individual elements --> | ||
<xsl:apply-templates select="*"/> | ||
</xsl:template> | ||
|
||
<!-- | ||
Check for uniqueness within an Organization element | ||
--> | ||
<xsl:template match="md:Organization"> | ||
<!-- unique xml:lang over OrganizationName elements --> | ||
<xsl:call-template name="uniqueLang"> | ||
<xsl:with-param name="e" select="md:OrganizationName"/> | ||
</xsl:call-template> | ||
|
||
<!-- unique xml:lang over OrganizationDisplayName elements --> | ||
<xsl:call-template name="uniqueLang"> | ||
<xsl:with-param name="e" select="md:OrganizationDisplayName"/> | ||
</xsl:call-template> | ||
|
||
<!-- handle individual elements --> | ||
<xsl:apply-templates select="*"/> | ||
</xsl:template> | ||
|
||
<xsl:template name="uniqueLang"> | ||
<xsl:param name="e"/> | ||
<xsl:variable name="l" select="$e/@xml:lang"></xsl:variable> | ||
<xsl:variable name="u" select="set:distinct($l)"/> | ||
<xsl:if test="count($l) != count($u)"> | ||
<xsl:call-template name="error"> | ||
<xsl:with-param name="m"> | ||
<xsl:text>non-unique lang values on </xsl:text> | ||
<xsl:value-of select="name($e)"/> | ||
<xsl:text> elements</xsl:text> | ||
</xsl:with-param> | ||
</xsl:call-template> | ||
</xsl:if> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
Oops, something went wrong.