pulibrary/loris — pull request #137 by scande3 (2014-11-14 21:42:30+00:00)
Title: Initial stab at SimpleHTTPResolver Functionality

This pull request adds a SimpleHTTPResolver with various common config
options. These options are as follows:

The config dictionary MUST contain
* `cache_root`, which is the absolute path to the directory where
source images should be cached.

The config dictionary MAY contain
* `source_prefix`, the url up to the identifier.
* `source_suffix`, the url after the identifier (if applicable).
* `default_format`, the format of images (will use content-type
of response if not specified).
* `head_resolvable` with value True, whether to make HEAD requests
to verify object existence (don't set if using Fedora Commons
prior to 3.8).
* `uri_resolvable` with value True, allows one to use full uri's
to resolve to an image.
* `user`, the username to make the HTTP request as if needed.
* `pw`, the password to make the HTTP request as if needed.

Additionally, there is a new clean script titled
"loris-http_cache_clean.sh" in the bin directory with more granular
directory options.

Known issues:

1. It still does a base bare identifier call that usually will return
'false' first before trying more common routing cases.

2. The code to determine an identifier will strip out a slash in
"http://". I currently compensate for this flaw but should bbe fixed
in webapp.py's _dissect_uri.

3. Unit test coverage is sparse and needs to be expanded for more
cases. Additionally, things need to be more properly mocked out
as using a live url for the resolver at the moment.

4. The "links" and "info" directories are a mess regardless of
resolver due to all entries not being subdivided. Not sure if this
matters. In addition, it will write ":" if part of the identifier
(not allowed on some file systems) along with symlinks being
unsupported in some drive storage cases.