keystone/keystone
Adam Young 75abc21ecf Replace revoke tree with linear search
The RevokeTree was built out of an attempt to optimize the search for
a match between a candidate token and the list of revocation events.
The performance proved to be poor, mostly due to the cost of creating
and checking hash values.

The RevokeTree code is also so complex that most of the team could not
understand it or troubleshoot it.  There are some subtle bugs due to
race conditions with revocation events, and it is impossible to track
them down due to the code complexity.

This change replaces the tree based search with a linear search through
the list of revocation events.  A failure-to-match will pass through
the entire list.  A revoked token should match on O(n/2) comparisons.

With the past year of Fernet tokens in deployment, the feedback is that
the number of revocation events is small, and they only are kept for
the lifetime of the tokens (usually 1-8 hours) so the linear search is
not expected to slow down token validations in live deployments.

Future work will also reduce the number of revocation events.

Change-Id: Ib6a686494e897840b09d134ecf1ca50ce712f281
2016-05-24 13:11:30 -04:00
..
assignment Move the assignment abstract base class out of core 2016-05-11 17:14:04 +00:00
auth Enable py3 tests for test_v3_auth 2016-05-20 11:56:06 -07:00
catalog Move the catalog abstract base class and common code out of core 2016-05-06 21:58:38 +00:00
cmd Merge "Fix D400 PEP257" 2016-04-21 19:37:08 +00:00
common Replace revoke tree with linear search 2016-05-24 13:11:30 -04:00
contrib Move the catalog abstract base class and common code out of core 2016-05-06 21:58:38 +00:00
credential Enable py3 for credential tests 2016-05-18 23:13:36 +00:00
endpoint_policy Restructure endpoint policy abstract driver 2016-04-27 16:23:47 -03:00
federation Merge "Separate protocol schema" 2016-05-17 01:42:29 +00:00
identity Merge "Move identity.backends.sql model code to sql_model.py" 2016-05-23 20:38:36 +00:00
locale Imported Translations from Zanata 2016-04-21 07:06:59 +00:00
middleware Merge "Make AuthContext depend on auth_token middleware" 2016-05-19 02:38:10 +00:00
models Replace revoke tree with linear search 2016-05-24 13:11:30 -04:00
oauth1 Move the oauth1 abstract base class out of core 2016-05-16 18:44:12 +00:00
policy Merge "Restructure policy abstract driver" 2016-04-29 22:08:00 +00:00
resource Drop the (unused) domain table 2016-05-13 18:10:38 +01:00
revoke Replace revoke tree with linear search 2016-05-24 13:11:30 -04:00
server Replace revoke tree with linear search 2016-05-24 13:11:30 -04:00
tests Replace revoke tree with linear search 2016-05-24 13:11:30 -04:00
token Enable py3 testing for Fernet token provider 2016-05-18 23:14:14 +00:00
trust Fix D401 PEP8 violation. 2016-04-14 20:08:52 +00:00
v2_crud Move user and admin crud to core 2016-02-06 15:44:12 +00:00
version Remove comments mentioning eventlet 2016-04-19 08:59:38 -03:00
__init__.py Revert "Disable eventlet monkey-patching of DNS" 2013-05-10 10:24:48 -04:00
exception.py Fix D401 PEP8 violation. 2016-04-14 20:08:52 +00:00
i18n.py Change oslo.i18n to oslo_i18n 2015-02-09 18:10:07 -06:00
notifications.py replace logging with oslo.log 2016-05-10 08:42:49 +08:00
service.py Create a version package 2015-10-12 23:59:16 +00:00