first implementation with the flask-login plugin

the plugin can manage sessions for the web interface and support
different ways of authenticating

refactored the auth part a bit to
1. make it easier to expand
2. fix importing issues
fix debug logging in run.py
adapt the storage tests to the refactored authentication

the authentication now consistently returns the http error code 401 in
case of missing or incorrect credentials and the tests have been adapter
to that.
this is conform to the http/1.1 spec and the CDMI spec.

(before, 403 errors were returned after an unsuccessful
authentication attempt)

add the app's secret key to test config that is needed for the
flask-login plugin
add Flask-Login to the requirements
refactor the registration test ot use the TestApi class

also add db initialization to the TestApi class
accept Gsi auth in localstorage

no authorization provided, if a user authenticates correctly, she can do
everything :)
adapt storages and tests to support the auth object

- rename Auth() -> UserInfo()
- adapt connection management to use the UserInfo object
- extend UserInfo to record the auth_hash and client_address (IP)
- extend dmlitestorage to pass credentials to dmlite
stay with the _get_auth() function for test's sake

so that we can patch this function in the storage-only tests.
fix Gsi authentication

- extend printing of UserInfo
- fix filling the variables for gsi auth from the proxy
fix dmlite auth and fill in headnode write methods

add working function bodies to the rm, rmdir, mkdir, write, .. functions.
the write function now only has the headnode part, so in redirects on
every request.

fix the connect() function of the dmlite_connection to correctly pass
authentication info to dmlite.
fix redirection when behind a proxy

if we are behind a proxy, flask should send redirections to the
proxy address, not its own.
add the variable EXTERNAL_HOST that is a string of scheme, host,
and port to describe the correct endpoint.
e.g. https://host.org or http://host2.org:8080

if the variable is not set, flask sends out relative url redirects
simplify get_file_obj in cdmi.py

avoid an exception when asking for the range_request list.
this leads to fewer lines of code and should be faster
optimize reading a file through cdmi

only go to the backend, when the client asks for the value.
all other attributes (including the file size that the read()
function provides, but that we don't use anymore) can be provided
by a stat. this avoid opening the file at all.
note: also before there was no unnecessary data transferred, we now
just also skip the file opening step)

this change does _not_ change the interface to the storage, but
removing the 'file_size' return value from read() would be in order.
fix storage_interface_tests; adapt to UserInfo object
fix dmlitestorage redirection; add dmlite errorcode

- make sure that the parameters (that include the token) are not
quoted when passed to the frontend. they will be url-quoted there,
which results in errors for some values.

- add a case for the NO_REPLICA errno and treat it as FileNotFound
add user metadata support to dmlitestorage

set usermeta not tested ...
fix reading files in dmlitestorage
also create a cdmi object id when uploading plain http

refactor the cdmi object id creation code into http_storage/common.py
and use in both cdmi.py and noncdmi.py
let the cdmi object id creation fail silently
Merge pull request #90 from mhellmic/auth

Auth object to pass on authentication details.
The registration works with user/pass authentication, but has to be adapted for gsi auth.