Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
iay committed Dec 6, 2016
2 parents 865601a + dfbdd97 commit 9072031
Show file tree
Hide file tree
Showing 96 changed files with 2,329 additions and 778 deletions.
499 changes: 299 additions & 200 deletions build.xml

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions charting/by_registrar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from xml.dom.minidom import parse
from urllib import urlopen
from datetime import date
import sys

REGISTRAR_NAME = {

Expand Down Expand Up @@ -76,11 +77,14 @@ def display(infile, split):
print "%10s: %d" % (e[0], e[1])
print "%10s: %d" % ("other", sum([e[1] for e in rest_counts]))

cache_file = date.today().strftime("cache/%Y-%m.xml")
print "Most recent monthly UK federation production aggregate (%s):" % (cache_file)
display(cache_file, 9)
if len(sys.argv) == 2:
display(sys.argv[1], 9)
else:
cache_file = date.today().strftime("cache/%Y-%m.xml")
print "Most recent monthly UK federation production aggregate (%s):" % (cache_file)
display(cache_file, 9)

print
print

print "Current eduGAIN production aggregate:"
display(urlopen("http://mds.edugain.org/"), 9)
print "Current eduGAIN production aggregate:"
display(urlopen("http://mds.edugain.org/"), 9)
25 changes: 16 additions & 9 deletions charting/fetch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,30 @@
use File::stat;
use Months;

$fn = '../xml/ukfederation-metadata.xml';
$fn2 = '../xml/ukfederation-stats.html';
# Call git on the products directory
my $git = "/usr/bin/env git -C ../../ukf-products";

$fn1 = 'aggregates/ukfederation-metadata.xml';
$fn2 = 'aggregates/ukfederation-stats.html';

foreach $month (@months) {
print "Fetching $month...";


# Find the commit immediately prior to the start of that month.
my $instant = "$month-01T00:00:00Z";
my $commit = `$git rev-list -n 1 --before=$instant master`;
chomp $commit;
print "$commit";

my $dest1 = "cache/$month.xml";
if (!-e $dest1) {
system("/usr/bin/env svn update $fn --quiet --revision \\{$month-01T00:00:00Z\\}");
system("cp $fn $dest1");
system("$git show $commit:$fn1 >$dest1");
}

my $dest2 = "cache/$month.html";
if (!-e $dest2) {
system("/usr/bin/env svn update $fn2 --quiet --revision \\{$month-01T00:00:00Z\\}");
system("cp $fn2 $dest2");
system("$git show $commit:$fn2 >$dest2");
}

print "\n";
}
36 changes: 36 additions & 0 deletions charting/mdui.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env perl -w

#
# mdui.pl
#
use lib "../build";
use Xalan;
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];
}

# ingest files
foreach $month (@months) {
print "Processing $month\n";

my $command = xalanCall . " -IN cache/$month.xml -XSL statistics_mdui.xsl";
# print "command is $command\n";
system($command); # || print "ignoring claimed failure in sub command\n";
# print "Xalan run on $fn\n";
print "\n";
}
20 changes: 15 additions & 5 deletions charting/saml2.pl
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,21 @@
open(TXT, xalanCall . " -IN $fn -XSL saml2.xsl|") || die "could not open input file";
$_ = <TXT>;
chop;
# print "$month: $_\n";
my ($entities, $idps, $sps, $saml2total, $saml2idp, $saml2sp) = split;
push @overallRatio, $saml2total/$entities;
push @idpRatio, $saml2idp/$idps;
push @spRatio, $saml2sp/$sps;
push @product, ($saml2idp/$idps)*($saml2sp/$sps);
if ($entities == 0) {
# print "skipping $month: $_\n";
next;
}
my $mPrefix = $allMonths ? "$month: " : '';
my $oRatio = $saml2total/$entities;
push @overallRatio, "$mPrefix$oRatio";
my $iRatio = $saml2idp/$idps;
push @idpRatio, "$mPrefix$iRatio";
my $sRatio = $saml2sp/$sps;
push @spRatio, "$mPrefix$sRatio";
my $p = ($saml2idp/$idps)*($saml2sp/$sps);
push @product, "$mPrefix$p";
close TXT;
}

Expand All @@ -55,4 +65,4 @@
print "$ratio\n";
}

1;
1;
19 changes: 13 additions & 6 deletions charting/scopes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@
# Parse command line arguments
use Getopt::Long;
my $allMonths;
GetOptions('all' => \$allMonths);
my $oneYear;
GetOptions('all' => \$allMonths, 'year' => \$oneYear);

