Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,2 +1,3 @@ | ||
*.out | ||
*.txt | ||
*.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,33 +1,33 @@ | ||
MD_FILE := InCommon-metadata.xml | ||
MD_URL := https://mdq.incommon.org/entities/all | ||
|
||
OUTPUT_FILES := all-entities.txt incommon-emails.txt incommon-entities.txt incommon-tls-hosts-ports.txt incommon-urls.txt | ||
OUTPUT_FILES := all-entities.out inc-entities.out inc-unique-public-emails.out inc-unique-saml-https-hosts-ports.out inc-unique-ui-urls.out | ||
|
||
define newline | ||
|
||
|
||
endef | ||
|
||
.PHONY: all | ||
all: $(OUTPUT_FILES) | ||
@wc -l all-entities.txt | ||
@wc -l incommon-emails.txt | ||
@wc -l incommon-entities.txt | ||
@wc -l incommon-tls-hosts-ports.txt | ||
@wc -l incommon-urls.txt | ||
$(foreach output_file,$^,@wc -l $(output_file)$(newline)) | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f $(OUTPUT_FILES) | ||
rm -f $(MD_FILE) | ||
|
||
$(MD_FILE): | ||
curl -o $(MD_FILE) $(MD_URL) | ||
|
||
all-entities.txt: $(MD_FILE) $(@:.txt=.xsl) | ||
xsltproc $(@:.txt=.xsl) $(MD_FILE) > $@ | ||
|
||
incommon-emails.txt: $(MD_FILE) $(@:.txt=.xsl) | ||
xsltproc $(@:.txt=.xsl) $(MD_FILE) | sed -e 's/^mailto://' | sort -u > $@ | ||
all-entities.out inc-entities.out: $(@:.out=.xsl) $(MD_FILE) | ||
xsltproc $(@:.out=.xsl) $(MD_FILE) > $@ | ||
|
||
incommon-entities.txt: $(MD_FILE) $(@:.txt=.xsl) | ||
xsltproc $(@:.txt=.xsl) $(MD_FILE) > $@ | ||
inc-unique-public-emails.out: inc-email-urls.xsl $(MD_FILE) | ||
xsltproc $< $(MD_FILE) | sed -e 's/^mailto://' | sort -u > $@ | ||
|
||
incommon-tls-hosts-ports.txt: $(MD_FILE) $(@:.txt=.xsl) | ||
xsltproc $(@:.txt=.xsl) $(MD_FILE) | grep '^https://' | awk -F'/' '{print $$3}' | sort -u > $@ | ||
inc-unique-saml-https-hosts-ports.out: inc-saml-urls.xsl $(MD_FILE) | ||
xsltproc $< $(MD_FILE) | grep '^https://' | awk -F'/' '{print $$3}' | sort -u > $@ | ||
|
||
incommon-urls.txt: $(MD_FILE) $(@:.txt=.xsl) | ||
xsltproc $(@:.txt=.xsl) $(MD_FILE) | sort -u > $@ | ||
inc-unique-ui-urls.out: inc-ui-urls.xsl $(MD_FILE) | ||
xsltproc $< $(MD_FILE) | sort -u > $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,25 @@ | ||
# incommon-md-counts | ||
|
||
Utilities for counting entities and unique elements in InCommon SAML metadata | ||
|
||
## Quick Start | ||
|
||
To produce counts for the currently published InCommon metadata aggregate, run | ||
`make`. | ||
|
||
The first time the process runs, it downloads the InCommon metadata aggregate. | ||
Then it runs a few transformations on the aggregate (XSLT, sed/awk, etc.) to | ||
generate its output files. | ||
|
||
Finally, it prints line counts for each output file; for example: | ||
|
||
``` | ||
12892 all-entities.out | ||
6277 inc-entities.out | ||
3066 inc-unique-public-emails.out | ||
10011 inc-unique-saml-https-hosts-ports.out | ||
3658 inc-unique-ui-urls.out | ||
``` | ||
|
||
To remove all downloaded and generated files, run `make clean`. | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.