summaryrefslogtreecommitdiff
path: root/Makefile
blob: cf5653978604bdb2ef35446ef2f5542ec846c3b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
test:	mdtest idptest

tag:   commit
	./scripts/bump-tag

commit: test
	cd metadata ; make commit

bootstrap-trust:
	./scripts/update-trust

mdtest:
	@for dir in test-sp test-idp production-sp production-idp; do \
		for x in `ls metadata/$$dir/*.xml` ; do \
			xmllint --xinclude --nowarning --noout --path schema --schema schema.xsd $$x; \
			XML=$$(sed 's;\(</*\)[a-z0-9]*:;\1;g' $$x  | sed 's/xmlns="[^"]*"//'); \
			echo $$XML | xmllint --xpath '/EntityDescriptor/Organization/OrganizationName' - 2>/dev/null | grep -vq "^$$" || echo "  $$x missing OrganizationName" | sed 's/.*/&/' ; \
			echo $$XML | xmllint --xpath '/EntityDescriptor/Organization/OrganizationDisplayName' - 2>/dev/null | grep -vq "^$$" || echo "  $$x missing OrganizationDisplayName" | sed 's/.*/&/' ; \
			echo $$XML | xmllint --xpath '/EntityDescriptor/Organization/OrganizationURL' - 2>/dev/null | grep -vq "^$$" || echo "  $$x missing OrganizationURL" | sed 's/.*/&/' ; \
			echo $$XML | xmllint --xpath "/EntityDescriptor/ContactPerson[@contactType='technical']" - 2>/dev/null | grep -vq "^$$" || echo "  $$x: Missing ContactPerson contactType='technical'." | sed 's/.*/&/' ; \
			echo $$XML | xmllint --xpath "/EntityDescriptor/Extensions/RegistrationInfo" - 2>/dev/null | grep -vq "^$$" || echo "  $$x: Missing RegistrationInfo." | sed 's/.*/&/' ; \
			if echo $$XML | xmllint --xpath "/EntityDescriptor/SPSSODescriptor" - 2>/dev/null | grep -qE 'SPSSODescriptor'; then \
				echo $$XML | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/DisplayName" - 2>/dev/null | grep -vq "^$$" || echo "  $$x: Missing mdui:DisplayName." | sed 's/.*/&/' ; \
				echo $$XML | xmllint --xpath "/EntityDescriptor/SPSSODescriptor/Extensions/UIInfo/InformationURL" - 2>/dev/null | grep -vq "^$$" || echo "  $$x: Missing mdui:InformationURL." | sed 's/.*/&/' ; \
			else \
				echo $$XML | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/DisplayName" - 2>/dev/null | grep -vq "^$$" || echo "  $$x: Missing mdui:DisplayName." | sed 's/.*/&/' ; \
				echo $$XML | xmllint --xpath "/EntityDescriptor/IDPSSODescriptor/Extensions/UIInfo/InformationURL" - 2>/dev/null | grep -vq "^$$" || echo "  $$x: Missing mdui:InformationURL." | sed 's/.*/&/' ; \
			fi; \
			if grep -q "&#13;" $$x ; then \
				echo "  $$x" | sed 's/.*/&/' ;\
			fi;\
		done \
	done
	@xsltproc xslt/listRegInfo.xslt metadata/production-*/* metadata/test-*/* | \
	  egrep -v "https://fidus.skolverket.se/ https://github.com/FIDUSFederation/policy/blob/main/FIDUS_Interfederationsramverk.md|https://skolmyndighetsfederationen.skolverket.se/ https://github.com/FIDUSFederation/Skolmyndighetsfederationen/blob/main/policy-skolmyndighetsfederationen.md|http://www.swamid.se/ http://swamid.se/policy/mdrps|https://dnp-eduid-connect-federation.skolverket.se/ https://github.com/FIDUSFederation/DNP-eduID-Connect-Federation/blob/main/policy-dnp-eduid-connect-federation.md" | \
	   sed 's/.*/  Missing or Wrong RegInfo in &/' 

idptest:
	@if (grep -rq IDPSSODescriptor metadata/*-sp); then  echo "Hittade en IDP band SP:na !!!"; exit 1; fi


update: update-git
	./scripts/verify-tag && ./scripts/update-trust && rsync -avz --exclude fidus-interfederations-prod/*.xml --exclude fidus-interfederations-prod/last_aggregate.ts --exclude fidus-interfederations-test/*.xml --exclude fidus-interfederations-test/last_aggregate.ts --delete metadata/ /opt/metadata/

update-git:
	git checkout master && git reset --hard && git pull