# By default, only show results for the most recent month
if (!$allMonths) {
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
my $oneMonth = pop @months;
@months = ( $oneMonth );
@months = @months[-1..-1];
}

# ingest files
Expand All @@ -31,7 +36,9 @@
my $scope = $_;
$scopes{$scope} = 1;
}
push @count, scalar(keys(%scopes));
my $prefix = scalar(@months) == 1 ? '' : "$month: ";
my $c = scalar(keys(%scopes));
push @count, "$prefix$c";
close TXT;
}

Expand All @@ -40,4 +47,4 @@
print "$n\n";
}

1;
1;
13 changes: 9 additions & 4 deletions charting/sizes.pl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@
# Parse command line arguments
use Getopt::Long;
my $allMonths;
GetOptions('all' => \$allMonths);
my $oneYear;
GetOptions('all' => \$allMonths, 'year' => \$oneYear);

# By default, only show results for the most recent month
if (!$allMonths) {
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
my $oneMonth = pop @months;
@months = ( $oneMonth );
@months = @months[-1..-1];
}

# ingest files
Expand Down
52 changes: 27 additions & 25 deletions build/statistics_mdui.xsl → charting/statistics_mdui.xsl
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
statistics_mdui.xsl
XSL stylesheet taking a metadata aggregate and giving some statistics about MDUI
element use as textual output.
Author: Ian A. Young <ian@iay.org.uk>
-->
<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:mdui="urn:oasis:names:tc:SAML:metadata:ui"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:math="http://exslt.org/math"
Expand All @@ -22,111 +23,112 @@
version="1.0">

<xsl:output method="text" omit-xml-declaration="yes"/>

<xsl:template match="/md:EntitiesDescriptor">

<xsl:variable name="entities" select="//md:EntityDescriptor"/>

<xsl:variable name="entities" select="//md:EntityDescriptor
[descendant::mdrpi:RegistrationInfo/@registrationAuthority='http://ukfederation.org.uk']"/>
<xsl:variable name="idps" select="$entities[md:IDPSSODescriptor]"/>
<xsl:variable name="sps" select="$entities[md:SPSSODescriptor]"/>

<xsl:call-template name="entities.category">
<xsl:with-param name="category">Total entities</xsl:with-param>
<xsl:with-param name="entities" select="$entities"/>
</xsl:call-template>

<xsl:call-template name="entities.category">
<xsl:with-param name="category">Identity providers</xsl:with-param>
<xsl:with-param name="entities" select="$idps"/>
</xsl:call-template>

<xsl:call-template name="entities.category">
<xsl:with-param name="category">Service providers</xsl:with-param>
<xsl:with-param name="entities" select="$sps"/>
</xsl:call-template>

</xsl:template>

<xsl:template name="entities.category">
<xsl:param name="entities"/>
<xsl:param name="category"/>
<xsl:variable name="entities.count" select="count($entities)"/>

<xsl:value-of select="$category"/>
<xsl:text>: </xsl:text>
<xsl:value-of select="$entities.count"/>
<xsl:text>&#10;</xsl:text>

<xsl:if test="$entities.count > 0">

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:UIInfo</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:UIInfo]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:Logo</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:Logo]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:Description</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:Description]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:DisplayName</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:DisplayName]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:Keywords</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:Keywords]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:InformationURL</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:InformationURL]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:PrivacyStatementURL</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:PrivacyStatementURL]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:DiscoHints</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:DiscoHints]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:IPHint</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:IPHint]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:DomainHint</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:DomainHint]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

<xsl:call-template name="mdui.element">
<xsl:with-param name="element">mdui:GeolocationHint</xsl:with-param>
<xsl:with-param name="has" select="$entities[descendant::mdui:GeolocationHint]"/>
<xsl:with-param name="total.count" select="$entities.count"/>
</xsl:call-template>

</xsl:if>
</xsl:template>

<xsl:template name="mdui.element">
<xsl:param name="element"/>
<xsl:param name="has"/>
Expand All @@ -142,5 +144,5 @@
<xsl:text>)&#10;</xsl:text>
</xsl:if>
</xsl:template>

</xsl:stylesheet>
10 changes: 10 additions & 0 deletions macosx.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@
# those defined in default.properties, but may be overridden by
# properties defined in a machine-specific build.properties file.
#

#
# Location of the PKCS#11 configuration file for OpenSC on Mac OS X.
#
sign.uk.pkcs11Config = ${basedir}/mdx/uk/opensc-mac.cfg

#
# Signing key alias within the keystore.
#
sign.uk.keyAlias = key10
Loading

0 comments on commit 9072031

Please sign in to comment.