Skip to content

Commit

Permalink
Add example to overview section
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Scavo committed Oct 22, 2016
1 parent bb4bb31 commit f01741e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,36 @@ IdP Display Name,IdP Entity ID,IdP Discovery,Registrar ID
"Case Western Reserve University",urn:mace:incommon:case.edu,show,https://incommon.org
```

### Example #1

Consider the following URLs:

```Shell
xml_location=http://md.incommon.org/InCommon/InCommon-metadata.xml
resource_url=https://incommon.org/federation/metadata/all_IdP_DisplayNames.csv
```

Suppose there is an automated process that transforms the SAML metadata at ``xml_location`` into the CSV file at ``resource_url``. Specifically, let's suppose the following process runs every hour on www.incommon.org:

```Shell
# the XSL script and the shell script are included in the md-transforms repository
xsl_file=$LIB_DIR/list_all_IdP_DisplayNames_csv.xsl
resource_file=/tmp/all_IdP_DisplayNames.csv
$BIN_DIR/http_xsltproc.sh -F -o "$resource_file" "$xsl_file" "$xml_location"
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "ERROR: http_xsltproc.sh failed with status code: $exit_code" >&2
exit $exit_code
fi

# the resource_dir is the target web directory for the resource_file
resource_dir=/home/htdocs/www.incommonfederation.org/federation/metadata/
mv $resource_file $resource_dir
exit 0
```

Observe that the command ``http_xsltproc.sh -F`` forces a fresh SAML metadata file. If the server responds with ``304 Not Modified``, the process terminates without updating the resource file.

## Compatibility

The executable scripts are compatible with GNU/Linux and Mac OS. The library files are written in XSLT 1.0.
Expand Down

0 comments on commit f01741e

Please sign in to comment.