Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tom Scavo committed May 10, 2017
2 parents a609fee + c881806 commit 6d7a590
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions README.md
@@ -6,7 +6,7 @@ XSLT transformations of SAML metadata

The scripts in this repository depend on a [Bash Library](https://github.internet2.edu/InCommon/bash-library) of basic scripts. Download and install the latter before continuing.

Download the source, change directory to the source directory, and install the source into ``/tmp`` as follows:
Download the source, change directory to the source directory, and install the source into `/tmp` as follows:

```Shell
$ export BIN_DIR=/tmp/bin
@@ -27,6 +27,8 @@ An installation directory will be created if one doesn't already exist. In any c
```Shell
$ ls -1 $BIN_DIR
http_xsltproc.sh
process_export_aggregate.sh
process_main_aggregate.sh

$ ls -1 $LIB_DIR
list_all_IdP_DisplayNames_csv.xsl
@@ -41,13 +43,13 @@ security_contacts_summary_local_json.xsl

## Overview

Bash script ``http_xsltproc.sh`` is a wrapper around the ``xsltproc`` command-line tool. Unlike ``xsltproc``, the ``http_xsltproc.sh`` script fetches the target XML document from an HTTP server using HTTP Conditional GET [RFC 7232]. If the server responds with 200, the script caches the resource and returns the response body. If the server responds with 304, the script returns the cached resource instead. See the inline help file for details:
Bash script `http_xsltproc.sh` is a wrapper around the `xsltproc` command-line tool. Unlike `xsltproc`, the `http_xsltproc.sh` script fetches the target XML document from an HTTP server using HTTP Conditional GET [RFC 7232]. If the server responds with 200, the script caches the resource and returns the response body. If the server responds with 304, the script returns the cached resource instead. See the inline help file for details:

```Shell
$ $BIN_DIR/http_xsltproc.sh -h
```

The ``http_xsltproc.sh`` script requires two environment variables. ``CACHE_DIR`` is the absolute path to the cache directory (which may or may not exist) whereas ``LIB_DIR`` specifies a directory containing various helper scripts.
The `http_xsltproc.sh` script requires two environment variables. `CACHE_DIR` is the absolute path to the cache directory (which may or may not exist) whereas `LIB_DIR` specifies a directory containing various helper scripts.

For example, let's use the library installed in the previous section and specify the cache as follows:

@@ -87,7 +89,7 @@ resource_dir=/home/htdocs/www.incommonfederation.org/federation/metadata/
/bin/mv $resource_file $resource_dir
```

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.
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.

### Example #2

@@ -131,7 +133,7 @@ resource_dir=/home/htdocs/www.incommonfederation.org/federation/metadata/
/bin/mv $resource1_file $resource2_file $resource_dir
```

Observe the commands ``http_xsltproc.sh -F`` and ``http_xsltproc.sh -C``. The former forces a fresh SAML metadata file as in the previous example; the latter goes directly to cache. If file is not in the cache (which is highly unlikely), the process terminates without updating any resource files.
Observe the commands `http_xsltproc.sh -F` and `http_xsltproc.sh -C`. The former forces a fresh SAML metadata file as in the previous example; the latter goes directly to cache. If file is not in the cache (which is highly unlikely), the process terminates without updating any resource files.

### Example #3

@@ -175,7 +177,7 @@ resource_dir=/home/htdocs/www.incommonfederation.org/federation/metadata/
/bin/mv $resource1_file $resource2_file $resource_dir
```

The commands ``http_xsltproc.sh -F`` and ``http_xsltproc.sh -C`` behave exactly as described in the previous example.
The commands `http_xsltproc.sh -F` and `http_xsltproc.sh -C` behave exactly as described in the previous example.

## Compatibility

0 comments on commit 6d7a590

Please sign in to comment.