Commit Graph

8 Commits

Author SHA1 Message Date
Sahid Orentino Ferdjaoui 70337682d9 auth_token: fix issue when data in cache gets corrupted
Previously token cache was not correctly handling the case when data
in memcached is un-decryptable.
The cache process was returning a null value that was not considered
resulting a python exception raised

The commit fixes the issue by adding a condition to validate the value
returned.

Closes-bug: #2023015
Change-Id: Ic48d20569980781febc194083651736bed446953
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
2023-08-14 14:42:50 +00:00
Stephen Finucane 22408f8da0 Remove six
Change-Id: Ib3edfdd087ed1d954f1ecf72a191138f8f1c46a1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-06-27 18:03:31 +01:00
Morgan Fainberg c46f29278d Fix KeystoneMiddleware memcachepool abstraction
Keystonemiddleware's abstraction for the memcache pool was broken
when converting to use a queue.Queue. The logic that placed the
connection back into the pool was moved to .acquire and the reserve
method was not using acquire.

Change-Id: I0eda5981cbb661f63790258cf8e70c7340615159
Closes-Bug: #1782404
2018-07-18 11:56:43 -07:00
wangxiyuan 33a712bed7 Fix the AttributeError: __exit__ error
The memcache client class actually has no __exit__ function.

Remove the "with" usage to avoid the __exit__ error.

Change-Id: I15b3d08f4afae289e7eb0848ff1db08141196d3c
Closes-Bug: #1747565
2018-02-22 16:31:11 +08:00
wangxiyuan ce06c0ce10 Add arguments for MemcacheClientPool init
Now keystonemiddleware use oslo.cache to init the
MemcacheClientPool. The MemcacheClientPool in
Olso.cache needs (urls, arguments, **kwargs) parameter
to init, but keystonemiddleware passed only
(urls, **kwargs). Then it leads the error:
__init__() takes exactly 3 arguments (2 given)

This patch fixed this issue.

Please note that even this error is fixed, set
"memcache_use_advanced_pool = True" will lead another
error, see bug #1747565 for the detail. It will be
fixed in the following patch.

Closes-bug: #1748160
Change-Id: I642f959ab8b010207314312a6b6a06a6de23e92c
2018-02-22 16:27:31 +08:00
Colleen Murphy 409b482253 Rename auth_uri to www_authenticate_uri
The [keystone_authtoken]/auth_uri middleware parameter has been causing
extreme confusion amongst operators and developers ever since the
keystonemiddleware started accepting keystoneauth plugin parameters
including auth_url. The two parameters look identical and yet have
completely different meanings and are both required. This patch
deprecates auth_uri and renames it to www_authenticate_uri, which more
accurately describes the WWW-Authenticate header it is configuring and
is dissimilar to any other keystone_authtoken middleware parameter. This
also renames the internal variable names for consistency with the config
option.

Change-Id: I0cf11da3d395749df28077427689fdafc8a6b981
2017-10-11 14:00:49 +02:00
Jamie Lennox f54ff06c1f Handle cache invalidate outside cache object
Move the logic that handles invalid cache entries out of the cache
object itself. This makes the cache interface more normal and will make
it easier to convert to oslo.cache later.

Rename the store method to set because this is the interface that
oslo.cache uses.

Related-Bug: #1523375
Change-Id: Ia7b11a69f14e17a9d7a36c009d9a965be16509d0
2016-04-04 14:54:55 +10:00
Jamie Lennox ba9ab512e3 Seperate standalone cache tests
Create a new file for cache tests and bring across the tests that
are not tied up in the common v2 and v3 tests.

Change-Id: I2fdfc16efeb4d2c730ea6905f61c19f0e64edc1c
2015-09-01 13:47:15 +10:00