Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Initial commit
  • Loading branch information
dshafer committed May 12, 2023
0 parents commit aa3e6fc
Show file tree
Hide file tree
Showing 7 changed files with 254 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*.txt
*.xml
33 changes: 33 additions & 0 deletions Makefile
@@ -0,0 +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

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

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 > $@

incommon-entities.txt: $(MD_FILE) $(@:.txt=.xsl)
xsltproc $(@:.txt=.xsl) $(MD_FILE) > $@

incommon-tls-hosts-ports.txt: $(MD_FILE) $(@:.txt=.xsl)
xsltproc $(@:.txt=.xsl) $(MD_FILE) | grep '^https://' | awk -F'/' '{print $$3}' | sort -u > $@

incommon-urls.txt: $(MD_FILE) $(@:.txt=.xsl)
xsltproc $(@:.txt=.xsl) $(MD_FILE) | sort -u > $@
36 changes: 36 additions & 0 deletions all-entities.xsl
@@ -0,0 +1,36 @@
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui">

<xsl:output method="text"/>

<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()"/>
</xsl:message>

<xsl:apply-templates/>
</xsl:template>

<xsl:template match="/">
<xsl:apply-templates select="md:EntitiesDescriptor"/>
</xsl:template>

<xsl:template match="md:EntitiesDescriptor">
<xsl:for-each select="md:EntityDescriptor">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>


<xsl:template match="md:EntityDescriptor">
<xsl:value-of select="@entityID"/><xsl:text>
</xsl:text>

</xsl:template>

</xsl:stylesheet>
41 changes: 41 additions & 0 deletions incommon-emails.xsl
@@ -0,0 +1,41 @@
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui">

<xsl:output method="text"/>

<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()"/>
</xsl:message>

<xsl:apply-templates/>
</xsl:template>

<xsl:template match="/">
<xsl:apply-templates select="md:EntitiesDescriptor"/>
</xsl:template>

<xsl:template match="md:EntitiesDescriptor">
<xsl:for-each select="md:EntityDescriptor">
<xsl:if test="md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority = 'https://incommon.org'">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>


<xsl:template match="md:EntityDescriptor">
<xsl:apply-templates select="md:ContactPerson"/>
</xsl:template>

<xsl:template match="md:ContactPerson">
<xsl:value-of select="md:EmailAddress"/><xsl:text>
</xsl:text>
</xsl:template>

</xsl:stylesheet>
38 changes: 38 additions & 0 deletions incommon-entities.xsl
@@ -0,0 +1,38 @@
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui">

<xsl:output method="text"/>

<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()"/>
</xsl:message>

<xsl:apply-templates/>
</xsl:template>

<xsl:template match="/">
<xsl:apply-templates select="md:EntitiesDescriptor"/>
</xsl:template>

<xsl:template match="md:EntitiesDescriptor">
<xsl:for-each select="md:EntityDescriptor">
<xsl:if test="md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority = 'https://incommon.org'">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>


<xsl:template match="md:EntityDescriptor">
<xsl:value-of select="@entityID"/><xsl:text>
</xsl:text>

</xsl:template>

</xsl:stylesheet>
49 changes: 49 additions & 0 deletions incommon-tls-hosts-ports.xsl
@@ -0,0 +1,49 @@
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui">

<xsl:output method="text"/>

<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()"/>
</xsl:message>

<xsl:apply-templates/>
</xsl:template>

<xsl:template match="/">
<xsl:apply-templates select="md:EntitiesDescriptor"/>
</xsl:template>

<xsl:template match="md:EntitiesDescriptor">
<xsl:for-each select="md:EntityDescriptor">
<xsl:if test="md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority = 'https://incommon.org'">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>

<xsl:template match="md:EntityDescriptor">
<xsl:apply-templates select="md:IDPSSODescriptor | md:SPSSODescriptor"/>
</xsl:template>

<xsl:template match="md:IDPSSODescriptor">
<xsl:for-each select="md:ArtifactResolutionService | md:AttributeService | md:SingleLogoutService | md:SingleSignOnService">
<xsl:value-of select="@Location"/><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>

<xsl:template match="md:SPSSODescriptor">
<xsl:for-each select="md:AssertionConsumerService">
<xsl:value-of select="@Location"/><xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>
55 changes: 55 additions & 0 deletions incommon-urls.xsl
@@ -0,0 +1,55 @@
<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata"
xmlns:mdrpi="urn:oasis:names:tc:SAML:metadata:rpi"
xmlns:mdui="urn:oasis:names:tc:SAML:metadata:ui">

<xsl:output method="text"/>

<xsl:template match="*">
<xsl:message terminate="no">
WARNING: Unmatched element: <xsl:value-of select="name()"/>
</xsl:message>

<xsl:apply-templates/>
</xsl:template>

<xsl:template match="/">
<xsl:apply-templates select="md:EntitiesDescriptor"/>
</xsl:template>

<xsl:template match="md:EntitiesDescriptor">
<xsl:for-each select="md:EntityDescriptor">
<xsl:if test="md:Extensions/mdrpi:RegistrationInfo/@registrationAuthority = 'https://incommon.org'">
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>


<xsl:template match="md:EntityDescriptor">
<xsl:apply-templates select="md:IDPSSODescriptor | md:SPSSODescriptor"/>
</xsl:template>

<xsl:template match="md:IDPSSODescriptor">
<xsl:value-of select="@errorURL"/><xsl:text>
</xsl:text>
<xsl:apply-templates select="md:Extensions/mdui:UIInfo"/>
</xsl:template>

<xsl:template match="md:SPSSODescriptor">
<xsl:apply-templates select="md:Extensions/mdui:UIInfo"/>
</xsl:template>

<xsl:template match="mdui:UIInfo">
<xsl:value-of select="mdui:InformationURL"/><xsl:text>
</xsl:text>
<xsl:value-of select="mdui:PrivacyStatementURL"/><xsl:text>
</xsl:text>
<xsl:value-of select="mdui:Logo"/><xsl:text>
</xsl:text>
</xsl:template>

</xsl:stylesheet>

0 comments on commit aa3e6fc

Please sign in to comment.