-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stylesheet and perl script which, combined, list the SAML 2.0 support…
… for a list of entities given by ID attribute value (@ID, not @entityID).
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/perl -w | ||
|
|
||
| use Xalan; | ||
|
|
||
| open(XML, xalanCall . " -IN ../xml/ukfederation-metadata-unsigned.xml -XSL extract_saml2sp.xsl|") || die "could not open input file"; | ||
| while (<XML>) { | ||
| my ($id, $result) = split; | ||
| $results{$id} = $result; | ||
| print $_; | ||
| } | ||
| close XML; | ||
|
|
||
| open(IDS, "ids.txt") || die "could not open ids file"; | ||
| while (<IDS>) { | ||
| chop; | ||
| $id = $_; | ||
| if (defined $results{$id}) { | ||
| $result = $results{$id}; | ||
| } else { | ||
| $result = 'SP?'; | ||
| } | ||
| print "$result\n"; | ||
| } | ||
| close IDS; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| extract_saml2sp.xsl | ||
| XSL stylesheet that takes a SAML 2.0 metadata aggregate and extracts | ||
| SAML 2.0 support information for each SP entity. | ||
| Author: Ian A. Young <ian@iay.org.uk> | ||
| --> | ||
| <xsl:stylesheet version="1.0" | ||
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
| xmlns:ds="http://www.w3.org/2000/09/xmldsig#" | ||
| xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| exclude-result-prefixes="md ds"> | ||
|
|
||
| <!-- Output is plain text --> | ||
| <xsl:output method="text"/> | ||
|
|
||
| <xsl:template match="//md:EntityDescriptor[md:SPSSODescriptor]"> | ||
| <xsl:value-of select="@ID"/> | ||
| <xsl:text> </xsl:text> | ||
| <xsl:choose> | ||
| <xsl:when test="contains(md:SPSSODescriptor/@protocolSupportEnumeration, | ||
| 'urn:oasis:names:tc:SAML:2.0:protocol')">yes</xsl:when> | ||
| <xsl:otherwise>no</xsl:otherwise> | ||
| </xsl:choose> | ||
| <xsl:text>
</xsl:text> | ||
| </xsl:template> | ||
|
|
||
| <xsl:template match="text()"> | ||
| <!-- do nothing --> | ||
| </xsl:template> | ||
|
|
||
| </xsl:stylesheet> |