From 722e2cc6bbb88ff14a6ceab1f7fc676813df7b36 Mon Sep 17 00:00:00 2001 From: Björn Mattsson Date: Wed, 20 May 2020 12:06:43 +0200 Subject: Resolves SWAMID-3007 --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 06bbe66c..ae7fd86e 100644 --- a/Makefile +++ b/Makefile @@ -175,8 +175,6 @@ testMDUI: @echo "Checking for bad lang codes" @# Lang = ISO_639-1 @for x in swamid-2.0/*.xml ; do bad_langs=`cat $$x | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u | grep -vxE 'cs|da|de|en|fi|fr|it|sv|no|nn|nb|is'` ; if [ -n "$$bad_langs" ] ; then echo " $$x: `echo $$bad_langs`" | sed 's/.*/&/' ; fi ; done | grep . && exit 1 || exit 0 - @echo "Check for mismatch between MDUI DisplayName and OrganizationDisplayName" - @for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor` ; do for lang in `cat $$x | sed -n 's/.*xml:lang="\(..\)".*/\1/p' | sort -u` ; do mdui_displayname=`cat $$x | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'` organizationdisplayname=`cat $$x | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'` ; if [ -n "$$mdui_displayname" -a -n "$$organizationdisplayname" -a "$$mdui_displayname" != "$$organizationdisplayname" ] ; then echo "$$x: $$lang '$$mdui_displayname' vs $$lang '$$organizationdisplayname'" | sed 's/.*/&/'; fi ; done ; done | grep . && exit 1 || true @echo "Checking for uniq IdP MDUI DisplayName" @for lang in `cat swamid-2.0/*.xml | sed -n 's/.*xml:lang="\([^"]*\)".*/\1/p' | sort -u` ; do for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor` ; do cat $$x | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g' | sed "s;^; $$x $$lang ;" | sed 's/.*/&/' ; done | sort -k 3 | uniq -d -f 2 ; done | grep . && exit 1 || true @echo "Checking for invalid IPHint" @@ -279,7 +277,8 @@ test2: $(SWAMIDXML) schematest testMDUI testOrgData testEntCat testSimpleSign te @if ( grep -q IDPSSODescriptor $< ) ; then \ echo "Do IdP checks" ; \ for lang in `cat $< | sed -n 's/.*xml:lang="\(..\)".*/\1/p' | sort -u` ; do \ - mdui_displayname=`cat $< | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'` organizationdisplayname=`cat $< | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'` ; if [ -n "$$mdui_displayname" -a -n "$$organizationdisplayname" -a "$$mdui_displayname" != "$$organizationdisplayname" ] ; then echo "Missmatch for lang = $$lang\nDisplayName = '$$mdui_displayname' but OrganizationDisplayName = '$$organizationdisplayname'" | sed 's/.*/&/'; fi | grep . && exit 1 || true ;\ + mdui_displayname=`cat $< | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'`;\ + organizationdisplayname=`cat $< | sed 's;\(/dev/null | sed 's/^[ ]*//;s/[ ]*$$//' | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g'` ;\ for x in `find $(SRCDIRS) -name \*.xml | xargs grep -l IDPSSODescriptor | egrep -v $<` ; do cat $$x | sed 's;\(/dev/null | tr -d '\n' | sed 's;<[^>]*>\([^<]*\)]*>;\1\n;g' | egrep "^$$mdui_displayname$$" | sed "s;^;Duplicate DisplayName in $$x for lang = $$lang\n;" | sed 's/.*/&/' ; done | grep . && exit 1 || true;\ done \ fi -- cgit v1.2.3