Subclasses of TestCase don't need to reset conf

Subclasses of TestCase were unnecessarily resetting the config on
cleanup. This is unnecessary because TestCase resets the config
already.

This takes care of some TODOs in the code.

Change-Id: I4350efb03a40616e6a9e7fb6ee7cc507f4709f00
Cleanup test_no_admin_token_auth cleanup code

The addCleanup call for the temporary paste config file was separated
from where it was needed because the function that required it
was outside the TestNoAdminTokenAuth class. This moves the
function to be a member and moves the addCleanup call in the
member function right where it's needed.

It's better to put the addCleanup code close to where it's needed
because then it will be called even if an exception occurs.

Change-Id: I50c97a3229958f4d15c7cd68ffa2a9d45914d1db
Fix sample config external default doc

The sample config file documented the incorrect default for the
[auth].external value as defined in keystone.common.config.

Change-Id: I6f9454f35eaade5fa35738a9ba3f74a388bf5099
Enable lazy translation

This change makes it so that if the user makes a request with an
Accept-Language header and the response is an error where the
message is translatable, then the message will be translated to
the requested language (or the most appropriate language
available).

completes bp user-locale-api

Change-Id: I5b0b02e0459a6a444baa12f8722adb829b7e152b
Document running with pdb

There was no documentation in "Developing with Keystone" that
makes it obvious that you can use "tox -e debug" to run with pdb
breakpoints.

Change-Id: I82cc827d076a4d95ab6a2f903ceb0cde34005bc3
Refactor context trust_id check to wsgi.Application base class

Move the ec2 controller check for a trust_id in the token
specified in the request context, renaming it to match the
existing convention in the controller base classes.

This function can be used by both v2 and v3 controllers
hence putting it into the common Application base class.

Test coverage for this is provided via existing tests in
test_keystoneclient_sql.py

Change-Id: I6028a2cfa0e9e2e16acc99b5a0a027cd6cc42ada
Partial-Bug: #1259584
Store trust_id for v3/credentials ec2 keypairs

To fix bug #1259584 without re-opening the vulnerablility fixed in
bug #1242597, we need to store the trust_id in the data blob when
storing an ec2 keypair via the v3/credentials API.  This is already
done when keypairs are created/stored via the ec2tokens interface,
so this aligns the behavior when the credentials are created via
v3/credentials.

Change-Id: I8443d30dffed4201b46d10cef6a0bb43ccdcddc1
Partial-Bug: #1259584
Store ec2 credentials blob as json

For compatibility with the v3/credentials API, the blob dict should
be stored serialized as json.  To maintain backwards compatibility
with existing DB contents stored via the ec2tokens interface, we
fall back to the previous behavior if we fail to load the blob.

Change-Id: I21f068c308df5aa6a818031d3bc86a81b2bd25f4
Closes-Bug: #1259584
v3 credentials, ensure blob response is json

The v3/credentials API specifies the blob response to be json, but
due to bug #1259584, any credentials stored via the ec2tokens extension
will incorrectly return a dict.  This makes it hard for clients (and
in particular users migrating from ec2tokens to v3/credentials) to
handle the blob data consistently, so add a workaround to ensure the
response is always serialized as json if the existing DB contents is
a dict instead of a json string.

Change-Id: I340cdf4e565fdadacb41b39acace3948aafb9b92
Related-Bug: #1259584
Closes-Bug: #1269637
Update comments in test_v3_protection.py

Updated some comments that were not anymore up do date.

Change-Id: I388ccb69762dd1bf8a41a8061bab5380eb06dbbc
Move KDS paths file

Paths are really only needed for testing so they should live in the
testing directory rather that in the application code.

We don't really need the paths we had as they are used for static
directories and template directories, neither of which are used.

Change-Id: I14aa5e332e7df2b21311fe369a1f2706efee4cc3
Merge "Document running with pdb"
Merge "Fix sample config external default doc"
Merge "Subclasses of TestCase don't need to reset conf"
Merge "Cleanup test_no_admin_token_auth cleanup code"
Merge "Refactor context trust_id check to wsgi.Application base class"
Merge "Store trust_id for v3/credentials ec2 keypairs"
Merge "Store ec2 credentials blob as json"
Merge "v3 credentials, ensure blob response is json"
Merge "Enable lazy translation"