-
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.
- Loading branch information
Showing
2 changed files
with
108 additions
and
0 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #!/usr/bin/perl -w | ||
|
|
||
| # | ||
| # trust.pl | ||
| # | ||
| # Extracts statistics about trust model support from the published metadata. | ||
| # | ||
| use lib "../build"; | ||
| use Xalan; | ||
| use Months; | ||
|
|
||
| # ingest files | ||
| foreach $month (@months) { | ||
| my $fn = "cache/$month.xml"; | ||
| open(TXT, xalanCall . " -IN $fn -XSL trust.xsl|") || die "could not open input file"; | ||
| $_ = <TXT>; | ||
| chop; | ||
| my ($entities, $idps, $sps, $dk_total, $dk_idp, $dk_sp, $pk_total, $pk_idp, $pk_sp) = split; | ||
| push @overallRatio, $dk_total/$entities; | ||
| push @idpRatio, $dk_idp/$idps; | ||
| push @spRatio, $dk_sp/$sps; | ||
| push @PKoverallRatio, $pk_total/$entities; | ||
| push @PKidpRatio, $pk_idp/$idps; | ||
| push @PKspRatio, $pk_sp/$sps; | ||
| close TXT; | ||
| } | ||
|
|
||
| print "idp\n"; | ||
| foreach $ratio (@idpRatio) { | ||
| print "$ratio\n"; | ||
| } | ||
|
|
||
| print "sp\n"; | ||
| foreach $ratio (@spRatio) { | ||
| print "$ratio\n"; | ||
| } | ||
|
|
||
| print "overall\n"; | ||
| foreach $ratio (@overallRatio) { | ||
| print "$ratio\n"; | ||
| } | ||
|
|
||
| print "PKidp\n"; | ||
| foreach $ratio (@PKidpRatio) { | ||
| print "$ratio\n"; | ||
| } | ||
|
|
||
| print "PKsp\n"; | ||
| foreach $ratio (@PKspRatio) { | ||
| print "$ratio\n"; | ||
| } | ||
|
|
||
| print "PKoverall\n"; | ||
| foreach $ratio (@PKoverallRatio) { | ||
| print "$ratio\n"; | ||
| } | ||
|
|
||
| 1; |
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,50 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| trust.xsl | ||
| XSL stylesheet that takes a SAML 2.0 metadata file and extracts | ||
| statistics about the different trust models used within the | ||
| included entities. | ||
| Author: Ian A. Young <ian@iay.org.uk> | ||
| --> | ||
| <xsl:stylesheet version="1.0" | ||
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| xmlns:ds="http://www.w3.org/2000/09/xmldsig#" | ||
| xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| exclude-result-prefixes="md"> | ||
|
|
||
| <!-- Output is plain text --> | ||
| <xsl:output method="text"/> | ||
|
|
||
| <xsl:template match="md:EntitiesDescriptor"> | ||
| <xsl:variable name="entities" select="//md:EntityDescriptor"/> | ||
| <xsl:value-of select="count($entities)"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:variable name="idps" select="$entities[md:IDPSSODescriptor]"/> | ||
| <xsl:value-of select="count($idps)"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:variable name="sps" select="$entities[md:SPSSODescriptor]"/> | ||
| <xsl:value-of select="count($sps)"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:value-of select="count($entities[descendant::ds:X509Data])"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:value-of select="count($idps[descendant::ds:X509Data])"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:value-of select="count($sps[descendant::ds:X509Data])"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:value-of select="count($entities[descendant::ds:KeyName])"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:value-of select="count($idps[descendant::ds:KeyName])"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:value-of select="count($sps[descendant::ds:KeyName])"/> | ||
| <xsl:text> </xsl:text> | ||
| </xsl:template> | ||
|
|
||
| <xsl:template match="text()"> | ||
| <!-- do nothing --> | ||
| </xsl:template> | ||
| </xsl:stylesheet> |