Skip to content
Snippets Groups Projects
Unverified Commit 1cf77b44 authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Properly cache swift v3 token


The V3 token has an export function. Without this the token is
effectively never cached.

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent 195db56c
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,12 @@ class SwiftFactory { ...@@ -60,7 +60,12 @@ class SwiftFactory {
} }
private function cacheToken(Token $token, string $cacheKey) { private function cacheToken(Token $token, string $cacheKey) {
$this->cache->set($cacheKey . '/token', json_encode($token)); if ($token instanceof \OpenStack\Identity\v3\Models\Token) {
$value = json_encode($token->export());
} else {
$value = json_encode($token);
}
$this->cache->set($cacheKey . '/token', $value);
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment