From 67d03db1de44d1a281b1efac89918a263db14539 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Dec 2010 13:05:46 +0100 Subject: basic aggregator --- scripts/aggregate.sh | 6 ++++++ scripts/pull-and-verify.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100755 scripts/aggregate.sh create mode 100755 scripts/pull-and-verify.sh diff --git a/scripts/aggregate.sh b/scripts/aggregate.sh new file mode 100755 index 00000000..b3c8c8e9 --- /dev/null +++ b/scripts/aggregate.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +DIR=`pwd` + +$DIR/scripts/pull-and-verify.sh http://spaces.internet2.edu/Shibboleth.sso/Metadata $DIR/certs/spaces.internet2.edu.crt $1 +$DIR/scripts/pull-and-verify.sh 'https://kalmar2.org/simplesaml/module.php/aggregator/?id=kalmarcentral2&set=saml2&exclude=sweden&mimetype=application/xml' $DIR/certs/kalmar-signer.crt $1 diff --git a/scripts/pull-and-verify.sh b/scripts/pull-and-verify.sh new file mode 100755 index 00000000..3035126e --- /dev/null +++ b/scripts/pull-and-verify.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +function die() { + echo $* + exit 1 +} + +URL=$1 +CERT=$2 +DIR=$3 + +TMPF=`mktemp` +wget --no-check-certificate -O$TMPF $URL || die "Unable to download $URL: $?" +samlsign -c $CERT -f $TMPF || die "Unable to verify $URL with $CERT: $?" +TMPD=`mktemp -d` +xsltproc --stringparam output $TMPD xslt/import-metadata.xsl $TMPF || die "Unable to import metadata from $URL: $?" +rsync -avz $TMPD/ $DIR +( +echo '?xml version="1.0"?>' +echo "" +for md in $3/*.xml; do + echo "" +done +echo "" +) > $3.mxml +rm -rf $TMPF $TMPD -- cgit v1.2.3