Fix assignment KVS backend to not use identity

The assignment KVS backend was using the identity API. This change
makes it so that the KVS backend does not use the identity API.

The assignment KVS backend was using the identity API to:

a) Store the user's projects.

The user's projects were also kept in the metadata. So the KVS
backend was changed to use the metadata rather than the user data.

a) Determine if the ID in the metadata was for a user or group.

The metadata for users and groups was split into separate keys.
Metadata for users is now prefixed with `metadata_user-` and
`metadata-groups-` is used for groups.

bp no-check-id

Change-Id: I5cc01d203d12b15575b72ad57aa3820d1d36d09f
Move filter_limit_query out of sql.Base

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 filter_limit_query and related internal
members out of sql.Base to regular functions in the sql module.

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

Change-Id: Ia4f05e5a81ded7e3543e16ecf93260680351f1e4
Setup code for auto-config sample generation

Sync in the oslo code for auto-config sample generation and
make the appropriate changes to setup to allow for automatic
option discovery.

`test-requirements.txt` now includes stevedore to
ensure the oslo libraries can all be loaded as expected.

Change-Id: Ieca0aea4d3c67b930c12467317d2f4d83763b601
Restructure KDS options to be more like Keystone's options

Restructure the KDS options to be more closely aligned with the way
Keystone options work and allowing movement towards not registering
the options on import. This will also prevent KDS options from
appearing in the Keystone auto-generated sample config.

Change-Id: I073aa58ff3132e2714478f54c88c3a8200ff47da
Cleanup Dogpile KVS Memcache backend support

General cleanup of the Dogpile KVS Memcache backends to be simpler
names and remove the 'dogpile_' prefix for the memcache_driver
argument utilized by the memcached backend pivot point. Documentation
updated to match KVS memcached changes.

DocImpact

Change-Id: Ieb368d440e48111d844c6e715ed17dd54ca50802
bp: dogpile-kvs-backends
Variable 'domain_ref' referenced before assignment

Variable not declared before try...catch sentences trigger a
"Local variable 'domain_ref' referenced before assignment" error when
an exception is raised.

Co-Authored-By: David Stanek <dstanek@dstanek.com>
Change-Id: I0a63347cb316e3a5923243dd934a7fc51dbf1e13
Closes-Bug: #1274402
`find_migrate_repo` improvement

* Added `repo_name` attribute with default value as `migrate_repo`. Allow
flexibly look for migrate repos with different names.
* Abridged logic of dependency from a module location.
* Moved to `common.utils`. Required to synchronize with
`openstack.common.db.sqlalchemy.migration`

Change-Id: I8aa364f1654fb92fba287cd406670b03f8ec3a54
Use Oslo.db migration

Changed imports from keystone.common.sql.migration to
keystone.openstack.common.db.sqlalchemy.migration.py.
Surrounding code adapted.

Change-Id: I0bdfc6d386d8b11f01da9061ffaf15462840822e
Blueprint: use-common-oslo-db-code
Additional notifications for revocations

OAuth and assignment notifications that will
trigger revocation events.

Change-Id: Ice91de6345df3d9f3e13dd7c032993669ca9d0af
Implements: bp revocation-events
Use global to represent OS-TRUST:trust

When sending a notification a resource_type is required, such as a
'user', 'project', or 'OS-TRUST:trust'. This value is consistent between
operations so it can be stored in a class global variable.

Change-Id: I1a9e66330d980e13d306f4d6a6c0f248e75a858e
Clean StatsController unnecesary members

Removed from StatsController unused members

identity_api, policy_api, token_api

Closes-Bug: #1255990
Change-Id: I0edfe5ce270a2d88dc33273a05c9f13eb379c052
Merge "Additional notifications for revocations"
Merge "Setup code for auto-config sample generation"
Replace notifier with oslo.messaging

Oslo messaging works slightly differently in that you create a Notifier
object once which contains config such as publisher_id and then you
re-use that object when issuing messages.

DocImpact: The options for setting up RPC and notifications have changed
to reflect oslo.messaging.

Blueprint: oslo-messaging
Change-Id: I2d08fb405e68df37866b3799ab7339ebd9894f05
Merge "Cleanup Dogpile KVS Memcache backend support"
Merge "`find_migrate_repo` improvement"
Merge "Replace notifier with oslo.messaging"
Switch over to oslosphinx

oslosphinx is the new name of oslo.sphinx

Closes-Bug: #1277168
Change-Id: I9c52b7ad5459c51ed3d2a92d9011c34c9de4de5a
Merge "Use global to represent OS-TRUST:trust"
Merge "Use Oslo.db migration"