diff --git a/utilities/2017-02-27/README.md b/utilities/2017-02-27/README.md new file mode 100644 index 00000000..c56e45ef --- /dev/null +++ b/utilities/2017-02-27/README.md @@ -0,0 +1,38 @@ +# `utilities/2017-02-27` + +Scripts to replace the HideFromWAYF element in entity fragment files +with the REFEDS Hide from Discovery Entity Category. + +## 1. Check that no hidden IdPs have Entity Attributes already + +Since there can only be a single Entity Attribute element in an entity fragment file, +we first check that there are no hidden IdPs that already have an Entity Attributes +element. If there are (and there are not too many) we edit these files manually. + +Run the script on the entity fragment files: `xsltproc listHideFromWAYFandEA.xsl uk*.xml` + +## 2. Replace HideFromWAYF element with hide-from-disco Entity Category + +This command replaces the HideFromWAYF element with an Entity Attributes element +containing the REFEDS hide-from-disco entity category: + +`replaceHideFromWAYF.pl uk*.xml` + +It presumes that the `saml` and `mdattr` namespace prefixes are already defined in the +entity fragment files. + +The perl regex matches the string HideFromWAYF rather than an XML element, so check +that transform has only modified the HideFromWAYF element by generating unsigned +aggregates before and after the transform and and looking at the differences. +The only changes should be the timestamp and quantities derived from the timestamp. +There is a small possibility that the generate target imports different entities from +eduGAIN -- these differences can be ignored. + +``` +ant samlmd.aggregates.generate +cp ukfederation-metadata.xml /tmp/ +replaceHideFromWAYF.pl uk*.xml +ant samlmd.aggregates.generate +diff ukfederation-metadata.xml /tmp/ +``` + diff --git a/utilities/2017-02-27/listHideFromWAYFandEA.xsl b/utilities/2017-02-27/listHideFromWAYFandEA.xsl new file mode 100644 index 00000000..fcd27029 --- /dev/null +++ b/utilities/2017-02-27/listHideFromWAYFandEA.xsl @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + diff --git a/utilities/2017-02-27/replaceHideFromWAYF.pl b/utilities/2017-02-27/replaceHideFromWAYF.pl new file mode 100755 index 00000000..32356fed --- /dev/null +++ b/utilities/2017-02-27/replaceHideFromWAYF.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl -wni + +# If line contains HideFromWAYF, replace it with the Entity Category +if (/HideFromWAYF/) { + print < + + http://refeds.org/category/hide-from-discovery + + +EOF +# and don't print the line containing HideFromWAYF + next; +} + +# If the line didn't have HideFromWAYF, print it unchanged +print; +