Adjust import items according to hacking import rule

This patch adjust import items and add missing blank lines acording
to http://docs.openstack.org/developer/hacking/#imports
{{stdlib imports in human alphabetical order}}
\n
{{third-party lib imports in human alphabetical order}}
\n
{{project imports in human alphabetical order}}
\n
\n
{{begin your code}}

hacking project also enforce some checks for import group.
Let make the change in keytoneclient

Change-Id: Ic83bd5ee426905588f4a2d555851a9a01fc69f02
Copy s3_token middleware from keystone

The s3_token middleware was in keystone but it should be in
python-keystoneclient. As a first step to removing s3_token from
keystone, copy it to python-keystoneclient. Also copy the tests.

A couple of changes were required

- Changed oslo-incubator imports from keystone to keystoneclient.
- Changed logging from oslo-incubator to use Python logging and
  configured the same way as the auth_token middleware.

I checked and I didn't see anything to be added to requirements.txt
or test-requirements.txt.

bp s3-token-to-keystoneclient

Change-Id: I64fef4101180e5aa661442d538c3237bdad0c37c
Closes-Bug: #1178741
Return role names by AccessInfo.role_names

A new method was introduced on AccessInfo class. The method role_names
returns a list of role names of a user associated to the authorization
request.

bp keystoneclient-auth-ref-get-roles

DocImpact

Change-Id: I0862aaaa27193119dc83ef38100c88b48a1d24a4
Python 3: Fix an str vs bytes issue in tempfile

In Python 3, one cannot write:

    from tempfile import NamedTemporaryFile
    with NamedTemporaryFile() as f:
        f.write('foobar')

The input of f.write() must be bytes. Encode it when necessary in
middleware/auth_token.py, in a way that is compatible with Python 2.

Change-Id: Ib60afbc5e01c35f59cd7c9b68bfedb10ad897ff9
Merge "Copy s3_token middleware from keystone"
Merge "Adjust import items according to hacking import rule"
Merge "Return role names by AccessInfo.role_names"