summaryrefslogtreecommitdiff
path: root/metadata/scripts
diff options
context:
space:
mode:
authorBjörn Mattsson <bjorn@sunet.se>2023-11-06 15:12:20 +0100
committerBjörn Mattsson <bjorn@sunet.se>2023-11-06 15:12:20 +0100
commita9fa6d5551f047e976e624c1b6cc82e8c4fbb76d (patch)
treef8c0f59a36ae572e3f67045435b27e15bf9d0b44 /metadata/scripts
parentb4f5e684ecb318e10735414c683787d435bae7a5 (diff)
Cleaning up old files left after we stopped signing on mds1/2. Done by Bjorn and Jocarmd-2023-11-06-v02
Diffstat (limited to 'metadata/scripts')
-rwxr-xr-xmetadata/scripts/cert-retrieve.sh8
-rwxr-xr-xmetadata/scripts/create_mxml.sh81
-rwxr-xr-xmetadata/scripts/expiration_date.pl11
-rwxr-xr-xmetadata/scripts/pull-and-verify.sh23
-rwxr-xr-xmetadata/scripts/remove_entity.sh8
-rwxr-xr-xmetadata/scripts/rename-xml.sh44
-rw-r--r--metadata/scripts/unique_id.pl7
-rwxr-xr-xmetadata/scripts/update-cron.sh27
-rw-r--r--metadata/scripts/urls2hostport.py6
-rwxr-xr-xmetadata/scripts/verify-uiinfo-urls.sh16
10 files changed, 1 insertions, 230 deletions
diff --git a/metadata/scripts/cert-retrieve.sh b/metadata/scripts/cert-retrieve.sh
deleted file mode 100755
index 5440b0f8..00000000
--- a/metadata/scripts/cert-retrieve.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-#
-# usage: retrieve-cert.sh remote.host.name [port]
-#
-REMHOST=$1
-REMPORT=${2:-443}
-
-echo | openssl s_client -connect ${REMHOST}:${REMPORT} 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'
diff --git a/metadata/scripts/create_mxml.sh b/metadata/scripts/create_mxml.sh
deleted file mode 100755
index bb7855d5..00000000
--- a/metadata/scripts/create_mxml.sh
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/bash
-# Creates MXML files to be used in signing of Metadata
-if ! test -d swamid-2.0 ; then
- echo "Script should be run from base directory of swamid-metadata"
- exit
-fi
-
-ls swamid-2.0/ swamid-testing/ swamid-edugain | egrep -v "/:|^$" | sort | uniq -c | awk '$1 > 1 {print $2, "exists in more than one feed"}'
-
-#
-# eduGAIN
-#
-cat << EOF > swamid-edugain-idp-1.0.mxml
-<?xml version="1.0" encoding="UTF-8"?>
-<md:EntitiesDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- Name="http://md.swamid.se/md/swamid-idp-2.0.xml">
-EOF
-grep -l IDPSSO swamid-edugain/*.xml | LC_ALL=C sort | while read file; do
- echo " <xi:include href=\"$file\"/>" >> swamid-edugain-idp-1.0.mxml
-done
-echo "</md:EntitiesDescriptor>" >> swamid-edugain-idp-1.0.mxml
-
-cat << EOF > swamid-edugain-sp-1.0.mxml
-<?xml version="1.0" encoding="UTF-8"?>
-<md:EntitiesDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0">
-EOF
-grep -l SPSSO swamid-edugain/*.xml | grep -v "`grep -l IDPSSO swamid-edugain/*.xml`" | LC_ALL=C sort | while read file; do
- echo " <xi:include href=\"$file\"/>" >> swamid-edugain-sp-1.0.mxml
-done
-echo "</md:EntitiesDescriptor>" >> swamid-edugain-sp-1.0.mxml
-
-#
-# Swamid-2.0
-#
-cat << EOF > swamid-idp-2.0.mxml
-<?xml version="1.0" encoding="UTF-8"?>
-<md:EntitiesDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- Name="http://md.swamid.se/md/swamid-idp-2.0.xml">
- <xi:include href="swamid-edugain-idp-1.0.mxml" xpointer="xpointer(//*[@entityID])"/>
-
- <!-- Opt-out from eduGAIN IDP:s -->
-EOF
-grep -l IDPSSO swamid-2.0/*.xml | LC_ALL=C sort | while read file; do
- echo " <xi:include href=\"$file\"/>" >> swamid-idp-2.0.mxml
-done
-echo "</md:EntitiesDescriptor>" >> swamid-idp-2.0.mxml
-
-cat << EOF > swamid-sp-2.0.mxml
-<?xml version="1.0" encoding="UTF-8"?>
-<md:EntitiesDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:shibmeta="urn:mace:shibboleth:metadata:1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:shibmd="urn:mace:shibboleth:metadata:1.0">
- <xi:include href="swamid-edugain-sp-1.0.mxml" xpointer="xpointer(//*[@entityID])"/>
-
- <!-- Opt-out from eduGAIN SP:s -->
-EOF
-grep -l SPSSO swamid-2.0/*.xml | grep -v "`grep -l IDPSSO swamid-2.0/*.xml`" | LC_ALL=C sort | while read file; do
- echo " <xi:include href=\"$file\"/>" >> swamid-sp-2.0.mxml
-done
-echo "</md:EntitiesDescriptor>" >> swamid-sp-2.0.mxml
-
-#
-# Swamid-testing
-#
-cat << EOF > swamid-testing-idp-1.0.mxml
-<?xml version="1.0"?>
-<EntitiesDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:xi="http://www.w3.org/2001/XInclude" Name="http://md.swamid.se/md/swamid-testing-idp-1.0.xml">
-EOF
-egrep -l "AttributeAuthorityDescriptor|IDPSSODescriptor" swamid-testing/*.xml | LC_ALL=C sort | while read file; do
- echo " <xi:include href=\"$file\"/>" >> swamid-testing-idp-1.0.mxml
-done
-echo "</EntitiesDescriptor>" >> swamid-testing-idp-1.0.mxml
-
-cat << EOF > swamid-testing-sp-1.0.mxml
-<?xml version="1.0"?>
-<EntitiesDescriptor xmlns="urn:oasis:names:tc:SAML:2.0:metadata" xmlns:xi="http://www.w3.org/2001/XInclude" Name="http://md.swamid.se/md/swamid-testing-sp-1.0.xml">
-EOF
-grep -l SPSSO swamid-testing/*.xml | grep -v "`egrep -l "AttributeAuthorityDescriptor|IDPSSODescriptor" swamid-testing/*.xml`" | LC_ALL=C sort | while read file; do
- echo " <xi:include href=\"$file\"/>" >> swamid-testing-sp-1.0.mxml
-done
-echo "</EntitiesDescriptor>" >> swamid-testing-sp-1.0.mxml
diff --git a/metadata/scripts/expiration_date.pl b/metadata/scripts/expiration_date.pl
deleted file mode 100755
index cf297c5f..00000000
--- a/metadata/scripts/expiration_date.pl
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/usr/bin/env perl
-
-use Date::Calc qw/Today_and_Now Add_Delta_Days/;
-my $delta = $ARGV[0];
-$delta = 30 unless $delta;
-
-($year,$month,$day,$hour,$min,$sec) = Today_and_Now();
-($year,$month,$day) = Add_Delta_Days($year,$month,$day,$delta);
-my $date = sprintf "%s-%02d-%02dT%02d:%02d:%02dZ",$year,$month,$day,$hour,$min,$sec;
-print $date;
-
diff --git a/metadata/scripts/pull-and-verify.sh b/metadata/scripts/pull-and-verify.sh
index 8994fab1..1e89d0f0 100755
--- a/metadata/scripts/pull-and-verify.sh
+++ b/metadata/scripts/pull-and-verify.sh
@@ -4,12 +4,6 @@ URL=$1
DIR=$2
CERT=$3
-if echo "$DIR" | grep -q "mds.swamid.se" ; then
- publish_name=mds.swamid.se
-else
- publish_name=md.swamid.se
-fi
-
TMPF=`mktemp`
curl -s -m 120 -k -L $URL > $TMPF
if [ $? -ne 0 ]; then
@@ -18,7 +12,6 @@ if [ $? -ne 0 ]; then
fi
if [ "x$CERT" != "x" ]; then
xmlsec1 --verify --pubkey-cert-pem $CERT --id-attr:ID urn:oasis:names:tc:SAML:2.0:metadata:EntitiesDescriptor $TMPF
- #samlsign -c $CERT -f $TMPF
if [ $? -ne 0 ]; then
echo "Unable to verify $URL with $CERT: $?"
exit 1
@@ -31,20 +24,4 @@ if [ $? -ne 0 ]; then
exit 1
fi
rsync -avz $TMPD/ $DIR
-(
-echo '<?xml version="1.0"?>'
-echo "<EntitiesDescriptor xmlns=\"urn:oasis:names:tc:SAML:2.0:metadata\" xmlns:xi=\"http://www.w3.org/2001/XInclude\" Name=\"http://$publish_name/md/$DIR.xml\">"
-T=`mktemp`
-for md in $DIR/*.xml; do
- xsltproc xslt/clean-entitydescriptor.xsl $md > $T && mv $T $md
- test=`echo $md | cut -d/ -f2-`
- if [ ! -f "swamid-2.0/$test" -a ! -f "swamid-edugain/$test" ]; then
- echo "<xi:include href=\"$md\"/>"
- fi
-done
-rm -f $T
-echo "</EntitiesDescriptor>"
-) > $DIR.mxml
-#git add $DIR.mxml $DIR
-#git commit -m "$URL into $DIR" $DIR.mxml $DIR
rm -rf $TMPF $TMPD
diff --git a/metadata/scripts/remove_entity.sh b/metadata/scripts/remove_entity.sh
index 60645a7e..4906bf88 100755
--- a/metadata/scripts/remove_entity.sh
+++ b/metadata/scripts/remove_entity.sh
@@ -40,7 +40,7 @@ file=$(find swamid-testing swamid-2.0 swamid-edugain -name "$entityidfn" | head
if [ -r "$file" ]; then
echo "---------------------"
- grep "$file" ./*.mxml
+ echo "$file"
echo "---------------------"
echo -n "OK to remove ? [Y/n]"
read -r x
@@ -52,12 +52,6 @@ if [ -r "$file" ]; then
echo
git rm "$file"
- grep "$file" ./*.mxml | sed 's/\(.*\.mxml\): <xi:include href=".*"\/>/\1/' | while read -r mxmlfile ; do
- sed -i.bak "/\/$entityidfn/d" "$mxmlfile"
- if [ -f "$mxmlfile".bak ]; then
- rm "$mxmlfile".bak
- fi
- done
git diff
git status
else
diff --git a/metadata/scripts/rename-xml.sh b/metadata/scripts/rename-xml.sh
deleted file mode 100755
index 4326579f..00000000
--- a/metadata/scripts/rename-xml.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/bash
-#
-# Fetch Service Provider metadata and save into entityid filename
-#
-
-error()
-{
- echo "Error: $*" 1>&2
- exit 1
-}
-
-metadata=$1
-if [ -z "$metadata" ] ; then
- cat <<EOF
-Usage: `basename $0` <file to check>
-Ex: `basename $0` account.eciu.eu.xml
-EOF
- exit 1
-fi
-
-entityid=`cat "$metadata" | sed -n 's/.*entityID=['\''"]\([^"]*\)['\''"].*/\1/p'`
-[ -n "$entityid" ] || error "Failed to find entityID in metadata"
-[ `echo "$entityid" | wc -l` = 1 ] || error "Multiple entityid:s found: `echo $entityid`"
-
-entityidfn=`echo "$entityid" | sed 's;https*://;;' | sed 's/[^a-zA-Z0-9_.-]/-/g' | sed 's/$/.xml/'`
-[ -n "$entityidfn" ] || error "Failed to generate filename from entityid $entityid"
-
-[ -r "$entityidfn" ] && new=false || new=true
-if $new ; then
- echo -n "Move $metadata into $entityidfn [Y/n]? "
-else
- echo "$entityidfn and $metadata are the same"
- exit
-fi
-read x
-case $x in
- Y|y|"")
- git mv $metadata $entityidfn
-
- ;;
- *)
- echo "Nothing done"
- ;;
-esac
diff --git a/metadata/scripts/unique_id.pl b/metadata/scripts/unique_id.pl
deleted file mode 100644
index 18ec9e13..00000000
--- a/metadata/scripts/unique_id.pl
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env perl
-
-use Date::Calc qw/Today_and_Now/;
-
-($year,$month,$day,$hour,$min,$sec) = Today_and_Now();
-print sprintf "swamid%s%02d%02dT%02d%02d%02dZ",$year,$month,$day,$hour,$min,$sec;
-
diff --git a/metadata/scripts/update-cron.sh b/metadata/scripts/update-cron.sh
deleted file mode 100755
index 8f9ed813..00000000
--- a/metadata/scripts/update-cron.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/sh
-
-update()
-{
- #echo "git pull"
- #git pull || return $?
- #echo
-
- echo "make aggregate"
- make aggregate || return $?
- echo
-
- echo "make (2007) web site for backwards compat"
- env SWAMID_MK_CONFIG=swamid2007.mk make web || return $?
- echo
-
- echo "make (2016)"
- env SWAMID_MK_CONFIG=swamid2016.mk make || return $?
- echo
-
- #echo "make (2016 - test)"
- #env SWAMID_MK_CONFIG=swamid2016-test.mk make # Allow this to fail
- #echo
-}
-
-cd /opt/metadata || exit 1
-update
diff --git a/metadata/scripts/urls2hostport.py b/metadata/scripts/urls2hostport.py
deleted file mode 100644
index c4ff33bf..00000000
--- a/metadata/scripts/urls2hostport.py
+++ /dev/null
@@ -1,6 +0,0 @@
-
-import sys
-from urlparse import urlparse
-for url in sys.stdin:
- o = urlparse(url)
- print o.netloc
diff --git a/metadata/scripts/verify-uiinfo-urls.sh b/metadata/scripts/verify-uiinfo-urls.sh
deleted file mode 100755
index b7e1f40a..00000000
--- a/metadata/scripts/verify-uiinfo-urls.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-
-x=$1
-if [ ! -f "$x" ]; then
- exit
-fi
-
-for i in `cat $x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath /EntityDescriptor//Extensions/UIInfo - 2>/dev/null |grep -E "https?://" | awk -F'[><]' '{print $3}' | sort -u`; do
- code=`curl -L --connect-timeout 5 --retry 2 -o /dev/null --silent --head --write-out '%{http_code}\n' $i`
- if [ $code -eq 405 ]; then
- code=`curl -L --connect-timeout 5 --retry 2 -o /dev/null --silent --write-out '%{http_code}\n' $i`
- fi
- if [ $code -ne 200 ]; then
- echo " Code $code: $x: $i" | sed 's/.*/&/'
- fi
-done