Adds support for username to match the v2 spec

The v2.0 API spec uses username for the user's name, whereas the v3 API
just uses name. The v2.0 implementaion incorrectly used name instead of
username, but did allow a username to be specified and stored in the
extras.

This patch makes the implementation more closely conform to the API
without breaking backward compatibility. Anyone using name in the v2.0
API can continue to do so. They can even specify a username that will
still get stored in the extras. Users can now use the documented
username instead of name and the API will work for them as well.

Both name and username will always be returned for the v2 API calls.

DocImpact
Change-Id: Ia95aa5d442a8311925399fa59e5022d31f68d374
Closes-Bug: #1214686
Clean up docstrings in contrib.oauth1.core

The docstrings were using the wrong parameter name.

Change-Id: I237b2b137fa8c8f6138a4a7eacf6140843517225
description is wrong in endpoint filter rst doc

Literal block must start and end with blank line.

Change-Id: Ib80bc76101da34b8251d731cee5b60bde45ec099
Closes-Bug: #1269300
append extension name to trust notifications

Change-Id: If1111dd39d9ad421fb7a6f23c9e2db4947387592
Remove sql.Base.get_session

With the change to use oslo's db.sqlalchemy.sessions, the
sql.Base class isn't doing enough to justify its continued
existence.

This change is removing the get_session member, which was just
a new name for openstack.common.db.sqlalchemy.session.get_session() .

Part of bp use-common-oslo-db-code

Change-Id: I083ecd54200dcd6cae7248d1a6ef4fcec64e6589
Move sql.Base.transaction

With the change to use oslo's db.sqlalchemy.sessions, the
sql.Base class isn't doing enough to justify its continued
existence.

This change is moving the transaction member out of Base.

Part of bp use-common-oslo-db-code

Change-Id: Ie0df7b397f8508e1c9be70ce9bbb2d733bde03ea
Don't mask the filter built-in

There was an argument to a function called 'filter'. 'filter' is a
python built-in, so that name shouldn't be reassigned
to something else since that will mask the built-in which can be
confusing and problematic when someone wants to use the built-in.

Also, changed the name of the sql.Base member to filter_query for
the same reason.

Change-Id: I8eb13c73bd8cf0f31e08951bc0fcaf49abd49ef1
Use six.text_type to replace unicode

unicode only exists in Python 2. Use six.text_type to make code
Python 3 comaptible. See http://pythonhosted.org/six/#six.text_type

Part of blueprint keystone-py3kcompat

Change-Id: I044036708b1fc6190647abce699e6898b274d487
Merge "Remove sql.Base.get_session"
Merge "Move sql.Base.transaction"
Merge "Don't mask the filter built-in"
correct the document links in man documents

Keystone man documents "SEE ALSO" url shoud be keystone.openstack.org

Change-Id: Ic0ed7ad76903072d7bd1421215277d9dbb9c5775
Merge "description is wrong in endpoint filter rst doc"
Merge "append extension name to trust notifications"
build auth context from middleware

Refactors the logic where we build the credentials (or auth context), to be
used for authorization decision, from the incoming auth token to be handled by
middleware. The authorization code is isolated into
keystone.common.authorization.

This patch lays the plumbing for bp client-ssl-certificate-authorization.

DocImpact: added a new build_auth_context middleware filter to the API
pipelines in keystone-paste.ini. It is responsible for building the auth
context (a.k.a. policy-check credentials) based on the incoming auth token
to facilitate API authorization. Auth context is required for API
authorization.

Change-Id: Icee58a5bd47b0ded3b53a8838012864c1c0abcc5
Merge "Adds support for username to match the v2 spec"
Merge "build auth context from middleware"
Merge "Clean up docstrings in contrib.oauth1.core"
Merge "correct the document links in man documents"