summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFredrik Domeij <fredrik.domeij@umu.se>2020-10-13 15:22:07 +0200
committerFredrik Domeij <fredrik.domeij@umu.se>2020-10-13 15:22:07 +0200
commit40f968a07444eaf361baf892ee3ae9668c6a2de3 (patch)
tree6d4c1d97a636948157a8e4bf969c3b3417d78521 /Makefile
parent9be271e6cb892833f8716961d986d50e0d907075 (diff)
test all entites with CoCo, not only those exported to edugain
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile58
1 files changed, 33 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index f5d67ded..97002e1b 100644
--- a/Makefile
+++ b/Makefile
@@ -130,31 +130,39 @@ testRefedsRnS:
done
testGeantCoCo:
- @echo "Checking for Geant CoCo compliance for entities exported to eduGAIN"
- @for x in `cat swamid-edugain-*.mxml | grep -v "\.mxml$$" | grep "xi:include" | awk -F\" '{print $$2}' | xargs grep -l SPSSODescriptor` ; do \
- got_geant_CoCo=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/Extensions/EntityAttributes/Attribute[@Name='http://macedir.org/entity-category']/AttributeValue" - 2>/dev/null | grep 'http://www.geant.net/uri/dataprotection-code-of-conduct/v1'` ; \
- if [ -n "$$got_geant_CoCo" ] ; then \
- mdui_check=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo" - 2>/dev/null` ; \
- if [ -z "$$mdui_check" ] ; then \
- echo " $$x: Missing MDUI." | sed 's/.*/&/' ; \
- else \
- mdui_DisplayName=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/DisplayName" - 2>/dev/null | grep 'DisplayName'` ; \
- if [ -z "$$mdui_DisplayName" ] ; then echo " $$x: Missing mdui:DisplayName." | sed 's/.*/&/' ; fi ; \
- mdui_Descr=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/DisplayName" - 2>/dev/null | grep 'DisplayName'` ; \
- if [ -z "$$mdui_Descr" ] ; then echo " $$x: Missing mdui:Description." | sed 's/.*/&/' ; fi ; \
- for y in `cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo" - | grep -v "UIInfo" | awk '{print $$1}' | cut -c2- | sort -u` ; do \
- mdui_Test=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/$$y" - 2>/dev/null | grep $$y | grep 'xml:lang="en"'` ; \
- if [ -z "$$mdui_Test" ] ; then echo " $$x: Missing xml:lang=\"en\" on mdui:$$y." | sed 's/.*/&/' ; fi ; \
- done ; \
- mdui_PrivacyStatementURL=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/PrivacyStatementURL" - 2>/dev/null | grep 'PrivacyStatementURL' | sed 's/&amp;/\&/g'` ; \
- if [ -z "$$mdui_PrivacyStatementURL" ] ; then echo " $$x: Missing PrivacyStatementURL." | sed 's/.*/&/' ; \
- else \
- echo $$mdui_PrivacyStatementURL | sed 's/></>\n</g' | sed 's/.*\ \(xml:lang=.*\)>\(.*\)<.*/\1 \2/' | while read lang url ; do curl -A 'Mozilla' -s -L -m 5 $$url | grep http://www.geant.net/uri/dataprotection-code-of-conduct/v1 -q || echo " $$x missing link to geant.net in PrivacyStatementURL $$lang" | sed 's/.*/&/' ; done ; \
- fi ; \
- fi ; \
- requestedAttribute=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/AttributeConsumingService/RequestedAttribute" - 2>/dev/null | grep 'RequestedAttribute'` ; \
- if [ -z "$$requestedAttribute" ] ; then echo " $$x: Missing RequestedAttribute." | sed 's/.*/&/' ; fi ; \
- fi ; \
+ @echo "Checking for Geant CoCo compliance"
+ @for x in `cat swamid-edugain-sp-1.0.mxml swamid-edugain-testing-1.0.mxml swamid-sp-2.0.mxml swamid-testing-sp-1.0.mxml | grep -v "\.mxml$$" | grep "xi:include" | awk -F\" '{print $$2}' | xargs grep -l SPSSODescriptor | sort` ; do \
+ got_geant_CoCo=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/Extensions/EntityAttributes/Attribute[@Name='http://macedir.org/entity-category']/AttributeValue" - 2>/dev/null | grep 'http://www.geant.net/uri/dataprotection-code-of-conduct/v1'` ; \
+ if [ -n "$$got_geant_CoCo" ] ; then \
+ ( \
+ mdui_check=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo" - 2>/dev/null` ; \
+ if [ -z "$$mdui_check" ] ; then \
+ echo " Missing MDUI"'' ; \
+ else \
+ mdui_DisplayName=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/DisplayName" - 2>/dev/null | grep 'DisplayName'` ; \
+ if [ -z "$$mdui_DisplayName" ] ; then echo " Missing mdui:DisplayName"'' ; fi ; \
+ mdui_Descr=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/DisplayName" - 2>/dev/null | grep 'DisplayName'` ; \
+ if [ -z "$$mdui_Descr" ] ; then echo " Missing mdui:Description"'' ; fi ; \
+ for y in `cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo" - | grep -v "UIInfo" | awk '{print $$1}' | cut -c2- | sort -u` ; do \
+ mdui_Test=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/$$y" - 2>/dev/null | grep $$y | grep 'xml:lang="en"'` ; \
+ if [ -z "$$mdui_Test" ] ; then echo " Missing xml:lang=\"en\" on mdui:$$y"'' ; fi ; \
+ done ; \
+ mdui_PrivacyStatementURL=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/PrivacyStatementURL" - 2>/dev/null | grep 'PrivacyStatementURL' | sed 's/&amp;/\&/g'` ; \
+ if [ -z "$$mdui_PrivacyStatementURL" ] ; then \
+ echo " Missing PrivacyStatementURL"'' ; \
+ else \
+ if ! echo "$$mdui_PrivacyStatementURL" | grep -q 'xml:lang="en"' ; then \
+ echo " Missing PrivacyStatementURL in english"'' ; \
+ fi ; \
+ echo "$$mdui_PrivacyStatementURL" | sed 's/></>\n</g' | sed 's/.*\ \(xml:lang=.*\)>\(.*\)<.*/\1 \2/' | while read lang url ; do \
+ curl -A 'Mozilla' -s -L -m 5 "$$url" < /dev/null | grep "https*://www.geant.net/uri/dataprotection-code-of-conduct/v1" > /dev/null || echo " Missing link to geant.net/code-of-conduct/v1 in PrivacyStatementURL $$lang ($$url)" ; \
+ done ; \
+ fi ; \
+ fi ; \
+ requestedAttribute=`cat $$x | sed 's;\(</*\)[a-z0-9]*:;\1;g' | sed 's/xmlns="[^"]*"//' | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/AttributeConsumingService/RequestedAttribute" - 2>/dev/null | grep 'RequestedAttribute'` ; \
+ if [ -z "$$requestedAttribute" ] ; then echo " Missing RequestedAttribute"'' ; fi ; \
+ ) | sed "1s;..*; [1\;31m$$x\n&;" | grep . && echo ; \
+ fi ; \
done
testEduGAINchecks: